Class LocalConnections
- java.lang.Object
-
- org.objectweb.joram.client.jms.local.LocalConnections
-
- All Implemented Interfaces:
LocalConnectionsMBean,ConnectionManagerMBean
public class LocalConnections extends Object implements LocalConnectionsMBean
Class used to check off local connections.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanactivatedIf true, creation of new connections is available.(package private) static ExponentialMovingAverageaverageprivate List<LocalRequestChannel>connectionsLists the opened local connections.private static LocalConnectionscurrentInstanceUnique LocalConnections instance.private intfailedLoginCountNumber of failed login attempts.private intinitiatedConnectionCountNumber of local connections initiated since agent server start.(package private) static Loggerlogmonprivate static StringMBEAN_NAME(package private) static booleanMONITORprivate static intPERIODS
-
Constructor Summary
Constructors Modifier Constructor Description privateLocalConnections()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate()Activates the connection manager.voidaddLocalConnection(LocalRequestChannel localRequestChannel)voidcloseAllConnections()Closes all opened connections.voiddeactivate()Deactivates the connection manager.longgetAverageConnectionTime()Gets the average time for incoming local connections.static LocalConnectionsgetCurrentInstance()intgetFailedLoginCount()Gets the number of connections rejected due to a failed authentication.intgetInitiatedConnectionCount()Gets the number of initiated connections since server start.StringgetMBeanName()Gets the name of the MBean.intgetRunningConnectionsCount()Gets the number of living connections.StringgetVersion()Gets the name of the MBean.voidincreaseFailedLoginCount()voidincreaseInitiatedConnectionCount()booleanisActivated()Tells if the ConnectionManager is active.voidremoveLocalConnection(LocalRequestChannel localRequestChannel)
-
-
-
Field Detail
-
logmon
static final Logger logmon
-
MONITOR
static final boolean MONITOR
-
PERIODS
private static final int PERIODS
-
MBEAN_NAME
private static final String MBEAN_NAME
- See Also:
- Constant Field Values
-
currentInstance
private static LocalConnections currentInstance
Unique LocalConnections instance.
-
connections
private List<LocalRequestChannel> connections
Lists the opened local connections.
-
activated
private boolean activated
If true, creation of new connections is available.
-
failedLoginCount
private int failedLoginCount
Number of failed login attempts.
-
initiatedConnectionCount
private int initiatedConnectionCount
Number of local connections initiated since agent server start.
-
average
static final ExponentialMovingAverage average
-
-
Method Detail
-
activate
public void activate()
Description copied from interface:ConnectionManagerMBeanActivates the connection manager. Creation of new connections will be allowed.- Specified by:
activatein interfaceConnectionManagerMBean
-
closeAllConnections
public void closeAllConnections()
Description copied from interface:ConnectionManagerMBeanCloses all opened connections.- Specified by:
closeAllConnectionsin interfaceConnectionManagerMBean
-
deactivate
public void deactivate()
Description copied from interface:ConnectionManagerMBeanDeactivates the connection manager. No new connection will be opened.- Specified by:
deactivatein interfaceConnectionManagerMBean
-
getRunningConnectionsCount
public int getRunningConnectionsCount()
Description copied from interface:ConnectionManagerMBeanGets the number of living connections.- Specified by:
getRunningConnectionsCountin interfaceConnectionManagerMBean- Returns:
- the number of living connections.
-
isActivated
public boolean isActivated()
Description copied from interface:ConnectionManagerMBeanTells if the ConnectionManager is active.- Specified by:
isActivatedin interfaceConnectionManagerMBean- Returns:
- ConnectionManager's active state.
-
addLocalConnection
public void addLocalConnection(LocalRequestChannel localRequestChannel)
-
removeLocalConnection
public void removeLocalConnection(LocalRequestChannel localRequestChannel)
-
getCurrentInstance
public static LocalConnections getCurrentInstance()
-
getMBeanName
public String getMBeanName()
Description copied from interface:ConnectionManagerMBeanGets the name of the MBean.- Specified by:
getMBeanNamein interfaceConnectionManagerMBean
-
getVersion
public String getVersion()
Description copied from interface:ConnectionManagerMBeanGets the name of the MBean.- Specified by:
getVersionin interfaceConnectionManagerMBean
-
getFailedLoginCount
public int getFailedLoginCount()
Description copied from interface:ConnectionManagerMBeanGets the number of connections rejected due to a failed authentication.- Specified by:
getFailedLoginCountin interfaceConnectionManagerMBean- Returns:
- the number of connections rejected due to a failed authentication.
-
increaseFailedLoginCount
public void increaseFailedLoginCount()
-
getInitiatedConnectionCount
public int getInitiatedConnectionCount()
Description copied from interface:ConnectionManagerMBeanGets the number of initiated connections since server start.- Specified by:
getInitiatedConnectionCountin interfaceConnectionManagerMBean- Returns:
- the number of initiated connection.
-
increaseInitiatedConnectionCount
public void increaseInitiatedConnectionCount()
-
getAverageConnectionTime
public long getAverageConnectionTime()
Gets the average time for incoming local connections.- Specified by:
getAverageConnectionTimein interfaceLocalConnectionsMBean- Returns:
- the average time for incoming local connections.
-
-