public interface ConnectionManager
Connection
objects.Modifier and Type | Method and Description |
---|---|
void |
addConnectionListener(ConnectionListener listener)
Registers a ConnectionListener.
|
void |
destroyConnection(Connection connection)
Destroys a connection.
|
int |
getActiveConnectionCount()
Gets the number of active connections.
|
int |
getAllTextConnections()
Gets the number of text connections (rest/memcache)
|
Connection |
getConnection(Address address)
Gets the connection for a given address.
|
int |
getConnectionCount()
Gets the total number of connections.
|
int |
getCurrentClientConnections()
Gets the number of client connections.
|
Connection |
getOrConnect(Address address)
Gets the existing connection for a given address or connects.
|
Connection |
getOrConnect(Address address,
boolean silent)
Gets the existing connection for a given address.
|
boolean |
registerConnection(Address address,
Connection connection) |
void |
shutdown()
Shutdowns ConnectionManager completely.
|
void |
start()
Starts ConnectionManager, initializes its resources, starts threads, etc.
|
void |
stop()
Stops ConnectionManager, releases its resources, stops threads, etc.
|
boolean |
transmit(Packet packet,
Address target)
Transmits a packet to a certain address.
|
boolean |
transmit(Packet packet,
Connection connection)
Transmits a packet to a certain connection.
|
int getCurrentClientConnections()
int getAllTextConnections()
int getConnectionCount()
int getActiveConnectionCount()
Connection getConnection(Address address)
address
- the remote side of the connection.Connection getOrConnect(Address address)
address
- the address to connect to.getOrConnect(Address, boolean)
Connection getOrConnect(Address address, boolean silent)
getConnection(Address)
.address
- the address to connect to.silent
- if logging should be done on debug level (silent=true) or on info level (silent=false).boolean registerConnection(Address address, Connection connection)
void destroyConnection(Connection connection)
connection
- the Connection to destroy.void addConnectionListener(ConnectionListener listener)
listener
- the ConnectionListener to add.NullPointerException
- if listener is null.boolean transmit(Packet packet, Connection connection)
packet
- The Packet to transmit.connection
- The connection to where the Packet should be transmitted.NullPointerException
- if packet is null.boolean transmit(Packet packet, Address target)
packet
- The Packet to transmit.target
- The address of the target machine where the Packet should be transmitted.NullPointerException
- if packet or target is null.transmit(com.hazelcast.nio.Packet, com.hazelcast.nio.Connection)
void start()
IllegalStateException
- if ConnectionManager is shutdownvoid stop()
start()
.
This method has no effect if it is already stopped or shutdown.
Currently stop is called during the merge process to detach node from the current cluster. After
node becomes ready to join to the new cluster, start is called to re-initialize the ConnectionManager.void shutdown()
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.