Top Description Fields Constructors Methods
org.hibernate.jmx

public Class HibernateService

extends ExternalSessionFactoryConfig
implements HibernateServiceMBean
Class Inheritance
All Implemented Interfaces
org.hibernate.jmx.HibernateServiceMBean
Imports
java.util.Properties, .Map, javax.naming.InitialContext, org.slf4j.Logger, .LoggerFactory, org.hibernate.HibernateException, .SessionFactory, org.hibernate.cfg.Environment, org.hibernate.tool.hbm2ddl.SchemaExport, org.hibernate.util.NamingHelper, .ExternalSessionFactoryConfig

Implementation of HibernateServiceMBean. Creates a SessionFactory and binds it to the specified JNDI name.

All mapping documents are loaded as resources by the MBean.
Author
John Urberg, Gavin King
See Also
HibernateServiceMBean, org.hibernate.SessionFactory

Field Summary

Modifier and TypeField and Description
private String
private static final Logger
private Properties

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv SessionFactory
public void
createSchema()

Implements org.hibernate.jmx.HibernateServiceMBean.createSchema.

Export the CREATE DDL to the database
public void
dropSchema()

Implements org.hibernate.jmx.HibernateServiceMBean.dropSchema.

Export the DROP DDL to the database
public String
public String
getDatasource()

Implements org.hibernate.jmx.HibernateServiceMBean.getDatasource.

The JNDI name of the datasource to use in this SessionFactory
protected Map<K, V>
public String
public String
getJndiName()

Implements org.hibernate.jmx.HibernateServiceMBean.getJndiName.

The JNDI name to bind to the SessionFactory
public String
public String
getPassword()

Implements org.hibernate.jmx.HibernateServiceMBean.getPassword.

Log into the database with this password
public Properties
public String
getProperty(String
the property name
property
)

Implements org.hibernate.jmx.HibernateServiceMBean.getProperty.

Get a property
public String
public String
public String
getTransactionStrategy()

Implements org.hibernate.jmx.HibernateServiceMBean.getTransactionStrategy.

The fully qualified class name of the Hibernate TransactionFactory implementation
public String
getUserName()

Implements org.hibernate.jmx.HibernateServiceMBean.getUserName.

Log into the database with this name
public String
getUserTransactionName()

Implements org.hibernate.jmx.HibernateServiceMBean.getUserTransactionName.

The JNDI name of the JTA UserTransaction object (used only be JTATransaction).
public void
setAutoCloseSessionEnabled(String enabled)

Implements org.hibernate.jmx.HibernateServiceMBean.setAutoCloseSessionEnabled.

Enable automatic closing of Session when JTA transaction ends.
public void
setDatasource(String datasource)

Implements org.hibernate.jmx.HibernateServiceMBean.setDatasource.

Set the JNDI name of the datasource to use in this SessionFactory
public void
setFlushBeforeCompletionEnabled(String enabled)

Implements org.hibernate.jmx.HibernateServiceMBean.setFlushBeforeCompletionEnabled.

Enable automatic flushing of the Session when JTA transaction ends.
public void
setJndiName(String jndiName)

Implements org.hibernate.jmx.HibernateServiceMBean.setJndiName.

The JNDI name to bind to the SessionFactory
public void
setPassword(String password)

Implements org.hibernate.jmx.HibernateServiceMBean.setPassword.

Log into the database with this password
public void
setProperty(String
the property name
property
,
String
the property value
value
)

Implements org.hibernate.jmx.HibernateServiceMBean.setProperty.

Set a property
public void
setTransactionManagerLookupStrategy(String
the class name
lkpStrategy
)

Implements org.hibernate.jmx.HibernateServiceMBean.setTransactionManagerLookupStrategy.

Set the strategy for obtaining the JTA TransactionManager
public void
setTransactionStrategy(String
the class name
txnStrategy
)

Implements org.hibernate.jmx.HibernateServiceMBean.setTransactionStrategy.

Set the fully qualified class name of the Hibernate TransactionFactory implementation
public void
setUserName(String userName)

Implements org.hibernate.jmx.HibernateServiceMBean.setUserName.

Log into the database with this name
public void
setUserTransactionName(String
the JNDI name
utName
)

Implements org.hibernate.jmx.HibernateServiceMBean.setUserTransactionName.

Set the JNDI name of the JTA UserTransaction object (used only by JTATransaction).
public void
start()

Implements org.hibernate.jmx.HibernateServiceMBean.start.

Create the SessionFactory and bind to the jndi name on startup
public void
stop()

Implements org.hibernate.jmx.HibernateServiceMBean.stop.

Unbind the SessionFactory or stub from JNDI
Inherited from org.hibernate.util.ExternalSessionFactoryConfig:
addAdditionalPropertyaddAlladdMapResourcebuildConfigurationbuildPropertiesgetBatchVersionedDataEnabledgetCacheProviderClassgetCacheProviderConfiggetCacheRegionPrefixgetCommentsEnabledgetCustomListenersgetDefaultCataloggetDefaultSchemagetDialectgetExcludedPropertyNamesgetGetGeneratedKeysEnabledgetJdbcBatchSizegetJdbcFetchSizegetJdbcScrollableResultSetEnabledgetMapResourcesgetMaximumFetchDepthgetMinimalPutsEnabledgetQueryCacheEnabledgetQuerySubstitutionsgetReflectionOptimizationEnabledgetSecondLevelCacheEnabledgetShowSqlEnabledgetStreamsForBinaryEnabledsetBatchVersionedDataEnabledsetCacheProviderClasssetCacheProviderConfigsetCacheRegionPrefixsetCommentsEnabledsetCustomListenersetCustomListenerssetCustomListenersAsStringsetDefaultCatalogsetDefaultSchemasetDialectsetGetGeneratedKeysEnabledsetJdbcBatchSizesetJdbcFetchSizesetJdbcScrollableResultSetEnabledsetMapResourcessetMaximumFetchDepthsetMinimalPutsEnabledsetQueryCacheEnabledsetQuerySubstitutionssetReflectionOptimizationEnabledsetSecondLevelCacheEnabledsetShowSqlEnabledsetStreamsForBinaryEnabled

Field Detail

boundNameback to summary
private String boundName
logback to summary
private static final Logger log
propertiesback to summary
private Properties properties

Constructor Detail

HibernateServiceback to summary
public HibernateService()

Method Detail

buildSessionFactoryback to summary
pack-priv SessionFactory buildSessionFactory() throws HibernateException
createSchemaback to summary
public void createSchema()

Implements org.hibernate.jmx.HibernateServiceMBean.createSchema.

Doc from org.hibernate.jmx.HibernateServiceMBean.createSchema.

Export the CREATE DDL to the database

dropSchemaback to summary
public void dropSchema()

Implements org.hibernate.jmx.HibernateServiceMBean.dropSchema.

Doc from org.hibernate.jmx.HibernateServiceMBean.dropSchema.

Export the DROP DDL to the database

getAutoCloseSessionEnabledback to summary
public String getAutoCloseSessionEnabled()

Implements org.hibernate.jmx.HibernateServiceMBean.getAutoCloseSessionEnabled.

Doc from org.hibernate.jmx.HibernateServiceMBean.getAutoCloseSessionEnabled.

Is automatic Session closing enabled?

getDatasourceback to summary
public String getDatasource()

Implements org.hibernate.jmx.HibernateServiceMBean.getDatasource.

Doc from org.hibernate.jmx.HibernateServiceMBean.getDatasource.

The JNDI name of the datasource to use in this SessionFactory

Returns:String

String

getExtraPropertiesback to summary
protected Map<K, V> getExtraProperties()

Overrides org.hibernate.util.ExternalSessionFactoryConfig.getExtraProperties.

getFlushBeforeCompletionEnabledback to summary
public String getFlushBeforeCompletionEnabled()

Implements org.hibernate.jmx.HibernateServiceMBean.getFlushBeforeCompletionEnabled.

Doc from org.hibernate.jmx.HibernateServiceMBean.getFlushBeforeCompletionEnabled.

Is automatic Session flusing enabled?

getJndiNameback to summary
public String getJndiName()

Implements org.hibernate.jmx.HibernateServiceMBean.getJndiName.

Doc from org.hibernate.jmx.HibernateServiceMBean.getJndiName.

The JNDI name to bind to the SessionFactory

Returns:String

String

getNameback to summary
public String getName()
getPasswordback to summary
public String getPassword()

Implements org.hibernate.jmx.HibernateServiceMBean.getPassword.

Doc from org.hibernate.jmx.HibernateServiceMBean.getPassword.

Log into the database with this password

Returns:String

String

getPropertiesback to summary
public Properties getProperties()
getPropertyback to summary
public String getProperty(String property)

Implements org.hibernate.jmx.HibernateServiceMBean.getProperty.

Doc from org.hibernate.jmx.HibernateServiceMBean.getProperty.

Get a property

Parameters
property:String

the property name

Returns:String

the property value

getPropertyListback to summary
public String getPropertyList()

Implements org.hibernate.jmx.HibernateServiceMBean.getPropertyList.

Doc from org.hibernate.jmx.HibernateServiceMBean.getPropertyList.

Display the properties

Returns:String

a list of property names and values

getTransactionManagerLookupStrategyback to summary
public String getTransactionManagerLookupStrategy()

Implements org.hibernate.jmx.HibernateServiceMBean.getTransactionManagerLookupStrategy.

Doc from org.hibernate.jmx.HibernateServiceMBean.getTransactionManagerLookupStrategy.

Get the strategy for obtaining the JTA TransactionManager

Returns:String

the class name

getTransactionStrategyback to summary
public String getTransactionStrategy()

Implements org.hibernate.jmx.HibernateServiceMBean.getTransactionStrategy.

Doc from org.hibernate.jmx.HibernateServiceMBean.getTransactionStrategy.

The fully qualified class name of the Hibernate TransactionFactory implementation

Returns:String

the class name

getUserNameback to summary
public String getUserName()

Implements org.hibernate.jmx.HibernateServiceMBean.getUserName.

Doc from org.hibernate.jmx.HibernateServiceMBean.getUserName.

Log into the database with this name

Returns:String

String

getUserTransactionNameback to summary
public String getUserTransactionName()

Implements org.hibernate.jmx.HibernateServiceMBean.getUserTransactionName.

Doc from org.hibernate.jmx.HibernateServiceMBean.getUserTransactionName.

The JNDI name of the JTA UserTransaction object (used only be JTATransaction).

Returns:String

the JNDI name

setAutoCloseSessionEnabledback to summary
public void setAutoCloseSessionEnabled(String enabled)

Implements org.hibernate.jmx.HibernateServiceMBean.setAutoCloseSessionEnabled.

Doc from org.hibernate.jmx.HibernateServiceMBean.setAutoCloseSessionEnabled.

Enable automatic closing of Session when JTA transaction ends.

setDatasourceback to summary
public void setDatasource(String datasource)

Implements org.hibernate.jmx.HibernateServiceMBean.setDatasource.

Doc from org.hibernate.jmx.HibernateServiceMBean.setDatasource.

Set the JNDI name of the datasource to use in this SessionFactory

setFlushBeforeCompletionEnabledback to summary
public void setFlushBeforeCompletionEnabled(String enabled)

Implements org.hibernate.jmx.HibernateServiceMBean.setFlushBeforeCompletionEnabled.

Doc from org.hibernate.jmx.HibernateServiceMBean.setFlushBeforeCompletionEnabled.

Enable automatic flushing of the Session when JTA transaction ends.

setJndiNameback to summary
public void setJndiName(String jndiName)

Implements org.hibernate.jmx.HibernateServiceMBean.setJndiName.

Doc from org.hibernate.jmx.HibernateServiceMBean.setJndiName.

The JNDI name to bind to the SessionFactory

setPasswordback to summary
public void setPassword(String password)

Implements org.hibernate.jmx.HibernateServiceMBean.setPassword.

Doc from org.hibernate.jmx.HibernateServiceMBean.setPassword.

Log into the database with this password

setPropertyback to summary
public void setProperty(String property, String value)

Implements org.hibernate.jmx.HibernateServiceMBean.setProperty.

Doc from org.hibernate.jmx.HibernateServiceMBean.setProperty.

Set a property

Parameters
property:String

the property name

value:String

the property value

setTransactionManagerLookupStrategyback to summary
public void setTransactionManagerLookupStrategy(String lkpStrategy)

Implements org.hibernate.jmx.HibernateServiceMBean.setTransactionManagerLookupStrategy.

Doc from org.hibernate.jmx.HibernateServiceMBean.setTransactionManagerLookupStrategy.

Set the strategy for obtaining the JTA TransactionManager

Parameters
lkpStrategy:String

the class name

setTransactionStrategyback to summary
public void setTransactionStrategy(String txnStrategy)

Implements org.hibernate.jmx.HibernateServiceMBean.setTransactionStrategy.

Doc from org.hibernate.jmx.HibernateServiceMBean.setTransactionStrategy.

Set the fully qualified class name of the Hibernate TransactionFactory implementation

Parameters
txnStrategy:String

the class name

setUserNameback to summary
public void setUserName(String userName)

Implements org.hibernate.jmx.HibernateServiceMBean.setUserName.

Doc from org.hibernate.jmx.HibernateServiceMBean.setUserName.

Log into the database with this name

setUserTransactionNameback to summary
public void setUserTransactionName(String utName)

Implements org.hibernate.jmx.HibernateServiceMBean.setUserTransactionName.

Doc from org.hibernate.jmx.HibernateServiceMBean.setUserTransactionName.

Set the JNDI name of the JTA UserTransaction object (used only by JTATransaction).

Parameters
utName:String

the JNDI name

startback to summary
public void start() throws HibernateException

Implements org.hibernate.jmx.HibernateServiceMBean.start.

Doc from org.hibernate.jmx.HibernateServiceMBean.start.

Create the SessionFactory and bind to the jndi name on startup

stopback to summary
public void stop()

Implements org.hibernate.jmx.HibernateServiceMBean.stop.

Doc from org.hibernate.jmx.HibernateServiceMBean.stop.

Unbind the SessionFactory or stub from JNDI