public class ClientEngineImpl extends Object implements ClientEngine, CoreService, ManagedService, MembershipAwareService, EventPublishingService<ClientEvent,ClientListener>
Modifier and Type | Field and Description |
---|---|
static String |
SERVICE_NAME
Service name to be used in requests.
|
Constructor and Description |
---|
ClientEngineImpl(Node node) |
Modifier and Type | Method and Description |
---|---|
void |
accept(ClientMessage clientMessage) |
void |
addBackupListener(UUID clientUuid,
Consumer<Long> backupListener) |
void |
applySelector(ClientSelector newSelector)
Only Clients that can pass through filter are allowed to connect to cluster.
|
boolean |
bind(ClientEndpoint endpoint)
Registers client endpoint to endpointManager.
|
Address |
clientAddressOf(Address memberAddress)
Locates the client address of the given member address.
|
boolean |
deregisterBackupListener(UUID clientUUID) |
void |
dispatchBackupEvent(UUID clientUUID,
long clientCorrelationId) |
void |
dispatchEvent(ClientEvent event,
ClientListener listener)
Notifies the service of a published event.
|
Map<UUID,Consumer<Long>> |
getBackupListeners() |
int |
getClientEndpointCount() |
ClientExceptions |
getClientExceptions() |
Collection<Client> |
getClients() |
Map<UUID,String> |
getClientStatistics()
The statistics is a String that is composed of key=value pairs separated by ',' .
|
ClusterService |
getClusterService() |
Map<ClientType,Integer> |
getConnectedClientStats()
Returns Map which contains number of connected clients to the cluster.
|
ClientEndpointManager |
getEndpointManager() |
EventService |
getEventService() |
ILogger |
getLogger(Class clazz) |
ClientPartitionListenerService |
getPartitionListenerService() |
IPartitionService |
getPartitionService() |
ProxyService |
getProxyService() |
SecurityContext |
getSecurityContext() |
Address |
getThisAddress() |
TransactionManagerService |
getTransactionManagerService() |
void |
init(NodeEngine nodeEngine,
Properties properties)
Initializes this service.
|
boolean |
isClientAllowed(Client client) |
void |
memberAdded(MembershipServiceEvent event)
Invoked when a new member is added to the cluster.
|
Address |
memberAddressOf(Address clientAddress)
Locates the cluster member that has the provided client address and returns its member address,
to be used for intra-cluster communication.
|
void |
memberAttributeChanged(MemberAttributeServiceEvent event)
Invoked when a member attribute is changed.
|
void |
memberRemoved(MembershipServiceEvent event)
Invoked when an existing member leaves the cluster.
|
void |
onClientAcquiredResource(UUID uuid)
Notify client engine that a client with given uuid required a resource (lock) on this member
|
void |
reset()
Resets this service back to its initial state.
|
void |
shutdown(boolean terminate)
Shuts down this service.
|
public static final String SERVICE_NAME
public ClientEngineImpl(Node node)
public int getClientEndpointCount()
getClientEndpointCount
in interface ClientEngine
public void accept(ClientMessage clientMessage)
accept
in interface Consumer<ClientMessage>
public IPartitionService getPartitionService()
getPartitionService
in interface ClientEngine
public ClusterService getClusterService()
getClusterService
in interface ClientEngine
public EventService getEventService()
getEventService
in interface ClientEngine
public ProxyService getProxyService()
getProxyService
in interface ClientEngine
public Address getThisAddress()
getThisAddress
in interface ClientEngine
Node.getThisAddress()
public ILogger getLogger(Class clazz)
getLogger
in interface ClientEngine
public ClientEndpointManager getEndpointManager()
getEndpointManager
in interface ClientEngine
public ClientExceptions getClientExceptions()
getClientExceptions
in interface ClientEngine
public SecurityContext getSecurityContext()
getSecurityContext
in interface ClientEngine
public boolean bind(ClientEndpoint endpoint)
ClientEngine
ClientEngine.applySelector(com.hazelcast.client.impl.ClientSelector)
bind
in interface ClientEngine
endpoint
- to be registered to client enginepublic void applySelector(ClientSelector newSelector)
ClientEngine
applySelector
in interface ClientEngine
newSelector
- to select a client or group of clients to act uponpublic void dispatchEvent(ClientEvent event, ClientListener listener)
EventPublishingService
dispatchEvent
in interface EventPublishingService<ClientEvent,ClientListener>
event
- the published eventlistener
- the listener registered for this eventpublic void memberAdded(MembershipServiceEvent event)
MembershipAwareService
memberAdded
in interface MembershipAwareService
event
- the event for a new member added to the clusterpublic void memberRemoved(MembershipServiceEvent event)
MembershipAwareService
memberRemoved
in interface MembershipAwareService
event
- the event for an existing member leaving the clusterpublic void memberAttributeChanged(MemberAttributeServiceEvent event)
MembershipAwareService
memberAttributeChanged
in interface MembershipAwareService
event
- the event for a member attribute being changedpublic Collection<Client> getClients()
getClients
in interface ClientEngine
public void init(NodeEngine nodeEngine, Properties properties)
ManagedService
init
in interface ManagedService
nodeEngine
- the NodeEngine that this service belongs toproperties
- the Properties (can be used to pass settings to the service)public void reset()
ManagedService
TODO: what is the purpose of reset
reset
in interface ManagedService
public void shutdown(boolean terminate)
ManagedService
TODO: what is the purpose of the terminate variable
shutdown
in interface ManagedService
terminate
- true
to shut down this servicepublic TransactionManagerService getTransactionManagerService()
getTransactionManagerService
in interface ClientEngine
public ClientPartitionListenerService getPartitionListenerService()
getPartitionListenerService
in interface ClientEngine
public boolean isClientAllowed(Client client)
isClientAllowed
in interface ClientEngine
client
- to check if allowed through current ClientSelectorpublic Map<ClientType,Integer> getConnectedClientStats()
ClientEngine
getConnectedClientStats
in interface ClientEngine
Map<ClientType, Integer>
.public Map<UUID,String> getClientStatistics()
ClientEngine
<example.fastmap>
and ICache Named
<StatTestCacheName>
and assuming that the Near Cache is configured):
clientType clusterConnectionTimestamp credentials.principal clientAddress clientName enterprise lastStatisticsCollectionTime nearcache.<example\.fastmap>.creationTime nearcache.<example\.fastmap>.evictions nearcache.<example\.fastmap>.expirations nearcache.<example\.fastmap>.hits nearcache.<example\.fastmap>.lastPersistenceDuration nearcache.<example\.fastmap>.lastPersistenceFailure nearcache.<example\.fastmap>.lastPersistenceKeyCount nearcache.<example\.fastmap>.lastPersistenceTime nearcache.<example\.fastmap>.lastPersistenceWrittenBytes nearcache.<example\.fastmap>.misses nearcache.<example\.fastmap>.ownedEntryCount nearcache.<example\.fastmap>.ownedEntryMemoryCost nearcache.hz/<StatTestCacheName>.creationTime nearcache.hz/<StatTestCacheName>.evictions nearcache.hz/<StatTestCacheName>.expirations nearcache.hz/<StatTestCacheName>.hits nearcache.hz/<StatTestCacheName>.lastPersistenceDuration nearcache.hz/<StatTestCacheName>.lastPersistenceFailure nearcache.hz/<StatTestCacheName>.lastPersistenceKeyCount nearcache.hz/<StatTestCacheName>.lastPersistenceTime nearcache.hz/<StatTestCacheName>.lastPersistenceWrittenBytes nearcache.hz/<StatTestCacheName>.misses nearcache.hz/<StatTestCacheName>.ownedEntryCount nearcache.hz/<StatTestCacheName>.ownedEntryMemoryCost os.committedVirtualMemorySize os.freePhysicalMemorySize os.freeSwapSpaceSize os.maxFileDescriptorCount os.openFileDescriptorCount os.processCpuTime os.systemLoadAverage os.totalPhysicalMemorySize os.totalSwapSpaceSize runtime.availableProcessors runtime.freeMemory runtime.maxMemory runtime.totalMemory runtime.uptime runtime.usedMemory userExecutor.queueSizeNot: Please observe that the name for the ICache appears to be the hazelcast instance name "hz" followed by "/" and followed by the cache name provided which is StatTestCacheName.
getClientStatistics
in interface ClientEngine
public Address memberAddressOf(Address clientAddress)
ClientEngine
TargetNotMemberException
when no member with the
provided client address can be located.memberAddressOf
in interface ClientEngine
clientAddress
- the client address of the memberpublic Address clientAddressOf(Address memberAddress)
ClientEngine
ClientEngine.memberAddressOf(Address)
.clientAddressOf
in interface ClientEngine
memberAddress
- the member address of the memberpublic void onClientAcquiredResource(UUID uuid)
ClientEngine
onClientAcquiredResource
in interface ClientEngine
uuid
- client uuidpublic void addBackupListener(UUID clientUuid, Consumer<Long> backupListener)
addBackupListener
in interface ClientEngine
public void dispatchBackupEvent(UUID clientUUID, long clientCorrelationId)
dispatchBackupEvent
in interface ClientEngine
public boolean deregisterBackupListener(UUID clientUUID)
deregisterBackupListener
in interface ClientEngine
Copyright © 2019 Hazelcast, Inc.. All rights reserved.