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 ClientConnectionManager
public boolean isAlive()
ClientConnectionManager
isAlive
in interface ClientConnectionManager
public void start(ClientContext clientContext) throws Exception
Exception
protected void startEventLoopGroup()
public void shutdown()
public ClientPrincipal getPrincipal()
getPrincipal
in interface ClientConnectionManager
protected void stopEventLoopGroup()
public Connection getActiveConnection(Address target)
getActiveConnection
in interface ClientConnectionManager
target
- to be connectedpublic Connection getOrConnect(Address address) throws IOException
getOrConnect
in interface ClientConnectionManager
address
- to be connectedIOException
- if connection is not establishedpublic Connection getOrTriggerConnect(Address target) throws IOException
getOrTriggerConnect
in interface ClientConnectionManager
target
- to be connectedIOException
- if connection is not able to triggeredpublic Address getOwnerConnectionAddress()
getOwnerConnectionAddress
in interface ClientConnectionManager
public ClientConnection getOwnerConnection()
getOwnerConnection
in interface ClientConnectionManager
protected ClientConnection createSocketConnection(Address address) throws IOException
IOException
public void addConnectionListener(ConnectionListener connectionListener)
ConnectionListenable
addConnectionListener
in interface ConnectionListenable
connectionListener
- the ConnectionListener to add.public void addConnectionHeartbeatListener(ConnectionHeartbeatListener connectionHeartbeatListener)
addConnectionHeartbeatListener
in interface ClientConnectionManager
public void heartbeatResumed(Connection connection)
ConnectionHeartbeatListener
heartbeatResumed
in interface ConnectionHeartbeatListener
public void heartbeatStopped(Connection connection)
ConnectionHeartbeatListener
ClientProperty.HEARTBEAT_TIMEOUT
milliseconds from the member.heartbeatStopped
in interface ConnectionHeartbeatListener
public void connectToCluster()
connectToCluster
in interface ClientConnectionManager
public Future<Void> connectToClusterAsync()
connectToClusterAsync
in interface ClientConnectionManager
Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.