|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectpatterntesting.runtime.monitor.db.ConnectionMonitor
public class ConnectionMonitor
This is the monitor class for the ProxyConnection which monitors the
different newInstance() and close() call. So you can ask this class how many
and which connections are open.
The instance of this class is automatically registered as MBean as soon as a
ProxyConnection is used.
Note: Since 1.4.2 this class was moved from package "patterntesting.runtime.db" to here.
| Constructor Summary | |
|---|---|
protected |
ConnectionMonitor()
No need to instantiate it - we provide only some services. |
| Method Summary | |
|---|---|
static void |
addConnection(ProxyConnection proxyConnection)
Adds the connection. |
static void |
assertConnectionsClosed()
Assert that all connections are closed. |
static StackTraceElement |
getCallerOf(Connection connection)
Gets the caller of the given connection. |
StackTraceElement[] |
getCallers()
Gets the callers. |
TabularData |
getCallerStacktraces()
Gets the caller stacktraces of all connections. |
int |
getClosedConnections()
Gets the closed connections. |
static ConnectionMonitorMBean |
getInstance()
Yes, it is a Singleton because it offers only some services. |
StackTraceElement |
getLastCaller()
Gets the caller which opens the last connection. |
StackTraceElement[] |
getLastCallerStacktrace()
Gets the stacktrace of the caller which opens the last connection. |
static Connection |
getMonitoredConnection(Connection connection)
If you want to monitor the connection use this method. |
int |
getOpenConnections()
Gets the number of open connections. |
int |
getSumOfConnections()
Gets the total sum of open and closed connections. |
static void |
removeConnection(ProxyConnection proxyConnection)
Removes the connection. |
String |
toString()
To string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected ConnectionMonitor()
| Method Detail |
|---|
public static ConnectionMonitorMBean getInstance()
public static Connection getMonitoredConnection(Connection connection)
connection - the original connection
public static void addConnection(ProxyConnection proxyConnection)
proxyConnection - the proxy connectionpublic static void removeConnection(ProxyConnection proxyConnection)
proxyConnection - the proxy connectionpublic static StackTraceElement getCallerOf(Connection connection)
connection - the connection
public StackTraceElement[] getCallers()
getCallers in interface ConnectionMonitorMBeanConnectionMonitorMBean.getCallers()public StackTraceElement[] getLastCallerStacktrace()
getLastCallerStacktrace in interface ConnectionMonitorMBean
public TabularData getCallerStacktraces()
throws OpenDataException
getCallerStacktraces in interface ConnectionMonitorMBeanOpenDataException - the open data exceptionpublic StackTraceElement getLastCaller()
getLastCaller in interface ConnectionMonitorMBeanpublic int getOpenConnections()
getOpenConnections in interface ConnectionMonitorMBeanConnectionMonitorMBean.getOpenConnections()public int getClosedConnections()
getClosedConnections in interface ConnectionMonitorMBeanpublic int getSumOfConnections()
getSumOfConnections in interface ConnectionMonitorMBeanpublic static void assertConnectionsClosed()
public String toString()
toString in class ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||