Methods Summary |
---|
org.hibernate.SessionFactory | buildSessionFactory()
log.info( "starting service at JNDI name: " + boundName );
log.info( "service properties: " + properties );
return buildConfiguration().buildSessionFactory();
|
public void | createSchema()
new SchemaExport( buildConfiguration() ).create(false, true);
|
public void | dropSchema()
new SchemaExport( buildConfiguration() ).drop(false, true);
|
public java.lang.String | getAutoCloseSessionEnabled()
return getProperty(Environment.AUTO_CLOSE_SESSION);
|
public java.lang.String | getDatasource()
return getProperty(Environment.DATASOURCE);
|
protected java.util.Map | getExtraProperties()
return properties;
|
public java.lang.String | getFlushBeforeCompletionEnabled()
return getProperty(Environment.FLUSH_BEFORE_COMPLETION);
|
public java.lang.String | getJndiName()
return getProperty(Environment.SESSION_FACTORY_NAME);
|
public java.lang.String | getName()
return getProperty(Environment.SESSION_FACTORY_NAME);
|
public java.lang.String | getPassword()
return getProperty(Environment.PASS);
|
public java.util.Properties | getProperties()
return buildProperties();
|
public java.lang.String | getProperty(java.lang.String property)
return properties.getProperty(property);
|
public java.lang.String | getPropertyList()
return buildProperties().toString();
|
public java.lang.String | getTransactionManagerLookupStrategy()
return getProperty(Environment.TRANSACTION_MANAGER_STRATEGY);
|
public java.lang.String | getTransactionStrategy()
return getProperty(Environment.TRANSACTION_STRATEGY);
|
public java.lang.String | getUserName()
return getProperty(Environment.USER);
|
public java.lang.String | getUserTransactionName()
return getProperty(Environment.USER_TRANSACTION);
|
public void | setAutoCloseSessionEnabled(java.lang.String enabled)
setProperty(Environment.AUTO_CLOSE_SESSION, enabled);
|
public void | setDatasource(java.lang.String datasource)
setProperty(Environment.DATASOURCE, datasource);
|
public void | setFlushBeforeCompletionEnabled(java.lang.String enabled)
setProperty(Environment.FLUSH_BEFORE_COMPLETION, enabled);
|
public void | setJndiName(java.lang.String jndiName)
setProperty(Environment.SESSION_FACTORY_NAME, jndiName);
|
public void | setPassword(java.lang.String password)
setProperty(Environment.PASS, password);
|
public void | setProperty(java.lang.String property, java.lang.String value)
properties.setProperty(property, value);
|
public void | setTransactionManagerLookupStrategy(java.lang.String lkpStrategy)
setProperty(Environment.TRANSACTION_MANAGER_STRATEGY, lkpStrategy);
|
public void | setTransactionStrategy(java.lang.String txnStrategy)
setProperty(Environment.TRANSACTION_STRATEGY, txnStrategy);
|
public void | setUserName(java.lang.String userName)
setProperty(Environment.USER, userName);
|
public void | setUserTransactionName(java.lang.String utName)
setProperty(Environment.USER_TRANSACTION, utName);
|
public void | start()
boundName = getJndiName();
try {
buildSessionFactory();
}
catch (HibernateException he) {
log.info( "Could not build SessionFactory using the MBean classpath - will try again using client classpath: " + he.getMessage() );
log.debug("Error was", he);
new SessionFactoryStub(this);
}
|
public void | stop()
log.info("stopping service");
try {
InitialContext context = NamingHelper.getInitialContext( buildProperties() );
( (SessionFactory) context.lookup(boundName) ).close();
//context.unbind(boundName);
}
catch (Exception e) {
log.warn("exception while stopping service", e);
}
|