001    package patterntesting.runtime.monitor.db;
002    
003    import javax.management.openmbean.*;
004    
005    import patterntesting.runtime.jmx.Description;
006    
007    /**
008     * This is the interface for the {@link ConnectionMonitor} for the use of this
009     * class as MBean. You can monitor DB connections with it and ask the class for
010     * open connections.
011     * <p>
012     * Note: Since 1.4.2 this class was moved from package
013     * "patterntesting.runtime.db" to here.
014     * </p>
015     *
016     * @author oliver (ob@aosd.de)
017     * @since 1.3 (02-Jan-2013)
018     * @version $Revision: 1.3 $
019     */
020    public interface ConnectionMonitorMBean {
021    
022        /**
023         * Gets the caller of all connections.
024         *
025         * @return all callers
026         */
027        @Description("get the caller of the open connections")
028        public abstract StackTraceElement[] getCallers();
029    
030        /**
031         * Gets the caller stacktraces of all connections.
032         *
033         * @return stacktraces of all callers
034         * @throws OpenDataException the open data exception
035         */
036        @Description("get the caller of the open connections")
037        public abstract TabularData getCallerStacktraces() throws OpenDataException;
038    
039        /**
040         * Gets the caller which opens the last connection.
041         *
042         * @return the all caller
043         */
044        @Description("get the caller of the last open connection")
045        public abstract StackTraceElement getLastCaller();
046    
047    
048        /**
049         * Gets the stacktrace of the caller which opens the last connection.
050         *
051         * @return the all caller
052         */
053        @Description("get the call stacktrace of the last open connection")
054        public abstract StackTraceElement[] getLastCallerStacktrace();
055    
056        /**
057         * Gets the number of open connections.
058         * <p>
059         * Note: Till 1.4.0 this method was named "getCount()".
060         * </p>
061         *
062         * @return the number of open connections
063         */
064        @Description("get the number of open connections")
065        public abstract int getOpenConnections();
066    
067        /**
068         * Gets the closed connections.
069         *
070         * @return the closed connections
071         * @since 1.4.1
072         */
073        @Description("get the number of closed connections")
074        public abstract int getClosedConnections();
075    
076        /**
077         * Gets the total sum of open and closed connections.
078         *
079         * @return the sum of connections
080         * @since 1.4.1
081         */
082        @Description("get the total sum of open and closed connections")
083        public abstract int getSumOfConnections();
084    
085    }