com.hazelcast.client.connection.nio
Class ClientConnectionManagerImpl

java.lang.Object
  extended by com.hazelcast.client.connection.nio.ClientConnectionManagerImpl
All Implemented Interfaces:
ClientConnectionManager

public class ClientConnectionManagerImpl
extends Object
implements ClientConnectionManager


Constructor Summary
ClientConnectionManagerImpl(HazelcastClientInstanceImpl client, AddressTranslator addressTranslator)
           
 
Method Summary
 void addConnectionHeartbeatListener(ConnectionHeartbeatListener connectionHeartbeatListener)
           
 void addConnectionListener(ConnectionListener connectionListener)
           
 void destroyConnection(Connection connection)
          Destroys the connection Clears related resources of given connection.
 ClientConnection getConnection(Address target)
           
 ClientConnection getOrConnect(Address target, Authenticator authenticator)
           
 void handlePacket(Packet packet)
          Handles incoming network package
 boolean isAlive()
          Check if client connection manager is alive.
 void shutdown()
          Shutdown clientConnectionManager
 void start()
          Start clientConnectionManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientConnectionManagerImpl

public ClientConnectionManagerImpl(HazelcastClientInstanceImpl client,
                                   AddressTranslator addressTranslator)
Method Detail

isAlive

public boolean isAlive()
Description copied from interface: ClientConnectionManager
Check if client connection manager is alive. ClientConnectionManager is not alive only when client is closing.

Specified by:
isAlive in interface ClientConnectionManager
Returns:
true if alive, false otherwise.

start

public void start()
Description copied from interface: ClientConnectionManager
Start clientConnectionManager

Specified by:
start in interface ClientConnectionManager

shutdown

public void shutdown()
Description copied from interface: ClientConnectionManager
Shutdown clientConnectionManager

Specified by:
shutdown in interface ClientConnectionManager

getConnection

public ClientConnection getConnection(Address target)
Specified by:
getConnection in interface ClientConnectionManager
Parameters:
target - to be connected
Returns:
connection if available, null otherwise

getOrConnect

public ClientConnection getOrConnect(Address target,
                                     Authenticator authenticator)
                              throws IOException
Specified by:
getOrConnect in interface ClientConnectionManager
Parameters:
target - to be connected
authenticator - Authenticator implementation to send appropriate Authentication Request after connection
Returns:
associated connection if available, creates new connection otherwise
Throws:
IOException - if connection is not established

destroyConnection

public void destroyConnection(Connection connection)
Description copied from interface: ClientConnectionManager
Destroys the connection Clears related resources of given connection. ConnectionListener.connectionRemoved is called on registered listeners.

If connection is already destroyed before calling this then does nothing.

Specified by:
destroyConnection in interface ClientConnectionManager
Parameters:
connection - to be closed

handlePacket

public void handlePacket(Packet packet)
Description copied from interface: ClientConnectionManager
Handles incoming network package

Specified by:
handlePacket in interface ClientConnectionManager
Parameters:
packet - to be processed

addConnectionListener

public void addConnectionListener(ConnectionListener connectionListener)
Specified by:
addConnectionListener in interface ClientConnectionManager

addConnectionHeartbeatListener

public void addConnectionHeartbeatListener(ConnectionHeartbeatListener connectionHeartbeatListener)
Specified by:
addConnectionHeartbeatListener in interface ClientConnectionManager


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.