Interface ConnectionMonitorMBean

All Superinterfaces:
AbstractMonitorMBean, Runnable, Shutdownable
All Known Implementing Classes:
ConnectionMonitor

public interface ConnectionMonitorMBean extends AbstractMonitorMBean
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 Details

    • getCallers

      @Description("get the caller of the open connections") StackTraceElement[] getCallers()
      Gets the caller of all connections.
      Returns:
      all callers
    • getCallerStacktraces

      @Description("get the caller of the open connections") TabularData getCallerStacktraces() throws OpenDataException
      Gets the caller stacktraces of all connections.
      Returns:
      stacktraces of all callers
      Throws:
      OpenDataException - the open data exception
    • getLastCaller

      @Description("get the caller of the last open connection") StackTraceElement 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

      @Description("get the number of open connections") int getOpenConnections()
      Gets the number of open connections.

      Note: Till 1.4.0 this method was named "getCount()".

      Returns:
      the number of open connections
    • getClosedConnections

      @Description("get the number of closed connections") int getClosedConnections()
      Gets the number of closed connections.
      Returns:
      the closed connections
      Since:
      1.4.1
    • getSumOfConnections

      @Description("get the total sum of open and closed connections") int getSumOfConnections()
      Gets the total sum of open and closed connections.
      Returns:
      the sum of connections
      Since:
      1.4.1
    • logCallerStacktraces

      @Description("log the caller stacktraces") void logCallerStacktraces()
      Log the caller stacktraces.
      Since:
      1.6.1
    • addMeAsShutdownHook

      @Description("to register ConnectionMonitor as shutdown hook") void addMeAsShutdownHook()
      To be able to register the instance as shutdown hook you can use this (non static) method.
      Specified by:
      addMeAsShutdownHook in interface Shutdownable
      Since:
      1.6.1
    • removeMeAsShutdownHook

      @Description("to de-register ConnectionMonitor as shutdown hook") void removeMeAsShutdownHook()
      If you want to unregister the instance as shutdown hook you can use this method.
      Specified by:
      removeMeAsShutdownHook in interface Shutdownable
      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 interface Shutdownable
      Returns:
      true if it is registered as shutdown hook.
      Since:
      1.6.1