public class Connection extends Object
Modifier and Type | Field and Description |
---|---|
protected TCPClientFactory.ClientType |
clientType |
static short |
MAX_TRY |
protected Client |
tcpClient |
Constructor and Description |
---|
Connection(String host,
int port) |
Connection(String host,
int port,
TCPClientFactory.ClientType clientType) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
connect(long timeout) |
boolean |
equals(Object o) |
short |
getFailCount() |
String |
getHost() |
long |
getLastConnected() |
long |
getLastTry() |
int |
getPort() |
Client |
getTcpClient() |
int |
hashCode() |
boolean |
isConnected() |
boolean |
isDown() |
void |
putIfAbsent(BlockingQueue<Connection> queue) |
boolean |
reconnect() |
boolean |
reconnect(long timeout) |
void |
remoteFromQueue(BlockingQueue<Connection> queue) |
void |
shutdown() |
String |
toString() |
protected volatile Client tcpClient
public static final short MAX_TRY
protected TCPClientFactory.ClientType clientType
public Connection(String host, int port)
public Connection(String host, int port, TCPClientFactory.ClientType clientType)
public String getHost()
public int getPort()
public boolean isDown()
public Client getTcpClient()
public boolean connect(long timeout)
public boolean isConnected()
public boolean reconnect(long timeout)
public boolean reconnect()
public void close()
public void shutdown()
public long getLastConnected()
public short getFailCount()
public long getLastTry()
public void putIfAbsent(BlockingQueue<Connection> queue)
public void remoteFromQueue(BlockingQueue<Connection> queue)
Copyright © 2016. All rights reserved.