org.objectweb.joram.mom.proxies.tcp
Class TcpConnectionListener

java.lang.Object
  extended by fr.dyade.aaa.common.Daemon
      extended by org.objectweb.joram.mom.proxies.tcp.TcpConnectionListener
All Implemented Interfaces:
java.lang.Runnable

public class TcpConnectionListener
extends Daemon

Listens to the TCP connections from the JMS clients. Creates a TcpConnection for each accepted TCP connection. Opens the UserConnection with the right user's proxy.


Nested Class Summary
(package private) static class TcpConnectionListener.NetOutputStream
           
 
Field Summary
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.
private  int connectionCount
          Number of connections started with this connection listener.
private  int failedLoginCount
          Number of times this connection listener has encountered an erroneous authentication.
static org.objectweb.util.monolog.api.Logger logger
          logger
private  int protocolErrorCount
          Number of times this connection listener has encountered an erroneous magic number or protocol version.
private  TcpProxyService proxyService
          The TCP proxy service
private  int timeout
           
 
Fields inherited from class fr.dyade.aaa.common.Daemon
canStop, group, logmon, priority, running, thread
 
Constructor Summary
TcpConnectionListener(TcpProxyService proxyService, int timeout)
          Creates a new connection listener
 
Method Summary
private  void acceptConnection()
          Accepts a TCP connection.
protected  void close()
          Releases any resources attached to this daemon.
 int getFailedLoginCount()
           
 int getInitiatedConnectionCount()
           
 int getProtocolErrorCount()
           
 void run()
           
protected  void shutdown()
          Interrupts a thread that waits for long periods.
 
Methods inherited from class fr.dyade.aaa.common.Daemon
finish, getName, interrupt, isCurrentThread, isRunning, setDaemon, setName, setPriority, setThreadGroup, start, stop, toString
 
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
logger


proxyService

private TcpProxyService proxyService
The TCP proxy service


timeout

private int timeout

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.


failedLoginCount

private int failedLoginCount
Number of times this connection listener has encountered an erroneous authentication.


connectionCount

private int connectionCount
Number of connections started with this connection listener.


protocolErrorCount

private int protocolErrorCount
Number of times this connection listener has encountered an erroneous magic number or protocol version.

Constructor Detail

TcpConnectionListener

public TcpConnectionListener(TcpProxyService proxyService,
                             int timeout)
Creates a new connection listener

Parameters:
proxyService - the TCP proxy service associated with this connection listener
timeout - the timeout
Method Detail

run

public void run()

acceptConnection

private void acceptConnection()
                       throws java.lang.Exception
Accepts a TCP connection. Opens the UserConnection with the right user's proxy, creates and starts the TcpConnection.

Throws:
java.lang.Exception

shutdown

protected void shutdown()
Description copied from class: Daemon
Interrupts a thread that waits for long periods. In some cases, we must use application specific tricks. For example, if a thread is waiting on a known socket, we have to close the socket to cause the thread to return immediately. Unfortunately, there really isn't any technique that works in general.

Specified by:
shutdown in class Daemon

close

protected void close()
Description copied from class: Daemon
Releases any resources attached to this daemon. Be careful, its method should be called more than one time.

Specified by:
close in class Daemon

getFailedLoginCount

public int getFailedLoginCount()

getInitiatedConnectionCount

public int getInitiatedConnectionCount()

getProtocolErrorCount

public int getProtocolErrorCount()


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