public class ClientConnectionManagerImpl extends Object implements ClientConnectionManager
ClientConnectionManager.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
alive |
protected AtomicInteger |
connectionIdGen |
| Constructor and Description |
|---|
ClientConnectionManagerImpl(HazelcastClientInstanceImpl client,
AddressTranslator addressTranslator) |
| Modifier and Type | Method and Description |
|---|---|
void |
addConnectionHeartbeatListener(ConnectionHeartbeatListener connectionHeartbeatListener) |
void |
addConnectionListener(ConnectionListener connectionListener)
Registers a ConnectionListener.
|
protected ClientConnection |
createSocketConnection(Address address) |
Collection<ClientConnection> |
getActiveConnections() |
ClientConnection |
getConnection(Address target) |
Connection |
getOrConnect(Address address,
boolean asOwner) |
Connection |
getOrTriggerConnect(Address target,
boolean asOwner) |
void |
handleClientMessage(ClientMessage message,
Connection connection)
Handles incoming network package
|
protected void |
initIOThreads(HazelcastClientInstanceImpl client) |
boolean |
isAlive()
Check if client connection manager is alive.
|
void |
shutdown()
Shutdown clientConnectionManager
|
protected void |
shutdownIOThreads() |
void |
start()
Start clientConnectionManager
|
protected void |
startIOThreads() |
protected final AtomicInteger connectionIdGen
protected volatile boolean alive
public ClientConnectionManagerImpl(HazelcastClientInstanceImpl client, AddressTranslator addressTranslator)
protected void initIOThreads(HazelcastClientInstanceImpl client)
public Collection<ClientConnection> getActiveConnections()
getActiveConnections in interface ClientConnectionManagerpublic boolean isAlive()
ClientConnectionManagerisAlive in interface ClientConnectionManagerpublic void start()
ClientConnectionManagerstart in interface ClientConnectionManagerprotected void startIOThreads()
public void shutdown()
ClientConnectionManagershutdown in interface ClientConnectionManagerprotected void shutdownIOThreads()
public ClientConnection getConnection(Address target)
getConnection in interface ClientConnectionManagertarget - to be connectedpublic Connection getOrConnect(Address address, boolean asOwner) throws IOException
getOrConnect in interface ClientConnectionManageraddress - to be connectedasOwner - true if connection should be authenticated as owner, false otherwiseIOException - if connection is not establishedpublic Connection getOrTriggerConnect(Address target, boolean asOwner) throws IOException
getOrTriggerConnect in interface ClientConnectionManagertarget - to be connectedasOwner - true if connection should be authenticated as owner, false otherwiseIOException - if connection is not able to triggeredprotected ClientConnection createSocketConnection(Address address) throws IOException
IOExceptionpublic void handleClientMessage(ClientMessage message, Connection connection)
ClientConnectionManagerhandleClientMessage in interface ClientConnectionManagermessage - to be processedconnection - that client message come frompublic void addConnectionListener(ConnectionListener connectionListener)
ConnectionListenableaddConnectionListener in interface ConnectionListenableconnectionListener - the ConnectionListener to add.public void addConnectionHeartbeatListener(ConnectionHeartbeatListener connectionHeartbeatListener)
addConnectionHeartbeatListener in interface ClientConnectionManagerCopyright © 2017 Hazelcast, Inc.. All Rights Reserved.