public interface NodeExtension
Modifier and Type | Method and Description |
---|---|
void |
afterStart()
Called after node is started
|
void |
beforeJoin()
Called before node attempts to join to the cluster
|
void |
beforeShutdown()
Called before Node.shutdown()
|
void |
beforeStart()
Called before node is started
|
Map<String,Object> |
createExtensionServices()
Creates additional extension services, which will be registered by
service manager during start-up.
|
MessageTaskFactory |
createMessageTaskFactory()
Creates factory method that creates server side client message handlers
|
ReadHandler |
createReadHandler(TcpIpConnection connection,
IOService ioService)
Creates a ReadHandler for given Connection instance.
|
SerializationService |
createSerializationService()
Creates a SerializationService instance to be used by this Node.
|
<T> T |
createService(Class<T> type)
Creates a service which is an implementation of given type parameter.
|
WriteHandler |
createWriteHandler(TcpIpConnection connection,
IOService ioService)
Creates a WriteHandler for given Connection instance.
|
MemberSocketInterceptor |
getMemberSocketInterceptor()
Returns MemberSocketInterceptor for this Node if available,
otherwise returns null.
|
MemoryStats |
getMemoryStats()
Returns MemoryStats of for the JVM and current HazelcastInstance.
|
SecurityContext |
getSecurityContext()
Returns SecurityContext for this Node if available, otherwise returns null.
|
SocketChannelWrapperFactory |
getSocketChannelWrapperFactory()
Returns SocketChannelWrapperFactory instance to be used by this Node.
|
boolean |
isStartCompleted()
Returns true if the instance has started
|
void |
onClusterStateChange(ClusterState newState,
boolean persistentChange)
Called when cluster state is changed
|
void |
onThreadStart(Thread thread)
Called on thread start to inject/intercept extension specific logic,
like; registering thread in some service,
executing a special method before thread starts to do its own task.
|
void |
onThreadStop(Thread thread)
Called before a thread stops to clean/release injected by
onThreadStart(Thread) . |
void |
printNodeInfo()
Called to print node information during startup
|
boolean |
registerListener(Object listener)
Registers given register if it's a known type.
|
void |
shutdown()
Shutdowns NodeExtension.
|
boolean |
triggerForceStart()
Forces node to start by skipping hot-restart completely and removing all hot-restart data
even if node is still on validation phase or loading hot-restart data.
|
void |
validateJoinRequest()
Called before a new node is joining to cluster,
executed if node is the master node before join event.
|
void beforeStart()
void printNodeInfo()
void beforeJoin()
void afterStart()
boolean isStartCompleted()
SerializationService createSerializationService()
SecurityContext getSecurityContext()
<T> T createService(Class<T> type)
type
- type of serviceIllegalArgumentException
- if type is not knownMap<String,Object> createExtensionServices()
MemberSocketInterceptor getMemberSocketInterceptor()
SocketChannelWrapperFactory getSocketChannelWrapperFactory()
ReadHandler createReadHandler(TcpIpConnection connection, IOService ioService)
connection
- tcp-ip connectionioService
- IOServiceWriteHandler createWriteHandler(TcpIpConnection connection, IOService ioService)
connection
- tcp-ip connectionioService
- IOServiceMessageTaskFactory createMessageTaskFactory()
void onThreadStart(Thread thread)
thread
- thread startingvoid onThreadStop(Thread thread)
onThreadStart(Thread)
.thread
- thread stoppingMemoryStats getMemoryStats()
void beforeShutdown()
void shutdown()
void validateJoinRequest()
ClusterJoinManager
calls this method,
when handleJoinRequest method is called. By this way, we can check the logic we want
by implementing this method. Implementation should throw required exception, with a valid
message which explains rejection reason.void onClusterStateChange(ClusterState newState, boolean persistentChange)
newState
- new statepersistentChange
- status of the change. A cluster state change may be non-persistent if it has been done temporarily
during system operations such cluster start etc.boolean registerListener(Object listener)
listener
- listener instanceboolean triggerForceStart()
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.