public class ClientConnectionManagerImpl extends Object implements 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) |
protected ClientConnection |
createSocketConnection(Address address) |
void |
destroyConnection(Connection connection)
Destroys the connection
Clears related resources of given connection.
|
ClientConnection |
getConnection(Address target) |
ClientConnection |
getOrConnect(Address target,
Authenticator authenticator) |
ClientConnection |
getOrTriggerConnect(Address target,
Authenticator authenticator) |
void |
handlePacket(Packet packet)
Handles incoming network package
|
protected void |
initializeSelectors(HazelcastClientInstanceImpl client) |
boolean |
isAlive()
Check if client connection manager is alive.
|
void |
shutdown()
Shutdown clientConnectionManager
|
protected void |
shutdownSelectors() |
void |
start()
Start clientConnectionManager
|
protected void |
startSelectors() |
protected final AtomicInteger connectionIdGen
protected volatile boolean alive
public ClientConnectionManagerImpl(HazelcastClientInstanceImpl client, AddressTranslator addressTranslator)
protected void initializeSelectors(HazelcastClientInstanceImpl client)
public boolean isAlive()
ClientConnectionManagerisAlive in interface ClientConnectionManagerpublic void start()
ClientConnectionManagerstart in interface ClientConnectionManagerprotected void startSelectors()
public void shutdown()
ClientConnectionManagershutdown in interface ClientConnectionManagerprotected void shutdownSelectors()
public ClientConnection getConnection(Address target)
getConnection in interface ClientConnectionManagertarget - to be connectedpublic ClientConnection getOrConnect(Address target, Authenticator authenticator) throws IOException
getOrConnect in interface ClientConnectionManagertarget - to be connectedauthenticator - Authenticator implementation to send appropriate Authentication Request after connectionIOException - if connection is not establishedpublic ClientConnection getOrTriggerConnect(Address target, Authenticator authenticator) throws IOException
getOrTriggerConnect in interface ClientConnectionManagertarget - to be connectedauthenticator - Authenticator implementation to send appropriate Authentication Request after connectionIOException - if connection is not available at the time of callprotected ClientConnection createSocketConnection(Address address) throws IOException
IOExceptionpublic void destroyConnection(Connection connection)
ClientConnectionManagerdestroyConnection in interface ClientConnectionManagerconnection - to be closedpublic void handlePacket(Packet packet)
ClientConnectionManagerhandlePacket in interface ClientConnectionManagerpacket - to be processedpublic void addConnectionListener(ConnectionListener connectionListener)
addConnectionListener in interface ClientConnectionManagerpublic void addConnectionHeartbeatListener(ConnectionHeartbeatListener connectionHeartbeatListener)
addConnectionHeartbeatListener in interface ClientConnectionManagerCopyright © 2015 Hazelcast, Inc.. All Rights Reserved.