Joram 5.3.1

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

java.lang.Object
  extended by org.objectweb.joram.mom.proxies.tcp.TcpProxyService
All Implemented Interfaces:
ConnectionManagerMBean, TcpProxyServiceMBean
Direct Known Subclasses:
SSLTcpProxyService

public class TcpProxyService
extends java.lang.Object
implements TcpProxyServiceMBean

Starts a TCP entry point for MOM clients.


Field Summary
static java.lang.String BACKLOG_PROP
          Name the property that allow to fix the TCP BACKLOG property for the client's connections.
static int DEFAULT_BACKLOG
          Default value for the TCP BACKLOG property.
static java.lang.String DEFAULT_BINDADDRESS
          Default IP address for binding the listen socket.
static int DEFAULT_POOL_SIZE
          Default value for the pool size.
static int DEFAULT_PORT
          Default value for the TCP port of the listen socket.
static int DEFAULT_SO_TIMEOUT
          Default value for the TCP SO_TIMEOUT property.
static org.objectweb.util.monolog.api.Logger logger
          logger
static java.lang.String POOL_SIZE_PROP
          Name the property that allow to fix the pool size for the connection's listener.
static java.lang.String SO_TIMEOUT_PROP
          Name the property that allow to fix the TCP SO_TIMEOUT property for the client's connections.
 
Constructor Summary
TcpProxyService(int port, int backlog, java.lang.String address)
           
 
Method Summary
 void activate()
          Activates the connection manager.
 void closeAllConnections()
          Closes all opened connections.
protected  java.net.ServerSocket createServerSocket(int port, int backlog, java.lang.String address)
          Initialize the listening socket.
 void deactivate()
          Deactivates the connection manager.
 int getFailedLoginCount()
          Gets the number of connections rejected due to a failed authentication.
 int getInitiatedConnectionCount()
          Gets the number of initiated connections since server start.
 java.lang.String getMBeanName()
          Gets the name of the MBean.
 int getProtocolErrorCount()
          Gets the number of connections rejected due to a wrong protocol header.
 int getRunningConnectionsCount()
          Gets the number of living connections.
 java.lang.String getServerAddress()
          Gets the socket address of the server.
 int getTcpListenersPoolSize()
          Gets the number of threads listening for incoming tcp connections.
static void init(java.lang.String args, boolean firstTime)
          Initializes the TCP entry point by creating a server socket listening to the specified port.
 boolean isActivated()
          Tells if the ConnectionManager is active.
protected  void resetServerSocket()
          Closes the listening socket and sets the variable to null.
protected  void start()
           
static void stopService()
          Stops the service.
 
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


SO_TIMEOUT_PROP

public static final java.lang.String SO_TIMEOUT_PROP
Name the property that allow to fix the TCP SO_TIMEOUT property for the client's connections.

See Also:
Constant Field Values

DEFAULT_SO_TIMEOUT

public static final int DEFAULT_SO_TIMEOUT
Default value for the TCP SO_TIMEOUT property.

See Also:
Constant Field Values

POOL_SIZE_PROP

public static final java.lang.String POOL_SIZE_PROP
Name the property that allow to fix the pool size for the connection's listener.

See Also:
Constant Field Values

DEFAULT_POOL_SIZE

public static final int DEFAULT_POOL_SIZE
Default value for the pool size.

See Also:
Constant Field Values

BACKLOG_PROP

public static final java.lang.String BACKLOG_PROP
Name the property that allow to fix the TCP BACKLOG property for the client's connections.

See Also:
Constant Field Values

DEFAULT_BACKLOG

public static final int DEFAULT_BACKLOG
Default value for the TCP BACKLOG property.

See Also:
Constant Field Values

DEFAULT_PORT

public static final int DEFAULT_PORT
Default value for the TCP port of the listen socket.

See Also:
Constant Field Values

DEFAULT_BINDADDRESS

public static final java.lang.String DEFAULT_BINDADDRESS
Default IP address for binding the listen socket.

See Also:
Constant Field Values
Constructor Detail

TcpProxyService

public TcpProxyService(int port,
                       int backlog,
                       java.lang.String address)
                throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

resetServerSocket

protected void resetServerSocket()
Closes the listening socket and sets the variable to null.


createServerSocket

protected java.net.ServerSocket createServerSocket(int port,
                                                   int backlog,
                                                   java.lang.String address)
                                            throws java.lang.Exception
Initialize the listening socket.

Parameters:
port -
backlog -
address -
Returns:
The initialized socket.
Throws:
java.lang.Exception

init

public static void init(java.lang.String args,
                        boolean firstTime)
                 throws java.lang.Exception
Initializes the TCP entry point by creating a server socket listening to the specified port.

Parameters:
args - stringified listening port
firstTime - true when the agent server starts.
Throws:
java.lang.Exception

stopService

public static void stopService()
Stops the service.


start

protected void start()

getMBeanName

public java.lang.String getMBeanName()
Description copied from interface: ConnectionManagerMBean
Gets the name of the MBean.

Specified by:
getMBeanName in interface ConnectionManagerMBean

activate

public void activate()
Description copied from interface: ConnectionManagerMBean
Activates the connection manager. Creation of new connections will be allowed.

Specified by:
activate in interface ConnectionManagerMBean

closeAllConnections

public void closeAllConnections()
Description copied from interface: ConnectionManagerMBean
Closes all opened connections.

Specified by:
closeAllConnections in interface ConnectionManagerMBean

deactivate

public void deactivate()
Description copied from interface: ConnectionManagerMBean
Deactivates the connection manager. No new connection will be opened.

Specified by:
deactivate in interface ConnectionManagerMBean

isActivated

public boolean isActivated()
Description copied from interface: ConnectionManagerMBean
Tells if the ConnectionManager is active.

Specified by:
isActivated in interface ConnectionManagerMBean
Returns:
ConnectionManager's active state.

getRunningConnectionsCount

public int getRunningConnectionsCount()
Description copied from interface: ConnectionManagerMBean
Gets the number of living connections.

Specified by:
getRunningConnectionsCount in interface ConnectionManagerMBean
Returns:
the number of living connections.

getTcpListenersPoolSize

public int getTcpListenersPoolSize()
Description copied from interface: TcpProxyServiceMBean
Gets the number of threads listening for incoming tcp connections.

Specified by:
getTcpListenersPoolSize in interface TcpProxyServiceMBean
Returns:
the tcp listeners pool size.

getServerAddress

public java.lang.String getServerAddress()
Description copied from interface: TcpProxyServiceMBean
Gets the socket address of the server.

Specified by:
getServerAddress in interface TcpProxyServiceMBean
Returns:
the server socket address.

getFailedLoginCount

public int getFailedLoginCount()
Description copied from interface: ConnectionManagerMBean
Gets the number of connections rejected due to a failed authentication.

Specified by:
getFailedLoginCount in interface ConnectionManagerMBean
Returns:
the number of connections rejected due to a failed authentication.

getInitiatedConnectionCount

public int getInitiatedConnectionCount()
Description copied from interface: ConnectionManagerMBean
Gets the number of initiated connections since server start.

Specified by:
getInitiatedConnectionCount in interface ConnectionManagerMBean
Returns:
the number of initiated connection.

getProtocolErrorCount

public int getProtocolErrorCount()
Description copied from interface: TcpProxyServiceMBean
Gets the number of connections rejected due to a wrong protocol header.

Specified by:
getProtocolErrorCount in interface TcpProxyServiceMBean
Returns:
the number of connections rejected due to a wrong protocol header.

Joram 5.3.1

Copyright © 2000 - 2009 Scalagent D.T. - All rights reserved