public class ReliableTcpClient extends Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
ReliableTcpClient.ServerAddress |
Modifier and Type | Field and Description |
---|---|
private Vector<ReliableTcpClient.ServerAddress> |
addresses |
static String |
CLOCK_SYNCHRO_THRESHOLD
Name of the property allowing to change the threshold of warning for the
verification of the synchronization between the client and server clock.
|
private long |
clockSynchroThreshold
Value of the threshold of warning for the verification of the synchronization
between the client and server clock.
|
static int |
CLOSE |
static int |
CONNECT |
private ReliableTcpConnection |
connection |
protected Identity |
identity |
static int |
INIT |
protected int |
key |
static Logger |
logger |
protected FactoryParameters |
params |
private boolean |
reconnect
True if the client must try to reconnect in case of connection
failure.
|
private int |
reconnectTimeout
Time in ms during the client try to reconnect to the server.
|
private int |
status |
static String[] |
statusNames |
private Timer |
timer |
Constructor and Description |
---|
ReliableTcpClient() |
Modifier and Type | Method and Description |
---|---|
void |
addServerAddress(String host,
int port) |
void |
close() |
void |
connect() |
void |
connect(boolean reconnect) |
protected Socket |
createSocket(String hostname,
int port) |
private void |
doConnect(String hostname,
int port) |
void |
init(FactoryParameters params,
Identity identity,
boolean reconnect) |
Object |
receive() |
private void |
reconnect() |
void |
send(AbstractJmsMessage request) |
private void |
setStatus(int status) |
void |
setTimer(Timer timer) |
void |
stopReconnections() |
private void |
throwSecurityError(String info) |
String |
toString() |
private void |
waitForReconnection() |
public static Logger logger
public static final int INIT
public static final int CONNECT
public static final int CLOSE
public static final String[] statusNames
protected FactoryParameters params
protected Identity identity
protected int key
private ReliableTcpConnection connection
private volatile int status
private Vector<ReliableTcpClient.ServerAddress> addresses
private boolean reconnect
private int reconnectTimeout
private Timer timer
public static final String CLOCK_SYNCHRO_THRESHOLD
By default the value is 1000 milliseconds.
private long clockSynchroThreshold
By default the value is 1000 milliseconds.
public void setTimer(Timer timer)
public void init(FactoryParameters params, Identity identity, boolean reconnect)
private void setStatus(int status)
public void connect() throws jakarta.jms.JMSException
jakarta.jms.JMSException
public void connect(boolean reconnect) throws jakarta.jms.JMSException
jakarta.jms.JMSException
protected Socket createSocket(String hostname, int port) throws Exception
Exception
private void doConnect(String hostname, int port) throws Exception, jakarta.jms.JMSException
Exception
jakarta.jms.JMSException
private void throwSecurityError(String info) throws jakarta.jms.JMSSecurityException
jakarta.jms.JMSSecurityException
public void send(AbstractJmsMessage request) throws Exception
Exception
public void close()
public void addServerAddress(String host, int port)
public void stopReconnections()
Copyright © 2023 ScalAgent D.T.. All rights reserved.