public class ClientConnection extends Object implements Connection, Closeable
| Constructor and Description |
|---|
ClientConnection(ClientConnectionManager connectionManager,
IOSelector in,
IOSelector out,
int connectionId,
SocketChannelWrapper socketChannelWrapper,
ClientExecutionService executionService,
ClientInvocationServiceImpl invocationService,
SerializationService serializationService,
LifecycleService lifecycleService) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this connection.
|
void |
close(Throwable t) |
void |
decrementPacketCount() |
ClientCallFuture |
deRegisterCallId(int callId) |
ClientCallFuture |
deRegisterEventHandler(int callId) |
boolean |
equals(Object o) |
ClientConnectionManager |
getConnectionManager() |
Address |
getEndPoint()
Gets the
Address of the other side of this Connection. |
EventHandler |
getEventHandler(int callId) |
InetAddress |
getInetAddress()
Returns remote address of this Connection.
|
InetSocketAddress |
getLocalSocketAddress() |
int |
getPort()
The remote port.
|
ClientReadHandler |
getReadHandler() |
Address |
getRemoteEndpoint() |
InetSocketAddress |
getRemoteSocketAddress()
Returns the address of the endpoint this Connection is connected to, or
null if it is unconnected. |
SerializationService |
getSerializationService() |
SocketChannelWrapper |
getSocketChannelWrapper() |
ConnectionType |
getType()
Returns the
ConnectionType of this Connection. |
int |
hashCode() |
void |
incrementPacketCount() |
void |
init() |
boolean |
isAlive()
Checks if the Connection is still alive.
|
boolean |
isClient()
Checks if it is a client connection.
|
boolean |
isHeartBeating() |
long |
lastReadTime()
Returns the clock time of the most recent read using this connection.
|
long |
lastWriteTime()
Returns the clock time of the most recent write using this connection.
|
Data |
read() |
void |
registerCallId(ClientCallFuture future) |
void |
setRemoteEndpoint(Address remoteEndpoint) |
String |
toString() |
void |
write(Data data) |
boolean |
write(SocketWritable packet)
Writes a SocketWritable packet to the other side.
|
public ClientConnection(ClientConnectionManager connectionManager, IOSelector in, IOSelector out, int connectionId, SocketChannelWrapper socketChannelWrapper, ClientExecutionService executionService, ClientInvocationServiceImpl invocationService, SerializationService serializationService, LifecycleService lifecycleService) throws IOException
IOExceptionpublic void incrementPacketCount()
public void decrementPacketCount()
public void registerCallId(ClientCallFuture future)
public ClientCallFuture deRegisterCallId(int callId)
public ClientCallFuture deRegisterEventHandler(int callId)
public EventHandler getEventHandler(int callId)
public SerializationService getSerializationService()
public boolean write(SocketWritable packet)
Connectionwrite in interface Connectionpacket - the packet to write.public void init()
throws IOException
IOExceptionpublic void write(Data data) throws IOException
IOExceptionpublic Data read() throws IOException
IOExceptionpublic Address getEndPoint()
ConnectionAddress of the other side of this Connection.
todo: rename to get remoteAddress?getEndPoint in interface Connectionpublic boolean isAlive()
ConnectionisAlive in interface Connectionpublic long lastReadTime()
ConnectionlastReadTime in interface Connectionpublic long lastWriteTime()
ConnectionlastWriteTime in interface Connectionpublic void close()
Connectionclose in interface Connectionclose in interface Closeableclose in interface AutoCloseablepublic ConnectionType getType()
ConnectionConnectionType of this Connection.getType in interface Connectionnull is returned.public boolean isClient()
ConnectionisClient in interface Connectionpublic InetAddress getInetAddress()
ConnectiongetInetAddress in interface Connectionnull if the connection is not alive.public InetSocketAddress getRemoteSocketAddress()
Connectionnull if it is unconnected.getRemoteSocketAddress in interface Connectionpublic int getPort()
ConnectiongetPort in interface Connectionpublic SocketChannelWrapper getSocketChannelWrapper()
public ClientConnectionManager getConnectionManager()
public ClientReadHandler getReadHandler()
public void setRemoteEndpoint(Address remoteEndpoint)
public Address getRemoteEndpoint()
public InetSocketAddress getLocalSocketAddress()
public void close(Throwable t)
public boolean isHeartBeating()
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.