public class ClientConnectionManagerImpl extends Object implements ClientConnectionManager, ConnectionHeartbeatListener
ClientConnectionManager.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
alive |
protected AtomicInteger |
connectionIdGen |
| Constructor and Description |
|---|
ClientConnectionManagerImpl(HazelcastClientInstanceImpl client,
AddressTranslator addressTranslator,
Collection<AddressProvider> addressProviders) |
protected final AtomicInteger connectionIdGen
protected volatile boolean alive
public ClientConnectionManagerImpl(HazelcastClientInstanceImpl client, AddressTranslator addressTranslator, Collection<AddressProvider> addressProviders)
public NioEventLoopGroup getEventLoopGroup()
protected NioEventLoopGroup initEventLoopGroup(HazelcastClientInstanceImpl client)
public Collection<ClientConnection> getActiveConnections()
getActiveConnections in interface ClientConnectionManagerpublic boolean isAlive()
ClientConnectionManagerisAlive in interface ClientConnectionManagerpublic void start(ClientContext clientContext)
protected void startEventLoopGroup()
public void shutdown()
public ClientPrincipal getPrincipal()
getPrincipal in interface ClientConnectionManagerprotected void stopEventLoopGroup()
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, boolean acquiresResources) throws IOException
getOrTriggerConnect in interface ClientConnectionManagertarget - to be connectedIOException - if connection is not able to triggeredpublic Address getOwnerConnectionAddress()
getOwnerConnectionAddress in interface ClientConnectionManagerpublic ClientConnection getOwnerConnection()
getOwnerConnection in interface ClientConnectionManagerprotected ClientConnection createSocketConnection(Address address) throws IOException
IOExceptionpublic void addConnectionListener(ConnectionListener connectionListener)
ConnectionListenableaddConnectionListener in interface ConnectionListenableconnectionListener - the ConnectionListener to add.public void addConnectionHeartbeatListener(ConnectionHeartbeatListener connectionHeartbeatListener)
addConnectionHeartbeatListener in interface ClientConnectionManagerpublic void heartbeatResumed(Connection connection)
ConnectionHeartbeatListenerheartbeatResumed in interface ConnectionHeartbeatListenerpublic void heartbeatStopped(Connection connection)
ConnectionHeartbeatListenerClientProperty.HEARTBEAT_TIMEOUT milliseconds from the member.heartbeatStopped in interface ConnectionHeartbeatListenerpublic void connectToCluster()
connectToCluster in interface ClientConnectionManagerpublic Future<Void> connectToClusterAsync()
connectToClusterAsync in interface ClientConnectionManagerCopyright © 2018 Hazelcast, Inc.. All Rights Reserved.