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: 1.3.2.5 $
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
 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

public 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

public 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

public 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

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

Returns:
The current setting value.

setSessionFactoryName

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

Parameters:
sessionFactoryName - The new JNDI namespace to use.

getDeployedTreeCacheObjectName

public 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

public 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

public 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

public 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

public 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

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

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

setHbm2ddlAuto

public 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

public 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

public 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

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

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

setUsername

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

Parameters:
username - The new username value.

setPassword

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

Parameters:
password - The new password value.

getSqlCommentsEnabled

public Boolean getSqlCommentsEnabled()
Should sql comments be used?

Returns:
See Also:
Environment.USE_SQL_COMMENTS

setSqlCommentsEnabled

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

Parameters:
commentsEnabled -

getDefaultSchema

public 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

public 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

public 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

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

Parameters:
defaultCatalog - The new default catalog name.

getMaxFetchDepth

public Integer getMaxFetchDepth()
The maximum outer join fetch depth.

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

setMaxFetchDepth

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

Parameters:
maxFetchDepth - The new max fetch depth value

getJdbcBatchSize

public Integer getJdbcBatchSize()
The JDBC batch update batch size.

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

setJdbcBatchSize

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

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

getJdbcFetchSize

public Integer getJdbcFetchSize()
The JDBC fetch size.

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

setJdbcFetchSize

public 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

public Boolean getJdbcScrollableResultSetEnabled()
Are scrollable result sets enabled?

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

setJdbcScrollableResultSetEnabled

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

Parameters:
jdbcScrollableResultSetEnabled - The new value.

getGetGeneratedKeysEnabled

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

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

setGetGeneratedKeysEnabled

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

Parameters:
getGeneratedKeysEnabled - The new value.

getBatchVersionedDataEnabled

public 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

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

Parameters:
batchVersionedDataEnabled -

getStreamsForBinaryEnabled

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

Returns:
See Also:
Environment.USE_STREAMS_FOR_BINARY

setStreamsForBinaryEnabled

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

Parameters:
streamsForBinaryEnabled -

getQuerySubstitutions

public String getQuerySubstitutions()
Query substitutions to use.

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

setQuerySubstitutions

public void setQuerySubstitutions(String querySubstitutions)
Query substitutions to use.

Parameters:
querySubstitutions - The new query substitutions to use

getCacheProviderClass

public 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

public 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

public 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

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

Parameters:
cacheRegionPrefix - The new prefix value.

getMinimalPutsEnabled

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

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

setMinimalPutsEnabled

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

Parameters:
minimalPutsEnabled -

getUseStructuredCacheEntriesEnabled

public 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

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

Parameters:
structuredEntriesEnabled -

getSecondLevelCacheEnabled

public Boolean getSecondLevelCacheEnabled()

setSecondLevelCacheEnabled

public void setSecondLevelCacheEnabled(Boolean secondLevelCacheEnabled)

getQueryCacheEnabled

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

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

setQueryCacheEnabled

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

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

getShowSqlEnabled

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

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

setShowSqlEnabled

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

Parameters:
showSqlEnabled -

getReflectionOptimizationEnabled

public 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

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

Parameters:
reflectionOptimizationEnabled -

getStatGenerationEnabled

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

Returns:
See Also:
Environment.GENERATE_STATISTICS

setStatGenerationEnabled

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

Parameters:
statGenerationEnabled -

getSessionFactoryInterceptor

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

Returns:

setSessionFactoryInterceptor

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

Parameters:
sessionFactoryInterceptor -

getListenerInjector

public String getListenerInjector()
The ListenerInjector implementor class to use.

Returns:

setListenerInjector

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

Parameters:
listenerInjector -

isDirty

public 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

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

Returns:

getVersion

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

Returns:

getInstance

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

Returns:
The managed session factory.

getRunningSince

public 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.

rebuildSessionFactory

public 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.