org.objectweb.joram.client.jms.tcp
Class ReliableTcpClient

java.lang.Object
  extended by org.objectweb.joram.client.jms.tcp.ReliableTcpClient
Direct Known Subclasses:
ReliableSSLTcpClient

public class ReliableTcpClient
extends java.lang.Object


Nested Class Summary
(package private) static class ReliableTcpClient.ServerAddress
           
 
Field Summary
private  java.util.Vector addresses
           
static java.lang.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 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
           
static java.lang.String[] statusNames
           
private  java.util.Timer timer
           
 
Constructor Summary
ReliableTcpClient()
           
 
Method Summary
 void addServerAddress(java.lang.String host, int port)
           
 void close()
           
 void connect()
           
 void connect(boolean reconnect)
           
protected  java.net.Socket createSocket(java.lang.String hostname, int port)
           
private  void doConnect(java.lang.String hostname, int port)
           
 void init(FactoryParameters params, Identity identity, boolean reconnect)
           
 java.lang.Object receive()
           
private  void reconnect()
           
 void send(AbstractJmsMessage request)
           
private  void setStatus(int status)
           
 void setTimer(java.util.Timer timer2)
           
 void stopReconnections()
           
private  void throwSecurityError(java.lang.String info)
           
 java.lang.String toString()
           
private  void waitForReconnection()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

public static org.objectweb.util.monolog.api.Logger logger

INIT

public static final int INIT
See Also:
Constant Field Values

CONNECT

public static final int CONNECT
See Also:
Constant Field Values

CLOSE

public static final int CLOSE
See Also:
Constant Field Values

statusNames

public static final java.lang.String[] statusNames

params

protected FactoryParameters params

identity

protected Identity identity

key

protected int key

connection

private ReliableTcpConnection connection

status

private volatile int status

addresses

private java.util.Vector addresses

reconnect

private boolean reconnect
True if the client must try to reconnect in case of connection failure. It depends of cnxPendingTimer on a "normal" TCP connection, always true on HA.


reconnectTimeout

private int reconnectTimeout
Time in ms during the client try to reconnect to the server. It depends of connectingTimer and cnxPendingTimer from the connection parameters.


timer

private java.util.Timer timer

CLOCK_SYNCHRO_THRESHOLD

public static final java.lang.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. A warning is generated if there is more than this value in milliseconds between the two clocks.

By default the value is 1000 milliseconds.

See Also:
Constant Field Values

clockSynchroThreshold

private long clockSynchroThreshold
Value of the threshold of warning for the verification of the synchronization between the client and server clock. A warning is generated if there is more than this value in milliseconds between the two clocks.

By default the value is 1000 milliseconds.

Constructor Detail

ReliableTcpClient

public ReliableTcpClient()
Method Detail

setTimer

public void setTimer(java.util.Timer timer2)

init

public void init(FactoryParameters params,
                 Identity identity,
                 boolean reconnect)

setStatus

private void setStatus(int status)

connect

public void connect()
             throws javax.jms.JMSException
Throws:
javax.jms.JMSException

connect

public void connect(boolean reconnect)
             throws javax.jms.JMSException
Throws:
javax.jms.JMSException

createSocket

protected java.net.Socket createSocket(java.lang.String hostname,
                                       int port)
                                throws java.lang.Exception
Throws:
java.lang.Exception

doConnect

private void doConnect(java.lang.String hostname,
                       int port)
                throws java.lang.Exception,
                       javax.jms.JMSException
Throws:
java.lang.Exception
javax.jms.JMSException

throwSecurityError

private void throwSecurityError(java.lang.String info)
                         throws javax.jms.JMSSecurityException
Throws:
javax.jms.JMSSecurityException

send

public void send(AbstractJmsMessage request)
          throws java.lang.Exception
Throws:
java.lang.Exception

receive

public java.lang.Object receive()
                         throws java.lang.Exception
Throws:
java.lang.Exception

waitForReconnection

private void waitForReconnection()
                          throws java.lang.Exception
Throws:
java.lang.Exception

reconnect

private void reconnect()
                throws java.lang.Exception
Throws:
java.lang.Exception

close

public void close()

addServerAddress

public void addServerAddress(java.lang.String host,
                             int port)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

stopReconnections

public void stopReconnections()


Copyright © 2010 ScalAgent D.T.. All Rights Reserved.