@PrivateApi public class DefaultNodeExtension extends Object implements NodeExtension
| Modifier and Type | Field and Description |
|---|---|
protected List<ClusterVersionListener> |
clusterVersionListeners |
protected ILogger |
logger |
protected Node |
node |
protected ILogger |
systemLogger |
| Constructor and Description |
|---|
DefaultNodeExtension(Node node) |
| 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
|
DynamicConfigListener |
createDynamicConfigListener()
Creates a listener for changes in dynamic data structure configurations
|
Map<String,Object> |
createExtensionServices()
Creates additional extension services, which will be registered by
service manager during start-up.
|
ChannelInboundHandler |
createInboundHandler(TcpIpConnection connection,
IOService ioService)
Creates a ChannelInboundHandler for given Connection instance.
|
String |
createMemberUuid(Address address)
Creates a UUID for local member
|
ByteArrayProcessor |
createMulticastInputProcessor(IOService ioService)
Returns a byte array processor for incoming data on the Multicast joiner
|
ByteArrayProcessor |
createMulticastOutputProcessor(IOService ioService)
Returns a byte array processor for outgoing data on the Multicast joiner
|
ChannelOutboundHandler |
createOutboundHandler(TcpIpConnection connection,
IOService ioService)
Creates a ChannelOutboundHandler for given Connection instance.
|
InternalSerializationService |
createSerializationService()
Creates a SerializationService instance to be used by this Node.
|
<T> T |
createService(Class<T> clazz)
Creates a service which is an implementation of given type parameter.
|
TimedMemberStateFactory |
createTimedMemberStateFactory(HazelcastInstanceImpl instance)
Creates a TimedMemberStateFactory for a given Hazelcast instance
|
ChannelFactory |
getChannelFactory()
Returns ChannelFactory instance to be used by this Node.
|
HotRestartService |
getHotRestartService()
Returns the public hot restart service
|
InternalHotRestartService |
getInternalHotRestartService()
Returns the internal hot restart service
|
ManagementCenterConnectionFactory |
getManagementCenterConnectionFactory() |
MemberSocketInterceptor |
getMemberSocketInterceptor()
Returns MemberSocketInterceptor for this Node if available,
otherwise returns null.
|
MemoryStats |
getMemoryStats()
Returns MemoryStats of for the JVM and current HazelcastInstance.
|
protected PartitioningStrategy |
getPartitioningStrategy(ClassLoader configClassLoader) |
SecurityContext |
getSecurityContext()
Returns SecurityContext for this Node if available, otherwise returns null.
|
SecurityService |
getSecurityService() |
boolean |
isNodeVersionCompatibleWith(Version clusterVersion)
Check if this node's codebase version is compatible with given cluster version.
|
boolean |
isStartCompleted()
Returns true if the instance has started
|
void |
onClusterStateChange(ClusterState newState,
boolean isTransient)
Called when cluster state is changed
|
void |
onClusterVersionChange(Version newVersion)
Called after cluster version is changed.
|
void |
onMemberListChange()
Called synchronously when member list changes
|
void |
onPartitionStateChange()
Called synchronously when partition state (partition assignments, version etc) changes
|
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
NodeExtension.onThreadStart(Thread). |
void |
printNodeInfo()
Called to print node information during startup
|
boolean |
registerListener(Object listener)
Registers given listener if it's a known type.
|
void |
registerPlugins(Diagnostics diagnostics)
Register the node extension specific diagnostics plugins on the provided
diagnostics. |
void |
shutdown()
Shutdowns NodeExtension.
|
void |
validateJoinRequest(JoinMessage joinMessage)
Executed on the master node before allowing a new member to join from
ClusterJoinManager.handleJoinRequest(JoinRequest, Connection). |
protected final Node node
protected final ILogger logger
protected final ILogger systemLogger
protected final List<ClusterVersionListener> clusterVersionListeners
public DefaultNodeExtension(Node node)
public void beforeStart()
NodeExtensionbeforeStart in interface NodeExtensionpublic void printNodeInfo()
NodeExtensionprintNodeInfo in interface NodeExtensionpublic void beforeJoin()
NodeExtensionbeforeJoin in interface NodeExtensionpublic void afterStart()
NodeExtensionafterStart in interface NodeExtensionpublic boolean isStartCompleted()
NodeExtensionisStartCompleted in interface NodeExtensionpublic SecurityContext getSecurityContext()
NodeExtensiongetSecurityContext in interface NodeExtensionpublic InternalSerializationService createSerializationService()
NodeExtensioncreateSerializationService in interface NodeExtensionpublic SecurityService getSecurityService()
getSecurityService in interface NodeExtensionprotected PartitioningStrategy getPartitioningStrategy(ClassLoader configClassLoader) throws Exception
Exceptionpublic <T> T createService(Class<T> clazz)
NodeExtensioncreateService in interface NodeExtensionclazz - type of servicepublic Map<String,Object> createExtensionServices()
NodeExtensioncreateExtensionServices in interface NodeExtensionpublic MemberSocketInterceptor getMemberSocketInterceptor()
NodeExtensiongetMemberSocketInterceptor in interface NodeExtensionpublic ChannelFactory getChannelFactory()
NodeExtensiongetChannelFactory in interface NodeExtensionpublic ChannelInboundHandler createInboundHandler(TcpIpConnection connection, IOService ioService)
NodeExtensioncreateInboundHandler in interface NodeExtensionconnection - tcp-ip connectionioService - IOServicepublic ChannelOutboundHandler createOutboundHandler(TcpIpConnection connection, IOService ioService)
NodeExtensioncreateOutboundHandler in interface NodeExtensionconnection - tcp-ip connectionioService - IOServicepublic void onThreadStart(Thread thread)
NodeExtensiononThreadStart in interface NodeExtensionthread - thread startingpublic void onThreadStop(Thread thread)
NodeExtensionNodeExtension.onThreadStart(Thread).onThreadStop in interface NodeExtensionthread - thread stoppingpublic MemoryStats getMemoryStats()
NodeExtensiongetMemoryStats in interface NodeExtensionpublic void beforeShutdown()
NodeExtensionbeforeShutdown in interface NodeExtensionpublic void shutdown()
NodeExtensionshutdown in interface NodeExtensionpublic void validateJoinRequest(JoinMessage joinMessage)
NodeExtensionClusterJoinManager.handleJoinRequest(JoinRequest, Connection).
Implementation should check if the JoinMessage should be allowed to proceed, otherwise throw an exception
with a message explaining rejection reason.validateJoinRequest in interface NodeExtensionpublic void onClusterStateChange(ClusterState newState, boolean isTransient)
NodeExtensiononClusterStateChange in interface NodeExtensionnewState - new stateisTransient - status of the change. A cluster state change may be transient if it has been done temporarily
during system operations such cluster start etc.public void onPartitionStateChange()
NodeExtensiononPartitionStateChange in interface NodeExtensionpublic void onMemberListChange()
NodeExtensiononMemberListChange in interface NodeExtensionpublic void onClusterVersionChange(Version newVersion)
NodeExtensiononClusterVersionChange in interface NodeExtensionnewVersion - the new version at which the cluster operates.public boolean isNodeVersionCompatibleWith(Version clusterVersion)
NodeExtensionisNodeVersionCompatibleWith in interface NodeExtensionclusterVersion - the cluster version to check againsttrue if compatible, otherwise false.public boolean registerListener(Object listener)
NodeExtensionregisterListener in interface NodeExtensionlistener - listener instancepublic HotRestartService getHotRestartService()
NodeExtensiongetHotRestartService in interface NodeExtensionpublic InternalHotRestartService getInternalHotRestartService()
NodeExtensiongetInternalHotRestartService in interface NodeExtensionpublic String createMemberUuid(Address address)
NodeExtensioncreateMemberUuid in interface NodeExtensionaddress - address of local memberpublic ByteArrayProcessor createMulticastInputProcessor(IOService ioService)
NodeExtensioncreateMulticastInputProcessor in interface NodeExtensionpublic ByteArrayProcessor createMulticastOutputProcessor(IOService ioService)
NodeExtensioncreateMulticastOutputProcessor in interface NodeExtensionpublic TimedMemberStateFactory createTimedMemberStateFactory(HazelcastInstanceImpl instance)
NodeExtensioncreateTimedMemberStateFactory in interface NodeExtensioninstance - The instance to associate with the timed member state factoryTimedMemberStateFactorypublic DynamicConfigListener createDynamicConfigListener()
NodeExtensioncreateDynamicConfigListener in interface NodeExtensionpublic void registerPlugins(Diagnostics diagnostics)
NodeExtensiondiagnostics.registerPlugins in interface NodeExtensiondiagnostics - the diagnostics on which plugins should be registeredpublic ManagementCenterConnectionFactory getManagementCenterConnectionFactory()
getManagementCenterConnectionFactory in interface NodeExtensionCopyright © 2018 Hazelcast, Inc.. All Rights Reserved.