patterntesting.runtime.monitor.db.ConnectionMonitorMBean Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of patterntesting-rt Show documentation
Show all versions of patterntesting-rt Show documentation
PatternTesting Runtime (patterntesting-rt) is the runtime component for
the PatternTesting framework. It provides the annotations and base classes
for the PatternTesting testing framework (e.g. patterntesting-check,
patterntesting-concurrent or patterntesting-exception) but can be also
used standalone for classpath monitoring or profiling.
It uses AOP and AspectJ to perform this feat.
package patterntesting.runtime.monitor.db;
import javax.management.openmbean.*;
import patterntesting.runtime.jmx.Description;
import patterntesting.runtime.monitor.AbstractMonitorMBean;
/**
* This is the interface of {@link 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.
*
*
* @author oliver ([email protected])
* @version $Revision: 1.8 $
* @since 1.3 (02-Jan-2013)
*/
public interface ConnectionMonitorMBean extends AbstractMonitorMBean {
/**
* Gets the caller of all connections.
*
* @return all callers
*/
@Description("get the caller of the open connections")
public StackTraceElement[] getCallers();
/**
* Gets the caller stacktraces of all connections.
*
* @return stacktraces of all callers
* @throws OpenDataException the open data exception
*/
@Description("get the caller of the open connections")
public TabularData getCallerStacktraces() throws OpenDataException;
/**
* Gets the caller which opens the last connection.
*
* @return the all caller
*/
@Description("get the caller of the last open connection")
public StackTraceElement getLastCaller();
/**
* Gets the stacktrace of the caller which opens the last connection.
*
* @return the all caller
*/
@Description("get the call stacktrace of the last open connection")
public StackTraceElement[] getLastCallerStacktrace();
/**
* Gets the number of open connections.
*
* Note: Till 1.4.0 this method was named "getCount()".
*
*
* @return the number of open connections
*/
@Description("get the number of open connections")
public int getOpenConnections();
/**
* Gets the number of closed connections.
*
* @return the closed connections
* @since 1.4.1
*/
@Description("get the number of closed connections")
public int getClosedConnections();
/**
* Gets the total sum of open and closed connections.
*
* @return the sum of connections
* @since 1.4.1
*/
@Description("get the total sum of open and closed connections")
public int getSumOfConnections();
/**
* Log the caller stacktraces.
*
* @since 1.6.1
*/
@Description("log the caller stacktraces")
void logCallerStacktraces();
/**
* To be able to register the instance as shutdown hook you can use this
* (non static) method.
*
* @since 1.6.1
*/
@Description("to register ConnectionMonitor as shutdown hook")
void addMeAsShutdownHook();
/**
* If you want to unregister the instance as shutdown hook you can use this
* method.
*
* @since 1.6.1
*/
@Description("to de-register ConnectionMonitor as shutdown hook")
void removeMeAsShutdownHook();
/**
* Here you can ask if the ConnectionMonitor was already registeres ad
* shutdown hook.
*
* @return true if it is registered as shutdown hook.
* @since 1.6.1
*/
@Description("returns true if ConnectionMonitor was registered as shutdown hook")
boolean isShutdownHook();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy