public interface NodeEngine
ManagedService
.
So if you are writing a custom SPI service, such as a stack-service, this service should probably implement
the ManagedService
so you can get access to the services within the system.
Modifier and Type | Method and Description |
---|---|
ClusterService |
getClusterService()
Gets the ClusterService.
|
Config |
getConfig()
Returns the Config that was used to create the HazelcastInstance.
|
ClassLoader |
getConfigClassLoader()
Returns the Config ClassLoader.
|
EventService |
getEventService()
Gets the EventService.
|
ExecutionService |
getExecutionService()
Gets the ExecutionService.
|
HazelcastInstance |
getHazelcastInstance()
Returns the HazelcastInstance that this
NodeEngine belongs to. |
Member |
getLocalMember()
Returns the local member.
|
ILogger |
getLogger(Class clazz)
Gets the logger for a given class.
|
ILogger |
getLogger(String name)
Gets the logger for a given name.
|
Address |
getMasterAddress()
Gets the address of the master member.
|
OperationService |
getOperationService()
Gets the OperationService.
|
IPartitionService |
getPartitionService()
Gets the IPartitionService.
|
HazelcastProperties |
getProperties()
Returns the HazelcastProperties.
|
ProxyService |
getProxyService()
Gets the ProxyService.
|
QuorumService |
getQuorumService()
Gets the QuorumService.
|
SerializationService |
getSerializationService()
Gets the SerializationService.
|
<T> T |
getService(String serviceName)
Gets the service with the given name.
|
<S> Collection<S> |
getServices(Class<S> serviceClass)
Returns a list of services matching provides service class/interface.
|
<T extends SharedService> |
getSharedService(String serviceName)
Deprecated.
since 3.7, please use
getService(String) instead |
SplitBrainMergePolicyProvider |
getSplitBrainMergePolicyProvider()
Returns the
SplitBrainMergePolicyProvider for this instance. |
Address |
getThisAddress()
Get the address of this member.
|
TransactionManagerService |
getTransactionManagerService()
Gets the TransactionManagerService.
|
MemberVersion |
getVersion()
Returns the codebase version of the node.
|
WanReplicationService |
getWanReplicationService()
Gets the WanReplicationService.
|
boolean |
isActive()
Deprecated.
|
boolean |
isRunning()
Indicates that node is not shutting down or it has not already shut down
|
Data |
toData(Object object)
Serializes an object to a
Data . |
<T> T |
toObject(Object object)
Deserializes an object.
|
<T> T |
toObject(Object object,
Class klazz)
Deserializes an object.
|
OperationService getOperationService()
ExecutionService getExecutionService()
ClusterService getClusterService()
IPartitionService getPartitionService()
EventService getEventService()
SerializationService getSerializationService()
ProxyService getProxyService()
WanReplicationService getWanReplicationService()
QuorumService getQuorumService()
TransactionManagerService getTransactionManagerService()
Address getMasterAddress()
This value can be null if no master is elected yet.
The value can change over time.
Address getThisAddress()
The returned value will never change and will never be null
.
Member getLocalMember()
The returned value will never be null but it may change when local lite member is promoted to a data member or when this member merges to a new cluster after split-brain detected. Returned value should not be cached but instead this method should be called each time when local member is needed.
Config getConfig()
The returned value will never change and will never be null
.
ClassLoader getConfigClassLoader()
TODO: add more documentation what the purpose is of the config classloader
HazelcastProperties getProperties()
The returned value will never change and will never be null
.
ILogger getLogger(String name)
It is best to get an ILogger through this method instead of calling Logger.getLogger(String)
.
name
- the name of the loggerNullPointerException
- if name is null
getLogger(String)
ILogger getLogger(Class clazz)
It is best to get an ILogger through this method instead of calling Logger.getLogger(Class)
.
clazz
- the class of the loggerNullPointerException
- if clazz is null
getLogger(Class)
Data toData(Object object)
Data
.
This method can safely be called with a Data
instance. In that case, that instance is returned.
If this method is called with null
, null
is returned.
object
- the object to serializeHazelcastSerializationException
- when serialization fails<T> T toObject(Object object)
This method can safely be called on an object that is already deserialized. In that case, that instance is returned.
If this method is called with null
, null
is returned.
object
- the object to deserializeHazelcastSerializationException
- when deserialization fails<T> T toObject(Object object, Class klazz)
This method can safely be called on an object that is already deserialized. In that case, that instance is returned.
If this method is called with null
, null
is returned.
object
- the object to deserializeklazz
- The class to instantiate when deserializing the objectHazelcastSerializationException
- when deserialization fails@Deprecated boolean isActive()
NodeEngine
belongs to is still active.
A HazelcastInstance is not active when it is shutting down or already shut down.
Also see isRunning()
.
true
if active, false
otherwiseboolean isRunning()
true
if node is not shutting down or it has not already shut down, false
otherwiseHazelcastInstance getHazelcastInstance()
NodeEngine
belongs to.<T> T getService(String serviceName)
T
- the type of the serviceserviceName
- the name of the servicenull
will never be returned)<T extends SharedService> T getSharedService(String serviceName)
getService(String)
insteadSharedService
for the given serviceName.T
- the type of the serviceserviceName
- the name of the shared service to getNullPointerException
- if the serviceName is null
MemberVersion getVersion()
Version.of(3,8,0)
. A node's codebase version may be different than cluster version.Cluster.getClusterVersion()
SplitBrainMergePolicyProvider getSplitBrainMergePolicyProvider()
SplitBrainMergePolicyProvider
for this instance.SplitBrainMergePolicyProvider
<S> Collection<S> getServices(Class<S> serviceClass)
Note: CoreServices will be placed at the beginning of the list.
Copyright © 2019 Hazelcast, Inc.. All Rights Reserved.