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 ClientEnginepublic void accept(ClientMessage clientMessage)
accept in interface Consumer<ClientMessage>public IPartitionService getPartitionService()
getPartitionService in interface ClientEnginepublic ClusterService getClusterService()
getClusterService in interface ClientEnginepublic EventService getEventService()
getEventService in interface ClientEnginepublic ProxyService getProxyService()
getProxyService in interface ClientEnginepublic Address getThisAddress()
getThisAddress in interface ClientEngineNode.getThisAddress()public ILogger getLogger(Class clazz)
getLogger in interface ClientEnginepublic ClientEndpointManager getEndpointManager()
getEndpointManager in interface ClientEnginepublic ClientExceptions getClientExceptions()
getClientExceptions in interface ClientEnginepublic SecurityContext getSecurityContext()
getSecurityContext in interface ClientEnginepublic boolean bind(ClientEndpoint endpoint)
ClientEngineClientEngine.applySelector(com.hazelcast.client.impl.ClientSelector)bind in interface ClientEngineendpoint - to be registered to client enginepublic void applySelector(ClientSelector newSelector)
ClientEngineapplySelector in interface ClientEnginenewSelector - to select a client or group of clients to act uponpublic void dispatchEvent(ClientEvent event, ClientListener listener)
EventPublishingServicedispatchEvent in interface EventPublishingService<ClientEvent,ClientListener>event - the published eventlistener - the listener registered for this eventpublic void memberAdded(MembershipServiceEvent event)
MembershipAwareServicememberAdded in interface MembershipAwareServiceevent - the event for a new member added to the clusterpublic void memberRemoved(MembershipServiceEvent event)
MembershipAwareServicememberRemoved in interface MembershipAwareServiceevent - the event for an existing member leaving the clusterpublic void memberAttributeChanged(MemberAttributeServiceEvent event)
MembershipAwareServicememberAttributeChanged in interface MembershipAwareServiceevent - the event for a member attribute being changedpublic Collection<Client> getClients()
getClients in interface ClientEnginepublic void init(NodeEngine nodeEngine, Properties properties)
ManagedServiceinit in interface ManagedServicenodeEngine - the NodeEngine that this service belongs toproperties - the Properties (can be used to pass settings to the service)public void reset()
ManagedServiceTODO: what is the purpose of reset
reset in interface ManagedServicepublic void shutdown(boolean terminate)
ManagedServiceTODO: what is the purpose of the terminate variable
shutdown in interface ManagedServiceterminate - true to shut down this servicepublic TransactionManagerService getTransactionManagerService()
getTransactionManagerService in interface ClientEnginepublic ClientPartitionListenerService getPartitionListenerService()
getPartitionListenerService in interface ClientEnginepublic boolean isClientAllowed(Client client)
isClientAllowed in interface ClientEngineclient - to check if allowed through current ClientSelectorpublic Map<ClientType,Integer> getConnectedClientStats()
ClientEnginegetConnectedClientStats in interface ClientEngineMap<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 ClientEnginepublic Address memberAddressOf(Address clientAddress)
ClientEngineTargetNotMemberException when no member with the
provided client address can be located.memberAddressOf in interface ClientEngineclientAddress - the client address of the memberpublic Address clientAddressOf(Address memberAddress)
ClientEngineClientEngine.memberAddressOf(Address).clientAddressOf in interface ClientEnginememberAddress - the member address of the memberpublic void onClientAcquiredResource(UUID uuid)
ClientEngineonClientAcquiredResource in interface ClientEngineuuid - client uuidpublic void addBackupListener(UUID clientUuid, Consumer<Long> backupListener)
addBackupListener in interface ClientEnginepublic void dispatchBackupEvent(UUID clientUUID, long clientCorrelationId)
dispatchBackupEvent in interface ClientEnginepublic boolean deregisterBackupListener(UUID clientUUID)
deregisterBackupListener in interface ClientEngineCopyright © 2019 Hazelcast, Inc.. All rights reserved.