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

java.lang.Object
  extended by org.objectweb.joram.mom.proxies.tcp.TcpConnection
All Implemented Interfaces:
TcpConnectionMBean

public class TcpConnection
extends java.lang.Object
implements TcpConnectionMBean

Handles the TCP connection. Starts the reader and writer threads responsible for reading the requests and writing the replies. Calls the UserConnection in order to invoke the user's proxy and get its replies.

See Also:
TcpProxyService, TcpConnectionListener

Field Summary
static org.objectweb.util.monolog.api.Logger logger
          logger
 
Constructor Summary
TcpConnection(IOControl ioctrl, ReliableConnectionContext ctx, AgentId proxyId, TcpProxyService proxyService, Identity identity)
          Creates a new TCP connection.
 
Method Summary
 void close()
          Stops the connection reader and writer threads.
 java.lang.String getAddress()
          Gets the socket address used by the connection.
 java.util.Date getCreationDate()
          Gets connection creation date.
 int getKey()
           
 AgentId getProxyId()
           
 long getReceivedCount()
          Gets the number of replies received on the connection.
 long getSentCount()
          Gets the number of requests sent on the connection.
 java.lang.String getUserName()
          Gets connected user's name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

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

Constructor Detail

TcpConnection

public TcpConnection(IOControl ioctrl,
                     ReliableConnectionContext ctx,
                     AgentId proxyId,
                     TcpProxyService proxyService,
                     Identity identity)
Creates a new TCP connection.

Parameters:
ioctrl -
ctx -
proxyId -
proxyService - the TCP proxy service
identity -
Method Detail

getProxyId

public final AgentId getProxyId()

getKey

public final int getKey()

close

public void close()
Stops the connection reader and writer threads. Closes the socket.

Specified by:
close in interface TcpConnectionMBean

getUserName

public java.lang.String getUserName()
Description copied from interface: TcpConnectionMBean
Gets connected user's name.

Specified by:
getUserName in interface TcpConnectionMBean
Returns:
the name of the connected user.

getAddress

public java.lang.String getAddress()
Description copied from interface: TcpConnectionMBean
Gets the socket address used by the connection.

Specified by:
getAddress in interface TcpConnectionMBean
Returns:
the connection's socket address.

getCreationDate

public java.util.Date getCreationDate()
Description copied from interface: TcpConnectionMBean
Gets connection creation date.

Specified by:
getCreationDate in interface TcpConnectionMBean
Returns:
the date of creation of the connection.

getReceivedCount

public long getReceivedCount()
Description copied from interface: TcpConnectionMBean
Gets the number of replies received on the connection.

Specified by:
getReceivedCount in interface TcpConnectionMBean
Returns:
the number of replies received on the connection.

getSentCount

public long getSentCount()
Description copied from interface: TcpConnectionMBean
Gets the number of requests sent on the connection.

Specified by:
getSentCount in interface TcpConnectionMBean
Returns:
the number of requests sent on the connection.


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