org.objectweb.joram.mom.proxies
Class ConnectionManager

java.lang.Object
  extended by org.objectweb.joram.mom.proxies.ConnectionManager
All Implemented Interfaces:
ConnectionManagerMBean

public class ConnectionManager
extends java.lang.Object
implements ConnectionManagerMBean

A ConnectionManager is started as a service in each MOM agent server for allowing connections with external clients.


Field Summary
private  boolean activated
          true if new connections are accepted.
private static ConnectionManager currentInstance
          Unique ConnectionManager instance.
static int inFlow
          Limit of incoming messages flow (msgs/s) requested if any, default value is -1 (no limitation).
static org.objectweb.util.monolog.api.Logger logger
          logger
private  java.util.List managers
          List of registered managers (tcp, ssl, local, ...)
private static java.lang.String MBEAN_NAME
           
static java.lang.String MULTI_CNX_SYNC
           
static java.lang.String MULTI_CNX_SYNC_DELAY
           
private static boolean multiCnxSync
           
private static java.util.Hashtable multiCnxSyncTable
           
private static long multiThreadSyncDelay
           
 
Constructor Summary
ConnectionManager()
           
 
Method Summary
 void activate()
          Activates the connection manager.
 void addManager(ConnectionManagerMBean manager)
          Registers a new manager.
 void closeAllConnections()
          Closes all opened connections.
private static Identity createIdentity(java.lang.String adminName, java.lang.String adminPassword, java.lang.String identityClassName)
          Create an admin Identity.
 void deactivate()
          Deactivates the connection manager.
static ConnectionManager getCurrentInstance()
           
 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.
static MultiCnxSync getMultiCnxSync(AgentId proxyId)
           
static long getMultiThreadSyncDelay()
           
 int getRunningConnectionsCount()
          Gets the number of living connections.
static void init(java.lang.String args, boolean firstTime)
          Initializes the connection manager as a service.
 boolean isActivated()
          Tells if the ConnectionManager is active.
private  void removeAllManagers()
           
 void removeManager(ConnectionManagerMBean manager)
          Removes a registered manager.
static void sendToProxy(AgentId proxyId, int cnxKey, AbstractJmsRequest req, java.lang.Object msg)
           
static void stopService()
          Stops the ConnectionManager 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


MULTI_CNX_SYNC

public static final java.lang.String MULTI_CNX_SYNC
See Also:
Constant Field Values

MULTI_CNX_SYNC_DELAY

public static final java.lang.String MULTI_CNX_SYNC_DELAY
See Also:
Constant Field Values

multiCnxSync

private static boolean multiCnxSync

multiThreadSyncDelay

private static long multiThreadSyncDelay

MBEAN_NAME

private static final java.lang.String MBEAN_NAME
See Also:
Constant Field Values

activated

private boolean activated
true if new connections are accepted.


managers

private java.util.List managers
List of registered managers (tcp, ssl, local, ...)


currentInstance

private static ConnectionManager currentInstance
Unique ConnectionManager instance.


multiCnxSyncTable

private static java.util.Hashtable multiCnxSyncTable

inFlow

public static int inFlow
Limit of incoming messages flow (msgs/s) requested if any, default value is -1 (no limitation). This value can be adjusted by setting ConnectionManager.inFlow property. This property can be fixed either from java launching command, or in a3servers.xml configuration file.

Constructor Detail

ConnectionManager

public ConnectionManager()
Method Detail

sendToProxy

public static final void sendToProxy(AgentId proxyId,
                                     int cnxKey,
                                     AbstractJmsRequest req,
                                     java.lang.Object msg)

getMultiThreadSyncDelay

public static final long getMultiThreadSyncDelay()

getMultiCnxSync

public static MultiCnxSync getMultiCnxSync(AgentId proxyId)

init

public static void init(java.lang.String args,
                        boolean firstTime)
                 throws java.lang.Exception
Initializes the connection manager as a service. Creates and deploys the administration topic, the connection manager agent and if requested the administration user proxy.

Parameters:
args - name and password of the administrator (optional).
firstTime - true when the agent server starts.
Throws:
java.lang.Exception - Thrown when processing the String argument or in case of a problem when deploying the ConnectionFactory.

createIdentity

private static Identity createIdentity(java.lang.String adminName,
                                       java.lang.String adminPassword,
                                       java.lang.String identityClassName)
                                throws java.lang.Exception
Create an admin Identity.

Parameters:
adminName - Name of the admin.
adminPassword - Password of the admin.
identityClassName - identity class name.
Returns:
identity admin Identity.
Throws:
java.lang.Exception

stopService

public static void stopService()
Stops the ConnectionManager service.


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

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.

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.

getCurrentInstance

public static ConnectionManager getCurrentInstance()

addManager

public void addManager(ConnectionManagerMBean manager)
Registers a new manager.


removeManager

public void removeManager(ConnectionManagerMBean manager)
Removes a registered manager.


removeAllManagers

private void removeAllManagers()

getMBeanName

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

Specified by:
getMBeanName in interface ConnectionManagerMBean

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.


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