Class TcpConnectionListener
- java.lang.Object
-
- fr.dyade.aaa.common.Daemon
-
- org.objectweb.joram.mom.proxies.tcp.TcpConnectionListener
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classTcpConnectionListener.NetOutputStream
-
Field Summary
Fields Modifier and Type Field Description (package private) ExponentialMovingAverageaveragestatic StringCLOCK_SYNCHRO_THRESHOLDName of the property allowing to change the threshold of warning for the verification of the synchronization between the client and server clock.private longclockSynchroThresholdValue of the threshold of warning for the verification of the synchronization between the client and server clock.static StringCONNECTING_TIMERName of the property allowing to change the default value of timeout during TCP connection.private intconnectingTimerValue of timeout during TCP connection.private intconnectionCountNumber of connections started with this connection listener.private static booleanDEBUGprivate intfailedLoginCountNumber of times this connection listener has encountered an erroneous authentication.private static Loggerloggerprivate static Loggerlogmonintorprivate static booleanMONITORprivate static intPERIODSprivate intprotocolErrorCountNumber of times this connection listener has encountered an erroneous magic number or protocol version.private TcpProxyServiceproxyServiceThe TCP proxy serviceprivate inttimeout
-
Constructor Summary
Constructors Constructor Description TcpConnectionListener(TcpProxyService proxyService, String name, int timeout)Creates a new connection listener
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidacceptConnection()Accepts a TCP connection.protected voidclose()Releases any resources attached to this daemon.longgetAverage()intgetFailedLoginCount()intgetInitiatedConnectionCount()intgetProtocolErrorCount()voidrun()protected voidshutdown()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
-
-
-
-
Field Detail
-
logger
private static final Logger logger
-
DEBUG
private static final boolean DEBUG
-
logmonintor
private static final Logger logmonintor
-
MONITOR
private static final boolean MONITOR
-
PERIODS
private static final int PERIODS
-
average
final ExponentialMovingAverage average
-
proxyService
private TcpProxyService proxyService
The TCP proxy service
-
timeout
private int timeout
-
CLOCK_SYNCHRO_THRESHOLD
public static final 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.
-
CONNECTING_TIMER
public static final String CONNECTING_TIMER
Name of the property allowing to change the default value of timeout during TCP connection. This timeout is overloaded by value of cnxPendingTimer parameter from client if defined.By default the value is 5000 milliseconds.
- See Also:
- Constant Field Values
-
connectingTimer
private int connectingTimer
Value of timeout during TCP connection. This timeout is overloaded by value of cnxPendingTimer parameter from client if defined.By default the value is 5000 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, String name, int timeout)
Creates a new connection listener- Parameters:
proxyService- the TCP proxy service associated with this connection listenertimeout- the timeout
-
-
Method Detail
-
getAverage
public long getAverage()
-
run
public void run()
-
acceptConnection
private void acceptConnection() throws ExceptionAccepts a TCP connection. Opens theUserConnectionwith the right user's proxy, creates and starts theTcpConnection.- Throws:
Exception
-
shutdown
protected void shutdown()
Description copied from class:DaemonInterrupts 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.
-
close
protected void close()
Description copied from class:DaemonReleases any resources attached to this daemon. Be careful, its method should be called more than one time.
-
getFailedLoginCount
public int getFailedLoginCount()
-
getInitiatedConnectionCount
public int getInitiatedConnectionCount()
-
getProtocolErrorCount
public int getProtocolErrorCount()
-
-