Package org.h2.jmx
Class DatabaseInfo
java.lang.Object
org.h2.jmx.DatabaseInfo
- All Implemented Interfaces:
DatabaseInfoMBean
The MBean implementation.
-
Method Summary
Modifier and TypeMethodDescriptionintThe current cache size in KB.intThe maximum cache size in KB.longThe file read count since the database was opened.longThe database file size in KB.longThe number of write operations since the database was opened.getMode()The database compatibility mode (REGULAR if no compatibility mode is used).intThe trace level (0 disabled, 1 error, 2 info, 3 debug).The database version.booleanIs the database open in exclusive mode?booleanIs the database read-only?List sessions, including the queries that are in progress, and locked tables.List the database settings.static voidregisterMBean(ConnectionInfo connectionInfo, Database database) Registers an MBean for the database.voidsetCacheSizeMax(int kb) Change the maximum size.voidsetTraceLevel(int level) Set the trace level.static voidunregisterMBean(String name) Unregisters the MBean for the database if one is registered.
-
Method Details
-
registerMBean
public static void registerMBean(ConnectionInfo connectionInfo, Database database) throws JMException Registers an MBean for the database.- Parameters:
connectionInfo- connection infodatabase- database- Throws:
JMException- on failure
-
unregisterMBean
Unregisters the MBean for the database if one is registered.- Parameters:
name- database name- Throws:
JMException- on failureException
-
isExclusive
public boolean isExclusive()Description copied from interface:DatabaseInfoMBeanIs the database open in exclusive mode?- Specified by:
isExclusivein interfaceDatabaseInfoMBean- Returns:
- true if the database is open in exclusive mode, false otherwise
-
isReadOnly
public boolean isReadOnly()Description copied from interface:DatabaseInfoMBeanIs the database read-only?- Specified by:
isReadOnlyin interfaceDatabaseInfoMBean- Returns:
- true if the database is read-only, false otherwise
-
getMode
Description copied from interface:DatabaseInfoMBeanThe database compatibility mode (REGULAR if no compatibility mode is used).- Specified by:
getModein interfaceDatabaseInfoMBean- Returns:
- the database mode
-
getTraceLevel
public int getTraceLevel()Description copied from interface:DatabaseInfoMBeanThe trace level (0 disabled, 1 error, 2 info, 3 debug).- Specified by:
getTraceLevelin interfaceDatabaseInfoMBean- Returns:
- the level
-
setTraceLevel
public void setTraceLevel(int level) Description copied from interface:DatabaseInfoMBeanSet the trace level.- Specified by:
setTraceLevelin interfaceDatabaseInfoMBean- Parameters:
level- the new value
-
getFileWriteCount
public long getFileWriteCount()Description copied from interface:DatabaseInfoMBeanThe number of write operations since the database was opened.- Specified by:
getFileWriteCountin interfaceDatabaseInfoMBean- Returns:
- the write count
-
getFileReadCount
public long getFileReadCount()Description copied from interface:DatabaseInfoMBeanThe file read count since the database was opened.- Specified by:
getFileReadCountin interfaceDatabaseInfoMBean- Returns:
- the read count
-
getFileSize
public long getFileSize()Description copied from interface:DatabaseInfoMBeanThe database file size in KB.- Specified by:
getFileSizein interfaceDatabaseInfoMBean- Returns:
- the number of pages
-
getCacheSizeMax
public int getCacheSizeMax()Description copied from interface:DatabaseInfoMBeanThe maximum cache size in KB.- Specified by:
getCacheSizeMaxin interfaceDatabaseInfoMBean- Returns:
- the maximum size
-
setCacheSizeMax
public void setCacheSizeMax(int kb) Description copied from interface:DatabaseInfoMBeanChange the maximum size.- Specified by:
setCacheSizeMaxin interfaceDatabaseInfoMBean- Parameters:
kb- the cache size in KB.
-
getCacheSize
public int getCacheSize()Description copied from interface:DatabaseInfoMBeanThe current cache size in KB.- Specified by:
getCacheSizein interfaceDatabaseInfoMBean- Returns:
- the current size
-
getVersion
Description copied from interface:DatabaseInfoMBeanThe database version.- Specified by:
getVersionin interfaceDatabaseInfoMBean- Returns:
- the version
-
listSettings
Description copied from interface:DatabaseInfoMBeanList the database settings.- Specified by:
listSettingsin interfaceDatabaseInfoMBean- Returns:
- the database settings
-
listSessions
Description copied from interface:DatabaseInfoMBeanList sessions, including the queries that are in progress, and locked tables.- Specified by:
listSessionsin interfaceDatabaseInfoMBean- Returns:
- information about the sessions
-