Package org.h2.jmx

Class DatabaseInfo

java.lang.Object
org.h2.jmx.DatabaseInfo
All Implemented Interfaces:
DatabaseInfoMBean

public class DatabaseInfo extends Object implements DatabaseInfoMBean
The MBean implementation.
  • Field Details

  • Constructor Details

    • DatabaseInfo

      private DatabaseInfo(Database database)
  • Method Details

    • getObjectName

      private static ObjectName getObjectName(String name, String path) throws JMException
      Returns a JMX new ObjectName instance.
      Parameters:
      name - name of the MBean
      path - the path
      Returns:
      a new ObjectName instance
      Throws:
      JMException - if the ObjectName could not be created
    • registerMBean

      public static void registerMBean(ConnectionInfo connectionInfo, Database database) throws JMException
      Registers an MBean for the database.
      Parameters:
      connectionInfo - connection info
      database - database
      Throws:
      JMException - on failure
    • unregisterMBean

      public static void unregisterMBean(String name) throws Exception
      Unregisters the MBean for the database if one is registered.
      Parameters:
      name - database name
      Throws:
      JMException - on failure
      Exception
    • isExclusive

      public boolean isExclusive()
      Description copied from interface: DatabaseInfoMBean
      Is the database open in exclusive mode?
      Specified by:
      isExclusive in interface DatabaseInfoMBean
      Returns:
      true if the database is open in exclusive mode, false otherwise
    • isReadOnly

      public boolean isReadOnly()
      Description copied from interface: DatabaseInfoMBean
      Is the database read-only?
      Specified by:
      isReadOnly in interface DatabaseInfoMBean
      Returns:
      true if the database is read-only, false otherwise
    • getMode

      public String getMode()
      Description copied from interface: DatabaseInfoMBean
      The database compatibility mode (REGULAR if no compatibility mode is used).
      Specified by:
      getMode in interface DatabaseInfoMBean
      Returns:
      the database mode
    • getTraceLevel

      public int getTraceLevel()
      Description copied from interface: DatabaseInfoMBean
      The trace level (0 disabled, 1 error, 2 info, 3 debug).
      Specified by:
      getTraceLevel in interface DatabaseInfoMBean
      Returns:
      the level
    • setTraceLevel

      public void setTraceLevel(int level)
      Description copied from interface: DatabaseInfoMBean
      Set the trace level.
      Specified by:
      setTraceLevel in interface DatabaseInfoMBean
      Parameters:
      level - the new value
    • getFileWriteCount

      public long getFileWriteCount()
      Description copied from interface: DatabaseInfoMBean
      The number of write operations since the database was opened.
      Specified by:
      getFileWriteCount in interface DatabaseInfoMBean
      Returns:
      the write count
    • getFileReadCount

      public long getFileReadCount()
      Description copied from interface: DatabaseInfoMBean
      The file read count since the database was opened.
      Specified by:
      getFileReadCount in interface DatabaseInfoMBean
      Returns:
      the read count
    • getFileSize

      public long getFileSize()
      Description copied from interface: DatabaseInfoMBean
      The database file size in KB.
      Specified by:
      getFileSize in interface DatabaseInfoMBean
      Returns:
      the number of pages
    • getCacheSizeMax

      public int getCacheSizeMax()
      Description copied from interface: DatabaseInfoMBean
      The maximum cache size in KB.
      Specified by:
      getCacheSizeMax in interface DatabaseInfoMBean
      Returns:
      the maximum size
    • setCacheSizeMax

      public void setCacheSizeMax(int kb)
      Description copied from interface: DatabaseInfoMBean
      Change the maximum size.
      Specified by:
      setCacheSizeMax in interface DatabaseInfoMBean
      Parameters:
      kb - the cache size in KB.
    • getCacheSize

      public int getCacheSize()
      Description copied from interface: DatabaseInfoMBean
      The current cache size in KB.
      Specified by:
      getCacheSize in interface DatabaseInfoMBean
      Returns:
      the current size
    • getVersion

      public String getVersion()
      Description copied from interface: DatabaseInfoMBean
      The database version.
      Specified by:
      getVersion in interface DatabaseInfoMBean
      Returns:
      the version
    • listSettings

      public String listSettings()
      Description copied from interface: DatabaseInfoMBean
      List the database settings.
      Specified by:
      listSettings in interface DatabaseInfoMBean
      Returns:
      the database settings
    • listSessions

      public String listSessions()
      Description copied from interface: DatabaseInfoMBean
      List sessions, including the queries that are in progress, and locked tables.
      Specified by:
      listSessions in interface DatabaseInfoMBean
      Returns:
      information about the sessions