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) |
| Modifier and Type | Method and Description |
|---|---|
void |
addConnectionListener(ConnectionListener connectionListener)
Registers a ConnectionListener.
|
void |
beforeClusterSwitch(CandidateClusterContext context) |
protected ClientConnection |
createSocketConnection(Address remoteAddress) |
Connection |
getActiveConnection(Address target) |
Collection<ClientConnection> |
getActiveConnections() |
UUID |
getClientUuid() |
ClientConnectionStrategy |
getConnectionStrategy() |
Credentials |
getLastCredentials() |
NioNetworking |
getNetworking() |
Connection |
getOrConnect(Address address) |
Connection |
getOrTriggerConnect(Address target) |
protected NioNetworking |
initNetworking(HazelcastClientInstanceImpl client) |
boolean |
isAlive()
Check if client connection manager is alive.
|
void |
setCandidateClusterContext(CandidateClusterContext context) |
void |
shutdown() |
void |
start() |
protected void |
startNetworking() |
protected void |
stopNetworking() |
protected final AtomicInteger connectionIdGen
protected volatile boolean alive
public ClientConnectionManagerImpl(HazelcastClientInstanceImpl client)
public NioNetworking getNetworking()
protected NioNetworking initNetworking(HazelcastClientInstanceImpl client)
public ClientConnectionStrategy getConnectionStrategy()
public Collection<ClientConnection> getActiveConnections()
getActiveConnections in interface ClientConnectionManagerpublic boolean isAlive()
ClientConnectionManagerisAlive in interface ClientConnectionManagerpublic void start()
protected void startNetworking()
public void shutdown()
public UUID getClientUuid()
getClientUuid in interface ClientConnectionManagerprotected void stopNetworking()
public Connection getActiveConnection(Address target)
getActiveConnection in interface ClientConnectionManagertarget - to be connectedpublic Connection getOrConnect(Address address) throws IOException
getOrConnect in interface ClientConnectionManageraddress - to be connectedIOException - if connection is not establishedpublic Connection getOrTriggerConnect(Address target) throws IOException
getOrTriggerConnect in interface ClientConnectionManagertarget - to be connectedIOException - if connection is not able to triggeredprotected ClientConnection createSocketConnection(Address remoteAddress) throws IOException
IOExceptionpublic void addConnectionListener(ConnectionListener connectionListener)
ConnectionListenableIf the same listener is registered multiple times, it will be notified multiple times.
addConnectionListener in interface ConnectionListenableconnectionListener - the ConnectionListener to add.public Credentials getLastCredentials()
public void setCandidateClusterContext(CandidateClusterContext context)
setCandidateClusterContext in interface ClientConnectionManagerpublic void beforeClusterSwitch(CandidateClusterContext context)
beforeClusterSwitch in interface ClientConnectionManagerCopyright © 2019 Hazelcast, Inc.. All rights reserved.