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 org.objectweb.joram.shared.security.Identity |
identity |
static int |
INIT |
protected int |
key |
private static org.objectweb.util.monolog.api.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 |
protected 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,
org.objectweb.joram.shared.security.Identity identity,
boolean reconnect) |
Object |
receive() |
private void |
reconnect() |
void |
send(org.objectweb.joram.shared.client.AbstractJmsMessage request) |
private void |
setStatus(int status) |
void |
setTimer(Timer timer) |
void |
stopReconnections() |
private void |
throwSecurityError(String info) |
String |
toString() |
private void |
waitForReconnection() |
private static final org.objectweb.util.monolog.api.Logger logger
public static final int INIT
public static final int CONNECT
public static final int CLOSE
protected static final String[] statusNames
protected FactoryParameters params
protected org.objectweb.joram.shared.security.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, org.objectweb.joram.shared.security.Identity identity, boolean reconnect)
private void setStatus(int status)
public void connect()
throws jakarta.jms.JMSException
jakarta.jms.JMSExceptionpublic void connect(boolean reconnect)
throws jakarta.jms.JMSException
jakarta.jms.JMSExceptionprotected Socket createSocket(String hostname, int port) throws Exception
Exceptionprivate void doConnect(String hostname, int port) throws Exception, jakarta.jms.JMSException
Exceptionjakarta.jms.JMSExceptionprivate void throwSecurityError(String info) throws jakarta.jms.JMSSecurityException
jakarta.jms.JMSSecurityExceptionpublic void send(org.objectweb.joram.shared.client.AbstractJmsMessage request)
throws Exception
Exceptionpublic void close()
public void addServerAddress(String host, int port)
public void stopReconnections()
Copyright © 2023 ScalAgent D.T.. All rights reserved.