com.hazelcast.client.impl
Class ClientEngineImpl

java.lang.Object
  extended by com.hazelcast.client.impl.ClientEngineImpl
All Implemented Interfaces:
ClientEngine, CoreService, EventPublishingService<ClientEndpointImpl,ClientListener>, ManagedService, MembershipAwareService, PostJoinAwareService

public class ClientEngineImpl
extends Object
implements ClientEngine, CoreService, PostJoinAwareService, ManagedService, MembershipAwareService, EventPublishingService<ClientEndpointImpl,ClientListener>

Class that requests, listeners from client handled in node side.


Field Summary
static String SERVICE_NAME
          Service Name of clientEngine to be used in requests
 
Constructor Summary
ClientEngineImpl(Node node)
           
 
Method Summary
 void addOwnershipMapping(String clientUuid, String ownerUuid)
           
 void bind(ClientEndpoint endpoint)
           
 void dispatchEvent(ClientEndpointImpl event, ClientListener listener)
           
 int getClientEndpointCount()
           
 Collection<Client> getClients()
           
 ClusterService getClusterService()
           
 Config getConfig()
           
 Map<ClientType,Integer> getConnectedClientStats()
          Returns Map which contains number of connected clients to the cluster.
 ConnectionListener getConnectionListener()
           
 ClientEndpointManager getEndpointManager()
           
 EventService getEventService()
           
 MemberImpl getLocalMember()
           
 ILogger getLogger(Class clazz)
           
 Address getMasterAddress()
           
 InternalPartitionService getPartitionService()
           
 Operation getPostJoinOperation()
          Post join operations must be lock free, meaning no locks at all: no partition locks, no key-based locks, no service level locks, no database interaction!
 ProxyService getProxyService()
           
 SecurityContext getSecurityContext()
           
 Address getThisAddress()
           
 TransactionManagerService getTransactionManagerService()
           
 void handleClientMessage(ClientMessage clientMessage, Connection connection)
           
 void handlePacket(Packet packet)
           
 void init(NodeEngine nodeEngine, Properties properties)
          Initializes this ManagedService
 void memberAdded(MembershipServiceEvent event)
          Invoked when a new member is added to the cluster.
 void memberAttributeChanged(MemberAttributeServiceEvent event)
          Invoked when a member attribute is changed.
 void memberRemoved(MembershipServiceEvent event)
          Invoked when an existing member leaves the cluster.
 void removeOwnershipMapping(String clientUuid)
           
 void reset()
          reset this ManagedService back to initial state.
 void sendResponse(ClientEndpoint endpoint, Object key, Object response, int callId, boolean isError, boolean isEvent)
           
 void shutdown(boolean terminate)
          Shuts down this ManagedService.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVICE_NAME

public static final String SERVICE_NAME
Service Name of clientEngine to be used in requests

See Also:
Constant Field Values
Constructor Detail

ClientEngineImpl

public ClientEngineImpl(Node node)
Method Detail

getConnectionListener

public ConnectionListener getConnectionListener()

getClientEndpointCount

public int getClientEndpointCount()
Specified by:
getClientEndpointCount in interface ClientEngine

handlePacket

public void handlePacket(Packet packet)

handleClientMessage

public void handleClientMessage(ClientMessage clientMessage,
                                Connection connection)

getPartitionService

public InternalPartitionService getPartitionService()
Specified by:
getPartitionService in interface ClientEngine

getClusterService

public ClusterService getClusterService()
Specified by:
getClusterService in interface ClientEngine

getEventService

public EventService getEventService()
Specified by:
getEventService in interface ClientEngine

getProxyService

public ProxyService getProxyService()
Specified by:
getProxyService in interface ClientEngine

sendResponse

public void sendResponse(ClientEndpoint endpoint,
                         Object key,
                         Object response,
                         int callId,
                         boolean isError,
                         boolean isEvent)

getMasterAddress

public Address getMasterAddress()
Specified by:
getMasterAddress in interface ClientEngine

getThisAddress

public Address getThisAddress()
Specified by:
getThisAddress in interface ClientEngine

getLocalMember

public MemberImpl getLocalMember()
Specified by:
getLocalMember in interface ClientEngine

getConfig

public Config getConfig()
Specified by:
getConfig in interface ClientEngine

getLogger

public ILogger getLogger(Class clazz)
Specified by:
getLogger in interface ClientEngine

getEndpointManager

public ClientEndpointManager getEndpointManager()

getSecurityContext

public SecurityContext getSecurityContext()
Specified by:
getSecurityContext in interface ClientEngine

bind

public void bind(ClientEndpoint endpoint)

dispatchEvent

public void dispatchEvent(ClientEndpointImpl event,
                          ClientListener listener)
Specified by:
dispatchEvent in interface EventPublishingService<ClientEndpointImpl,ClientListener>

memberAdded

public void memberAdded(MembershipServiceEvent event)
Description copied from interface: MembershipAwareService
Invoked when a new member is added to the cluster.

Specified by:
memberAdded in interface MembershipAwareService
Parameters:
event - the event for a new member added to the cluster

memberRemoved

public void memberRemoved(MembershipServiceEvent event)
Description copied from interface: MembershipAwareService
Invoked when an existing member leaves the cluster.

Specified by:
memberRemoved in interface MembershipAwareService
Parameters:
event - the event for an existing member leaving the cluster

memberAttributeChanged

public void memberAttributeChanged(MemberAttributeServiceEvent event)
Description copied from interface: MembershipAwareService
Invoked when a member attribute is changed.

Specified by:
memberAttributeChanged in interface MembershipAwareService
Parameters:
event - the event for a member attribute being changed

getClients

public Collection<Client> getClients()

init

public void init(NodeEngine nodeEngine,
                 Properties properties)
Description copied from interface: ManagedService
Initializes this ManagedService

Specified by:
init in interface ManagedService
Parameters:
nodeEngine - the NodeEngine that this ManagedService belongs to.
properties - the Properties. Can be used to pass settings to the service.

reset

public void reset()
Description copied from interface: ManagedService
reset this ManagedService back to initial state. todo: what is the purpose of reset

Specified by:
reset in interface ManagedService

shutdown

public void shutdown(boolean terminate)
Description copied from interface: ManagedService
Shuts down this ManagedService. todo: what is the purpose of the terminate variable.

Specified by:
shutdown in interface ManagedService
Parameters:
terminate - true to shut down the ManagedService

addOwnershipMapping

public void addOwnershipMapping(String clientUuid,
                                String ownerUuid)

removeOwnershipMapping

public void removeOwnershipMapping(String clientUuid)

getTransactionManagerService

public TransactionManagerService getTransactionManagerService()

getPostJoinOperation

public Operation getPostJoinOperation()
Description copied from interface: PostJoinAwareService
Post join operations must be lock free, meaning no locks at all: no partition locks, no key-based locks, no service level locks, no database interaction!

Post join operations should return response, at least a null response.

Specified by:
getPostJoinOperation in interface PostJoinAwareService
Returns:
a response from the post join operation. Can be null.

getConnectedClientStats

public Map<ClientType,Integer> getConnectedClientStats()
Description copied from interface: ClientEngine
Returns Map which contains number of connected clients to the cluster. The returned map can be used to get information about connected clients to the cluster.

Specified by:
getConnectedClientStats in interface ClientEngine
Returns:
Map .


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.