public class DefaultNodeExtension extends Object implements NodeExtension
Modifier and Type | Field and Description |
---|---|
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 a new node is joining to cluster,
executed if node is the master node before join event.
|
void |
beforeStart()
Called before node is started
|
MessageTaskFactory |
createMessageTaskFactory(Node node)
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> clazz)
Creates a service which is an implementation of given type parameter.
|
WriteHandler |
createWriteHandler(TcpIpConnection connection,
IOService ioService)
Creates a WriteHandler for given Connection instance.
|
void |
destroy()
Destroys NodeExtension.
|
MemberSocketInterceptor |
getMemberSocketInterceptor()
Returns MemberSocketInterceptor for this Node if available,
otherwise returns null.
|
MemoryStats |
getMemoryStats()
Returns MemoryStats of for the JVM and current HazelcastInstance.
|
Storage<DataRef> |
getNativeDataStorage() |
protected PartitioningStrategy |
getPartitioningStrategy(ClassLoader configClassLoader) |
SecurityContext |
getSecurityContext()
Returns SecurityContext for this Node if available, otherwise returns null.
|
SocketChannelWrapperFactory |
getSocketChannelWrapperFactory()
Returns SocketChannelWrapperFactory instance to be used by this Node.
|
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
|
protected final Node node
protected final ILogger logger
protected final ILogger systemLogger
public DefaultNodeExtension(Node node)
public void beforeStart()
NodeExtension
beforeStart
in interface NodeExtension
public void printNodeInfo()
NodeExtension
printNodeInfo
in interface NodeExtension
public void afterStart()
NodeExtension
afterStart
in interface NodeExtension
public SecurityContext getSecurityContext()
NodeExtension
getSecurityContext
in interface NodeExtension
public Storage<DataRef> getNativeDataStorage()
getNativeDataStorage
in interface NodeExtension
public SerializationService createSerializationService()
NodeExtension
createSerializationService
in interface NodeExtension
protected PartitioningStrategy getPartitioningStrategy(ClassLoader configClassLoader) throws Exception
Exception
public <T> T createService(Class<T> clazz)
NodeExtension
createService
in interface NodeExtension
clazz
- type of servicepublic MemberSocketInterceptor getMemberSocketInterceptor()
NodeExtension
getMemberSocketInterceptor
in interface NodeExtension
public SocketChannelWrapperFactory getSocketChannelWrapperFactory()
NodeExtension
getSocketChannelWrapperFactory
in interface NodeExtension
public ReadHandler createReadHandler(TcpIpConnection connection, IOService ioService)
NodeExtension
createReadHandler
in interface NodeExtension
connection
- tcp-ip connectionioService
- IOServicepublic WriteHandler createWriteHandler(TcpIpConnection connection, IOService ioService)
NodeExtension
createWriteHandler
in interface NodeExtension
connection
- tcp-ip connectionioService
- IOServicepublic MessageTaskFactory createMessageTaskFactory(Node node)
NodeExtension
createMessageTaskFactory
in interface NodeExtension
node
- nodepublic void onThreadStart(Thread thread)
NodeExtension
onThreadStart
in interface NodeExtension
thread
- thread startingpublic void onThreadStop(Thread thread)
NodeExtension
NodeExtension.onThreadStart(Thread)
.onThreadStop
in interface NodeExtension
thread
- thread stoppingpublic MemoryStats getMemoryStats()
NodeExtension
getMemoryStats
in interface NodeExtension
public void destroy()
NodeExtension
destroy
in interface NodeExtension
public void beforeJoin()
NodeExtension
ClusterServiceImpl
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.beforeJoin
in interface NodeExtension
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.