Top Description Fields Constructors Methods
org.h2.jmx

public Class DatabaseInfo

extends Object
implements DatabaseInfoMBean
Class Inheritance
All Implemented Interfaces
org.h2.jmx.DatabaseInfoMBean
Imports
java.lang.management.ManagementFactory, java.util.HashMap, .Hashtable, .Map, .Map.Entry, javax.management.JMException, .MBeanServer, .ObjectName, org.h2.command.Command, org.h2.engine.ConnectionInfo, .Constants, .Database, .SessionLocal, org.h2.table.Table, org.h2.util.NetworkConnectionInfo

The MBean implementation.
Authors
Eric Dong, Thomas Mueller

Field Summary

Modifier and TypeField and Description
private final Database
database

Database.

private static final Map<String, ObjectName>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
getCacheSize()

Implements org.h2.jmx.DatabaseInfoMBean.getCacheSize.

The current cache size in KB.

public int
getCacheSizeMax()

Implements org.h2.jmx.DatabaseInfoMBean.getCacheSizeMax.

The maximum cache size in KB.

public long
getFileReadCount()

Implements org.h2.jmx.DatabaseInfoMBean.getFileReadCount.

The file read count since the database was opened.

public long
getFileSize()

Implements org.h2.jmx.DatabaseInfoMBean.getFileSize.

The database file size in KB.

public long
getFileWriteCount()

Implements org.h2.jmx.DatabaseInfoMBean.getFileWriteCount.

The number of write operations since the database was opened.

public String
getMode()

Implements org.h2.jmx.DatabaseInfoMBean.getMode.

The database compatibility mode (REGULAR if no compatibility mode is used).

private static ObjectName

Returns:

a new ObjectName instance
getObjectName
(String
name of the MBean
name
,
String
the path
path
)

Returns a JMX new ObjectName instance.

public int
getTraceLevel()

Implements org.h2.jmx.DatabaseInfoMBean.getTraceLevel.

The trace level (0 disabled, 1 error, 2 info, 3 debug).

public String
getVersion()

Implements org.h2.jmx.DatabaseInfoMBean.getVersion.

The database version.

public boolean
isExclusive()

Implements org.h2.jmx.DatabaseInfoMBean.isExclusive.

Is the database open in exclusive mode?

public boolean
isReadOnly()

Implements org.h2.jmx.DatabaseInfoMBean.isReadOnly.

Is the database read-only?

public String
listSessions()

Implements org.h2.jmx.DatabaseInfoMBean.listSessions.

List sessions, including the queries that are in progress, and locked tables.

public String
listSettings()

Implements org.h2.jmx.DatabaseInfoMBean.listSettings.

List the database settings.

public static void
registerMBean(ConnectionInfo
connection info
connectionInfo
,
Database
database
database
)

Registers an MBean for the database.

public void
setCacheSizeMax(int
the cache size in KB.
kb
)

Implements org.h2.jmx.DatabaseInfoMBean.setCacheSizeMax.

Change the maximum size.

public void
setTraceLevel(int
the new value
level
)

Implements org.h2.jmx.DatabaseInfoMBean.setTraceLevel.

Set the trace level.

public static void
unregisterMBean(String
database name
name
)

Unregisters the MBean for the database if one is registered.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databaseback to summary
private final Database database

Database.

MBEANSback to summary
private static final Map<String, ObjectName> MBEANS

Constructor Detail

DatabaseInfoback to summary
private DatabaseInfo(Database database)

Method Detail

getCacheSizeback to summary
public int getCacheSize()

Implements org.h2.jmx.DatabaseInfoMBean.getCacheSize.

Doc from org.h2.jmx.DatabaseInfoMBean.getCacheSize.

The current cache size in KB.

Returns:int

the current size

Annotations
@Override
getCacheSizeMaxback to summary
public int getCacheSizeMax()

Implements org.h2.jmx.DatabaseInfoMBean.getCacheSizeMax.

Doc from org.h2.jmx.DatabaseInfoMBean.getCacheSizeMax.

The maximum cache size in KB.

Returns:int

the maximum size

Annotations
@Override
getFileReadCountback to summary
public long getFileReadCount()

Implements org.h2.jmx.DatabaseInfoMBean.getFileReadCount.

Doc from org.h2.jmx.DatabaseInfoMBean.getFileReadCount.

The file read count since the database was opened.

Returns:long

the read count

Annotations
@Override
getFileSizeback to summary
public long getFileSize()

Implements org.h2.jmx.DatabaseInfoMBean.getFileSize.

Doc from org.h2.jmx.DatabaseInfoMBean.getFileSize.

The database file size in KB.

Returns:long

the number of pages

Annotations
@Override
getFileWriteCountback to summary
public long getFileWriteCount()

Implements org.h2.jmx.DatabaseInfoMBean.getFileWriteCount.

Doc from org.h2.jmx.DatabaseInfoMBean.getFileWriteCount.

The number of write operations since the database was opened.

Returns:long

the write count

Annotations
@Override
getModeback to summary
public String getMode()

Implements org.h2.jmx.DatabaseInfoMBean.getMode.

Doc from org.h2.jmx.DatabaseInfoMBean.getMode.

The database compatibility mode (REGULAR if no compatibility mode is used).

Returns:String

the database mode

Annotations
@Override
getObjectNameback to summary
private static ObjectName getObjectName(String name, String path) throws JMException

Returns a JMX new ObjectName instance.

Parameters
name:String

name of the MBean

path:String

the path

Returns:ObjectName

a new ObjectName instance

Exceptions
JMException:
if the ObjectName could not be created
getTraceLevelback to summary
public int getTraceLevel()

Implements org.h2.jmx.DatabaseInfoMBean.getTraceLevel.

Doc from org.h2.jmx.DatabaseInfoMBean.getTraceLevel.

The trace level (0 disabled, 1 error, 2 info, 3 debug).

Returns:int

the level

Annotations
@Override
getVersionback to summary
public String getVersion()

Implements org.h2.jmx.DatabaseInfoMBean.getVersion.

Doc from org.h2.jmx.DatabaseInfoMBean.getVersion.

The database version.

Returns:String

the version

Annotations
@Override
isExclusiveback to summary
public boolean isExclusive()

Implements org.h2.jmx.DatabaseInfoMBean.isExclusive.

Doc from org.h2.jmx.DatabaseInfoMBean.isExclusive.

Is the database open in exclusive mode?

Returns:boolean

true if the database is open in exclusive mode, false otherwise

Annotations
@Override
isReadOnlyback to summary
public boolean isReadOnly()

Implements org.h2.jmx.DatabaseInfoMBean.isReadOnly.

Doc from org.h2.jmx.DatabaseInfoMBean.isReadOnly.

Is the database read-only?

Returns:boolean

true if the database is read-only, false otherwise

Annotations
@Override
listSessionsback to summary
public String listSessions()

Implements org.h2.jmx.DatabaseInfoMBean.listSessions.

Doc from org.h2.jmx.DatabaseInfoMBean.listSessions.

List sessions, including the queries that are in progress, and locked tables.

Returns:String

information about the sessions

Annotations
@Override
listSettingsback to summary
public String listSettings()

Implements org.h2.jmx.DatabaseInfoMBean.listSettings.

Doc from org.h2.jmx.DatabaseInfoMBean.listSettings.

List the database settings.

Returns:String

the database settings

Annotations
@Override
registerMBeanback to summary
public static void registerMBean(ConnectionInfo connectionInfo, Database database) throws JMException

Registers an MBean for the database.

Parameters
connectionInfo:ConnectionInfo

connection info

database:Database

database

Exceptions
JMException:
on failure
setCacheSizeMaxback to summary
public void setCacheSizeMax(int kb)

Implements org.h2.jmx.DatabaseInfoMBean.setCacheSizeMax.

Doc from org.h2.jmx.DatabaseInfoMBean.setCacheSizeMax.

Change the maximum size.

Parameters
kb:int

the cache size in KB.

Annotations
@Override
setTraceLevelback to summary
public void setTraceLevel(int level)

Implements org.h2.jmx.DatabaseInfoMBean.setTraceLevel.

Doc from org.h2.jmx.DatabaseInfoMBean.setTraceLevel.

Set the trace level.

Parameters
level:int

the new value

Annotations
@Override
unregisterMBeanback to summary
public static void unregisterMBean(String name) throws Exception

Unregisters the MBean for the database if one is registered.

Parameters
name:String

database name

Exceptions
JMException:
on failure