Interface ConnectionMonitorMBean
- All Superinterfaces:
AbstractMonitorMBean
,Runnable
,Shutdownable
- All Known Implementing Classes:
ConnectionMonitor
This is the interface of
ConnectionMonitor
for the use of this class
as MBean. You can monitor DB connections with it and ask the class for open
connections.
Note: Since 1.4.2 this class was moved from package "patterntesting.runtime.db" to here.
- Since:
- 1.3 (02-Jan-2013)
- Version:
- $Revision: 1.10 $
- Author:
- oliver (ob@aosd.de)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
To be able to register the instance as shutdown hook you can use this (non static) method.Gets the caller of all connections.Gets the caller stacktraces of all connections.int
Gets the number of closed connections.Gets the caller which opens the last connection.Gets the stacktrace of the caller which opens the last connection.int
Gets the number of open connections.int
Gets the total sum of open and closed connections.boolean
Here you can ask if the ConnectionMonitor was already registeres ad shutdown hook.void
Log the caller stacktraces.void
If you want to unregister the instance as shutdown hook you can use this method.Methods inherited from interface clazzfish.monitor.AbstractMonitorMBean
dumpMe, dumpMe, getDumpDir, logMe
-
Method Details
-
getCallers
Gets the caller of all connections.- Returns:
- all callers
-
getCallerStacktraces
@Description("get the caller of the open connections") TabularData getCallerStacktraces() throws OpenDataExceptionGets the caller stacktraces of all connections.- Returns:
- stacktraces of all callers
- Throws:
OpenDataException
- the open data exception
-
getLastCaller
Gets the caller which opens the last connection.- Returns:
- the all caller
-
getLastCallerStacktrace
@Description("get the call stacktrace of the last open connection") StackTraceElement[] getLastCallerStacktrace()Gets the stacktrace of the caller which opens the last connection.- Returns:
- the all caller
-
getOpenConnections
Gets the number of open connections.Note: Till 1.4.0 this method was named "getCount()".
- Returns:
- the number of open connections
-
getClosedConnections
Gets the number of closed connections.- Returns:
- the closed connections
- Since:
- 1.4.1
-
getSumOfConnections
Gets the total sum of open and closed connections.- Returns:
- the sum of connections
- Since:
- 1.4.1
-
logCallerStacktraces
Log the caller stacktraces.- Since:
- 1.6.1
-
addMeAsShutdownHook
To be able to register the instance as shutdown hook you can use this (non static) method.- Specified by:
addMeAsShutdownHook
in interfaceShutdownable
- Since:
- 1.6.1
-
removeMeAsShutdownHook
If you want to unregister the instance as shutdown hook you can use this method.- Specified by:
removeMeAsShutdownHook
in interfaceShutdownable
- Since:
- 1.6.1
-
isShutdownHook
@Description("returns true if ConnectionMonitor was registered as shutdown hook") boolean isShutdownHook()Here you can ask if the ConnectionMonitor was already registeres ad shutdown hook.- Specified by:
isShutdownHook
in interfaceShutdownable
- Returns:
- true if it is registered as shutdown hook.
- Since:
- 1.6.1
-