com.hazelcast.client.connection
Interface ClientConnectionManager

All Known Implementing Classes:
ClientConnectionManagerImpl

public interface ClientConnectionManager

Responsible for managing ClientConnection objects.


Method Summary
 void addConnectionHeartbeatListener(ConnectionHeartbeatListener connectionHeartbeatListener)
           
 void addConnectionListener(ConnectionListener connectionListener)
           
 void destroyConnection(Connection connection)
          Destroys the connection Clears related resources of given connection.
 Connection getConnection(Address address)
           
 Connection getOrConnect(Address address, 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
 

Method Detail

shutdown

void shutdown()
Shutdown clientConnectionManager


isAlive

boolean isAlive()
Check if client connection manager is alive. ClientConnectionManager is not alive only when client is closing.

Returns:
true if alive, false otherwise.

start

void start()
Start clientConnectionManager


getConnection

Connection getConnection(Address address)
Parameters:
address - to be connected
Returns:
connection if available, null otherwise

getOrConnect

Connection getOrConnect(Address address,
                        Authenticator authenticator)
                        throws IOException
Parameters:
address - 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

void destroyConnection(Connection connection)
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.

Parameters:
connection - to be closed

handlePacket

void handlePacket(Packet packet)
Handles incoming network package

Parameters:
packet - to be processed

addConnectionListener

void addConnectionListener(ConnectionListener connectionListener)

addConnectionHeartbeatListener

void addConnectionHeartbeatListener(ConnectionHeartbeatListener connectionHeartbeatListener)


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