org.jboss.hibernate.jmx
Interface HibernateMBean

All Superinterfaces:
javax.management.MBeanRegistration, org.jboss.system.Service, org.jboss.system.ServiceMBean
All Known Implementing Classes:
Hibernate

public interface HibernateMBean
extends org.jboss.system.ServiceMBean, javax.management.MBeanRegistration

Describes a Hibernate service MBean. Configures a SessionFactory instance and exposes it through JNDI. The SessionFactory is built through either

Version:
$Revision: 57193 $
Author:
Alexey Loubyansky, Gavin King, Steve Ebersole, Dimitris Andreadis

Field Summary
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Method Summary
 void createSchema()
          Export the CREATE DDL to the database
 void dropSchema()
          Export the DROP DDL to the database
 Boolean getBatchVersionedDataEnabled()
          Should Hibernate allow JDBC batch-updating of versioned entities?

Many drivers have bugs regarding the row counts returned in response to JDBC Batch API operations; in these cases, this should definitely be set to false.

 String getCacheProviderClass()
          The name of the CacheProvider implementation class to use for second level caching.
 String getCacheRegionPrefix()
          The prefix to use for this session factory within the second level cache.
 String getDatasourceName()
          The JNDI namespace of the DataSource which should be used by the managed SessionFactory.
 String getDefaultCatalog()
          The default database catalog to use within the database being mapped.
 String getDefaultSchema()
          The default database schema to use within the database being mapped.
 javax.management.ObjectName getDeployedTreeCacheObjectName()
          The JMX name of a TreeCache MBean to be used as the second level cache.
 String getDialect()
          The name of the dialect class to use for communicating with the database.
 Boolean getGetGeneratedKeysEnabled()
          Is the use of JDBC3 getGeneratedKeys() enabled?
 URL getHarUrl()
          The url to the har deployment, if MBean is operating in har deployment mode.
 String getHbm2ddlAuto()
          The form, if any, of schema generation which should be used.
 org.hibernate.SessionFactory getInstance()
          Exposes the internally managed session factory via a read-only JMX managed attribute.
 Integer getJdbcBatchSize()
          The JDBC batch update batch size.
 Integer getJdbcFetchSize()
          The JDBC fetch size.
 Boolean getJdbcScrollableResultSetEnabled()
          Are scrollable result sets enabled?
 String getListenerInjector()
          The ListenerInjector implementor class to use.
 Integer getMaxFetchDepth()
          The maximum outer join fetch depth.
 Boolean getMinimalPutsEnabled()
          Should minimal puts be enabled against the given cache provider?
 Boolean getQueryCacheEnabled()
          Is use of the query cache enabled?
 String getQuerySubstitutions()
          Query substitutions to use.
 Boolean getReflectionOptimizationEnabled()
          Should Hibernate use cglib-based reflection optimizations?

Note : this may or may not improve performance based on the JVM you are using.

 Date getRunningSince()
          The date and time since which the currently managed SessionFactory has been running.
 Boolean getSecondLevelCacheEnabled()
           
 String getSessionFactoryInterceptor()
          The name of an Interceptor impl class to be attached to the managed SessionFactory.
 String getSessionFactoryName()
          The JNDI namespace where the managed SessionFactory is to be bound.
 Boolean getShowSqlEnabled()
          Should all SQL be shown (dumped to console and logged)?
 Boolean getSqlCommentsEnabled()
          Should sql comments be used?
 Boolean getStatGenerationEnabled()
          Should generation and collection of Hibernate3 statistics be enabled?
 javax.management.ObjectName getStatisticsServiceName()
          Retreive the service name of the managed stats mbean.
 Boolean getStreamsForBinaryEnabled()
          Should Hibernate use I/O streaming for handling binary/LOB data?
 String getUsername()
          The username used to access the specified datasource.
 Boolean getUseStructuredCacheEntriesEnabled()
          Should Hibernate use structured cache entries when putting stuff into the second level cache?

Mainly useful if users wish to directly browse the second level caches as it is easier to see what the cache entries actually represent.

 String getVersion()
          The version Hibernate for the managed SessionFactory.
 boolean isDirty()
          Is this MBean dirty? Meaning, have any changes been made to it that have not yet been propogated to the managed SessionFactory?

Note : the only way to propogate these changes to the SF is by calling the rebuildSessionFactory() managed operation.

 boolean isScanForMappingsEnabled()
          Enables scanning of the entire deployment classpath for any potential mapping sources (jars or directories).
 boolean isSessionFactoryRunning()
          Does this MBean instance have a currently running managed SessionFactory?
 void rebuildSessionFactory()
          A JMX managed operation to rebuild the managed SessionFactory such that any setting changes made can take effect.
 void setBatchVersionedDataEnabled(Boolean batchVersionedDataEnabled)
          Should Hibernate allow JDBC batch-updating of versioned entities?
 void setCacheProviderClass(String cacheProviderClass)
          The name of the CacheProvider implementation class to use for second level caching.
 void setCacheRegionPrefix(String cacheRegionPrefix)
          The prefix to use for this session factory within the second level cache.
 void setDatasourceName(String datasourceName)
          The JNDI namespace of the DataSource which should be used by the managed SessionFactory.
 void setDefaultCatalog(String defaultCatalog)
          The default database catalog to use within the database being mapped.
 void setDefaultSchema(String defaultSchema)
          The default database schema to use within the database being mapped.
 void setDeployedTreeCacheObjectName(javax.management.ObjectName deployedTreeCacheObjectName)
          The JMX name of a TreeCache MBean to be used as the second level cache.
 void setDialect(String dialect)
          The name of the dialect class to use for communicating with the database.
 void setGetGeneratedKeysEnabled(Boolean getGeneratedKeysEnabled)
          Is the use of JDBC3 getGeneratedKeys() enabled?
 void setHbm2ddlAuto(String hbm2ddlAuto)
          The form, if any, of schema generation which should be used.
 void setJdbcBatchSize(Integer jdbcBatchSize)
          The JDBC batch update batch size.
 void setJdbcFetchSize(Integer jdbcFetchSize)
          The JDBC fetch size.
 void setJdbcScrollableResultSetEnabled(Boolean jdbcScrollableResultSetEnabled)
          Are scrollable result sets enabled?
 void setListenerInjector(String listenerInjector)
          The ListenerInjector implementor class to use.
 void setMaxFetchDepth(Integer maxFetchDepth)
          The maximum outer join fetch depth.
 void setMinimalPutsEnabled(Boolean minimalPutsEnabled)
          Should minimal puts be enabled against the given cache provider?
 void setPassword(String password)
          The password used to access the specified datasource.
 void setQueryCacheEnabled(Boolean queryCacheEnabled)
          Is use of the query cache enabled?
 void setQuerySubstitutions(String querySubstitutions)
          Query substitutions to use.
 void setReflectionOptimizationEnabled(Boolean reflectionOptimizationEnabled)
          Should Hibernate use cglib-based reflection optimizations?
 void setScanForMappingsEnabled(boolean scanForMappings)
          Enables scanning of the entire deployment classpath for any potential mapping sources (jars or directories).
 void setSecondLevelCacheEnabled(Boolean secondLevelCacheEnabled)
           
 void setSessionFactoryInterceptor(String sessionFactoryInterceptor)
          The name of an Interceptor impl class to be attached to the managed SessionFactory.
 void setSessionFactoryName(String sessionFactoryName)
          The JNDI namespace where the managed SessionFactory is to be bound.
 void setShowSqlEnabled(Boolean showSqlEnabled)
          Should all SQL be shown (dumped to console and logged)?
 void setSqlCommentsEnabled(Boolean commentsEnabled)
          Should sql comments be used?
 void setStatGenerationEnabled(Boolean statGenerationEnabled)
          Should generation and collection of Hibernate3 statistics be enabled?
 void setStreamsForBinaryEnabled(Boolean streamsForBinaryEnabled)
          Should Hibernate use I/O streaming for handling binary/LOB data?
 void setUsername(String username)
          The username used to access the specified datasource.
 void setUseStructuredCacheEntriesEnabled(Boolean structuredEntriesEnabled)
          Should Hibernate use structured cache entries when putting stuff into the second level cache?
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 
Methods inherited from interface javax.management.MBeanRegistration
postDeregister, postRegister, preDeregister, preRegister
 

Method Detail

getHarUrl

URL getHarUrl()
The url to the har deployment, if MBean is operating in har deployment mode.

Returns:
The url of the har containing this MBean, or null if not part of a har deployment.

isScanForMappingsEnabled

boolean isScanForMappingsEnabled()
Enables scanning of the entire deployment classpath for any potential mapping sources (jars or directories).

Only used in the case of har deployments.

Returns:

setScanForMappingsEnabled

void setScanForMappingsEnabled(boolean scanForMappings)
Enables scanning of the entire deployment classpath for any potential mapping sources (jars or directories).

Only used in the case of har deployments.

Parameters:
scanForMappings -

getSessionFactoryName

String getSessionFactoryName()
The JNDI namespace where the managed SessionFactory is to be bound.

Returns:
The current setting value.

setSessionFactoryName

void setSessionFactoryName(String sessionFactoryName)
The JNDI namespace where the managed SessionFactory is to be bound.

Parameters:
sessionFactoryName - The new JNDI namespace to use.

getDeployedTreeCacheObjectName

javax.management.ObjectName getDeployedTreeCacheObjectName()
The JMX name of a TreeCache MBean to be used as the second level cache.

Note : only used when getCacheProviderClass() == DeployedTreeCacheProvider

Returns:
The current setting

setDeployedTreeCacheObjectName

void setDeployedTreeCacheObjectName(javax.management.ObjectName deployedTreeCacheObjectName)
The JMX name of a TreeCache MBean to be used as the second level cache.

Parameters:
deployedTreeCacheObjectName - The new mbean object name.

getStatisticsServiceName

javax.management.ObjectName getStatisticsServiceName()
Retreive the service name of the managed stats mbean.

When statistics are enabled on the managed session factory, the mbean automatically manages a stats mbean for stats exposure via jmx. This returns the name under which that stats mbean is available from the jmx server.

Returns:
The service name of the stats mbean, or null if stats not enabled.

getDialect

String getDialect()
The name of the dialect class to use for communicating with the database.

Returns:
The current setting value.
See Also:
Environment.DIALECT

setDialect

void setDialect(String dialect)
The name of the dialect class to use for communicating with the database.

Parameters:
dialect - The new dialect class name to use.

getHbm2ddlAuto

String getHbm2ddlAuto()
The form, if any, of schema generation which should be used.

Returns:
The current setting value.
See Also:
Environment.HBM2DDL_AUTO

setHbm2ddlAuto

void setHbm2ddlAuto(String hbm2ddlAuto)
The form, if any, of schema generation which should be used.

Parameters:
hbm2ddlAuto - The new hbm2ddl setting; valid values are: update, create, create-drop

getDatasourceName

String getDatasourceName()
The JNDI namespace of the DataSource which should be used by the managed SessionFactory.

Returns:
The current setting value.
See Also:
Environment.DATASOURCE

setDatasourceName

void setDatasourceName(String datasourceName)
The JNDI namespace of the DataSource which should be used by the managed SessionFactory.

Parameters:
datasourceName - The new DataSource JNDI name to use.

getUsername

String getUsername()
The username used to access the specified datasource.

Returns:
The current setting value.
See Also:
Environment.USER

setUsername

void setUsername(String username)
The username used to access the specified datasource.

Parameters:
username - The new username value.

setPassword

void setPassword(String password)
The password used to access the specified datasource.

Parameters:
password - The new password value.

getSqlCommentsEnabled

Boolean getSqlCommentsEnabled()
Should sql comments be used?

Returns:
See Also:
Environment.USE_SQL_COMMENTS

setSqlCommentsEnabled

void setSqlCommentsEnabled(Boolean commentsEnabled)
Should sql comments be used?

Parameters:
commentsEnabled -

getDefaultSchema

String getDefaultSchema()
The default database schema to use within the database being mapped.

Used for databases which support the concept of schemas instead of catalogs.

Returns:
The current setting value.
See Also:
getDefaultCatalog(), Environment.DEFAULT_SCHEMA

setDefaultSchema

void setDefaultSchema(String defaultSchema)
The default database schema to use within the database being mapped.

Parameters:
defaultSchema - The new default schema name to use.

getDefaultCatalog

String getDefaultCatalog()
The default database catalog to use within the database being mapped.

Used for databases which support the concept of catalogs instead of schemas.

Returns:
The current setting value.
See Also:
getDefaultSchema(), Environment.DEFAULT_CATALOG

setDefaultCatalog

void setDefaultCatalog(String defaultCatalog)
The default database catalog to use within the database being mapped.

Parameters:
defaultCatalog - The new default catalog name.

getMaxFetchDepth

Integer getMaxFetchDepth()
The maximum outer join fetch depth.

Returns:
The current setting value
See Also:
Environment.MAX_FETCH_DEPTH

setMaxFetchDepth

void setMaxFetchDepth(Integer maxFetchDepth)
The maximum outer join fetch depth.

Parameters:
maxFetchDepth - The new max fetch depth value

getJdbcBatchSize

Integer getJdbcBatchSize()
The JDBC batch update batch size.

Returns:
The current setting value
See Also:
Environment.STATEMENT_BATCH_SIZE

setJdbcBatchSize

void setJdbcBatchSize(Integer jdbcBatchSize)
The JDBC batch update batch size.

Parameters:
jdbcBatchSize - The new value for the number of statements to batch together.

getJdbcFetchSize

Integer getJdbcFetchSize()
The JDBC fetch size.

Returns:
The current setting value
See Also:
Environment.STATEMENT_FETCH_SIZE

setJdbcFetchSize

void setJdbcFetchSize(Integer jdbcFetchSize)
The JDBC fetch size.

Parameters:
jdbcFetchSize - The new value for the number of rows to fetch from server at a time.

getJdbcScrollableResultSetEnabled

Boolean getJdbcScrollableResultSetEnabled()
Are scrollable result sets enabled?

Returns:
The current setting value
See Also:
Environment.USE_SCROLLABLE_RESULTSET

setJdbcScrollableResultSetEnabled

void setJdbcScrollableResultSetEnabled(Boolean jdbcScrollableResultSetEnabled)
Are scrollable result sets enabled?

Parameters:
jdbcScrollableResultSetEnabled - The new value.

getGetGeneratedKeysEnabled

Boolean getGetGeneratedKeysEnabled()
Is the use of JDBC3 getGeneratedKeys() enabled?

Returns:
The current setting value
See Also:
Environment.USE_GET_GENERATED_KEYS

setGetGeneratedKeysEnabled

void setGetGeneratedKeysEnabled(Boolean getGeneratedKeysEnabled)
Is the use of JDBC3 getGeneratedKeys() enabled?

Parameters:
getGeneratedKeysEnabled - The new value.

getBatchVersionedDataEnabled

Boolean getBatchVersionedDataEnabled()
Should Hibernate allow JDBC batch-updating of versioned entities?

Many drivers have bugs regarding the row counts returned in response to JDBC Batch API operations; in these cases, this should definitely be set to false.

Returns:
The current setting value
See Also:
Environment.BATCH_VERSIONED_DATA

setBatchVersionedDataEnabled

void setBatchVersionedDataEnabled(Boolean batchVersionedDataEnabled)
Should Hibernate allow JDBC batch-updating of versioned entities?

Parameters:
batchVersionedDataEnabled -

getStreamsForBinaryEnabled

Boolean getStreamsForBinaryEnabled()
Should Hibernate use I/O streaming for handling binary/LOB data?

Returns:
See Also:
Environment.USE_STREAMS_FOR_BINARY

setStreamsForBinaryEnabled

void setStreamsForBinaryEnabled(Boolean streamsForBinaryEnabled)
Should Hibernate use I/O streaming for handling binary/LOB data?

Parameters:
streamsForBinaryEnabled -

getQuerySubstitutions

String getQuerySubstitutions()
Query substitutions to use.

Returns:
The current setting value
See Also:
Environment.QUERY_SUBSTITUTIONS

setQuerySubstitutions

void setQuerySubstitutions(String querySubstitutions)
Query substitutions to use.

Parameters:
querySubstitutions - The new query substitutions to use

getCacheProviderClass

String getCacheProviderClass()
The name of the CacheProvider implementation class to use for second level caching.

Returns:
The current setting value
See Also:
Environment.CACHE_PROVIDER

setCacheProviderClass

void setCacheProviderClass(String cacheProviderClass)
The name of the CacheProvider implementation class to use for second level caching.

Parameters:
cacheProviderClass - The new provider impl class name.

getCacheRegionPrefix

String getCacheRegionPrefix()
The prefix to use for this session factory within the second level cache.

Returns:
The current setting value
See Also:
Environment.CACHE_NAMESPACE

setCacheRegionPrefix

void setCacheRegionPrefix(String cacheRegionPrefix)
The prefix to use for this session factory within the second level cache.

Parameters:
cacheRegionPrefix - The new prefix value.

getMinimalPutsEnabled

Boolean getMinimalPutsEnabled()
Should minimal puts be enabled against the given cache provider?

Returns:
The current setting value
See Also:
Environment.USE_MINIMAL_PUTS

setMinimalPutsEnabled

void setMinimalPutsEnabled(Boolean minimalPutsEnabled)
Should minimal puts be enabled against the given cache provider?

Parameters:
minimalPutsEnabled -

getUseStructuredCacheEntriesEnabled

Boolean getUseStructuredCacheEntriesEnabled()
Should Hibernate use structured cache entries when putting stuff into the second level cache?

Mainly useful if users wish to directly browse the second level caches as it is easier to see what the cache entries actually represent.

Returns:
See Also:
Environment.USE_STRUCTURED_CACHE

setUseStructuredCacheEntriesEnabled

void setUseStructuredCacheEntriesEnabled(Boolean structuredEntriesEnabled)
Should Hibernate use structured cache entries when putting stuff into the second level cache?

Parameters:
structuredEntriesEnabled -

getSecondLevelCacheEnabled

Boolean getSecondLevelCacheEnabled()

setSecondLevelCacheEnabled

void setSecondLevelCacheEnabled(Boolean secondLevelCacheEnabled)

getQueryCacheEnabled

Boolean getQueryCacheEnabled()
Is use of the query cache enabled?

Returns:
The current setting value
See Also:
Environment.USE_QUERY_CACHE

setQueryCacheEnabled

void setQueryCacheEnabled(Boolean queryCacheEnabled)
Is use of the query cache enabled?

Parameters:
queryCacheEnabled - The new value of whether or not to enable.

getShowSqlEnabled

Boolean getShowSqlEnabled()
Should all SQL be shown (dumped to console and logged)?

Returns:
The current setting value
See Also:
Environment.SHOW_SQL

setShowSqlEnabled

void setShowSqlEnabled(Boolean showSqlEnabled)
Should all SQL be shown (dumped to console and logged)?

Parameters:
showSqlEnabled -

getReflectionOptimizationEnabled

Boolean getReflectionOptimizationEnabled()
Should Hibernate use cglib-based reflection optimizations?

Note : this may or may not improve performance based on the JVM you are using.

Returns:
See Also:
Environment.USE_REFLECTION_OPTIMIZER

setReflectionOptimizationEnabled

void setReflectionOptimizationEnabled(Boolean reflectionOptimizationEnabled)
Should Hibernate use cglib-based reflection optimizations?

Parameters:
reflectionOptimizationEnabled -

getStatGenerationEnabled

Boolean getStatGenerationEnabled()
Should generation and collection of Hibernate3 statistics be enabled?

Returns:
See Also:
Environment.GENERATE_STATISTICS

setStatGenerationEnabled

void setStatGenerationEnabled(Boolean statGenerationEnabled)
Should generation and collection of Hibernate3 statistics be enabled?

Parameters:
statGenerationEnabled -

getSessionFactoryInterceptor

String getSessionFactoryInterceptor()
The name of an Interceptor impl class to be attached to the managed SessionFactory.

Returns:

setSessionFactoryInterceptor

void setSessionFactoryInterceptor(String sessionFactoryInterceptor)
The name of an Interceptor impl class to be attached to the managed SessionFactory.

Parameters:
sessionFactoryInterceptor -

getListenerInjector

String getListenerInjector()
The ListenerInjector implementor class to use.

Returns:

setListenerInjector

void setListenerInjector(String listenerInjector)
The ListenerInjector implementor class to use.

Parameters:
listenerInjector -

isDirty

boolean isDirty()
Is this MBean dirty? Meaning, have any changes been made to it that have not yet been propogated to the managed SessionFactory?

Note : the only way to propogate these changes to the SF is by calling the rebuildSessionFactory() managed operation.

Returns:

isSessionFactoryRunning

boolean isSessionFactoryRunning()
Does this MBean instance have a currently running managed SessionFactory?

Returns:

getVersion

String getVersion()
The version Hibernate for the managed SessionFactory.

Returns:

getInstance

org.hibernate.SessionFactory getInstance()
Exposes the internally managed session factory via a read-only JMX managed attribute.

Returns:
The managed session factory.

getRunningSince

Date getRunningSince()
The date and time since which the currently managed SessionFactory has been running.

Returns:
The date and time the current SessionFactory was started.

createSchema

void createSchema()
                  throws Exception
Export the CREATE DDL to the database

Throws:
Exception

dropSchema

void dropSchema()
                throws Exception
Export the DROP DDL to the database

Throws:
Exception

rebuildSessionFactory

void rebuildSessionFactory()
                           throws Exception
A JMX managed operation to rebuild the managed SessionFactory such that any setting changes made can take effect.

Throws:
Exception


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.