public class ClientConnectionManagerImpl extends Object implements ClientConnectionManager
Modifier and Type | Class and Description |
---|---|
class |
ClientConnectionManagerImpl.ManagerAuthenticator |
Constructor and Description |
---|
ClientConnectionManagerImpl(HazelcastClientInstanceImpl client,
LoadBalancer loadBalancer,
AddressTranslator addressTranslator) |
Modifier and Type | Method and Description |
---|---|
ClientConnection |
connectToAddress(Address target) |
String |
getUuid() |
void |
handlePacket(Packet packet)
Handles incoming network package
|
boolean |
isAlive()
Check if client connection manager is alive.
|
int |
newCallId()
Next unique call id for request
|
void |
onCloseOwnerConnection()
Called when an owner connection is closed
|
void |
onConnectionClose(ClientConnection clientConnection)
Called when an connection is closed.
|
void |
onDetectingUnresponsiveConnection(ClientConnection connection)
Called heartbeat timeout is detected on a connection.
|
ClientConnection |
ownerConnection(Address address)
Creates a new owner connection to given address
|
void |
removeEndpoint(Address address)
Called when a member left the cluster
|
boolean |
removeEventHandler(Integer callId)
Removes event handler corresponding to callId from responsible ClientConnection
|
Object |
sendAndReceive(ClientRequest request,
ClientConnection connection)
Sends request and waits for response
|
void |
shutdown()
Shutdown clientConnectionManager
|
void |
start()
Start clientConnectionManager
|
ClientConnection |
tryToConnect(Address target)
Tries to connect to an address in member list.
|
public ClientConnectionManagerImpl(HazelcastClientInstanceImpl client, LoadBalancer loadBalancer, AddressTranslator addressTranslator)
public boolean isAlive()
ClientConnectionManager
isAlive
in interface ClientConnectionManager
public void start()
ClientConnectionManager
start
in interface ClientConnectionManager
public void shutdown()
ClientConnectionManager
shutdown
in interface ClientConnectionManager
public void onCloseOwnerConnection()
ClientConnectionManager
onCloseOwnerConnection
in interface ClientConnectionManager
public ClientConnection ownerConnection(Address address) throws IOException
ClientConnectionManager
ownerConnection
in interface ClientConnectionManager
address
- to be connection to establishedIOException
public ClientConnection connectToAddress(Address target) throws Exception
connectToAddress
in interface ClientConnectionManager
Exception
public ClientConnection tryToConnect(Address target) throws Exception
ClientConnectionManager
tryToConnect
in interface ClientConnectionManager
target
- hintAddressException
- authentication failed or no connection foundpublic String getUuid()
getUuid
in interface ClientConnectionManager
public void onConnectionClose(ClientConnection clientConnection)
ClientConnectionManager
onConnectionClose
in interface ClientConnectionManager
clientConnection
- closed connectionpublic boolean removeEventHandler(Integer callId)
ClientConnectionManager
removeEventHandler
in interface ClientConnectionManager
callId
- of event handler registration requestpublic void handlePacket(Packet packet)
ClientConnectionManager
handlePacket
in interface ClientConnectionManager
packet
- to be processedpublic int newCallId()
ClientConnectionManager
newCallId
in interface ClientConnectionManager
public Object sendAndReceive(ClientRequest request, ClientConnection connection) throws Exception
ClientConnectionManager
sendAndReceive
in interface ClientConnectionManager
request
- to be sendconnection
- to send the request overException
- if a network connection occurs or response is an exceptionpublic void removeEndpoint(Address address)
ClientConnectionManager
removeEndpoint
in interface ClientConnectionManager
address
- address of the memberpublic void onDetectingUnresponsiveConnection(ClientConnection connection)
ClientConnectionManager
onDetectingUnresponsiveConnection
in interface ClientConnectionManager
connection
- to be marked.Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.