|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.princeton.wordnet.orm.hibernate.SessionBroker
public class SessionBroker
Session Manager
Field Summary | |
---|---|
private static org.apache.log4j.Logger |
LOG
Logger |
private static java.lang.String |
theConnectionSettings
Hibernate config |
private static org.hibernate.SessionFactory |
theSessionFactory
The single instance of Hibernate SessionFactory |
Constructor Summary | |
---|---|
private |
SessionBroker()
Disable constructor to guarantee a single instance |
Method Summary | |
---|---|
static void |
closeSession(org.hibernate.Session thisSession)
Close session |
static java.lang.String |
getConnectionData()
Get connection data |
private static java.util.Properties |
getConnectionProperties()
Get connection configuration |
(package private) static org.hibernate.SessionFactory |
getInstance()
Get singleton instance |
static org.hibernate.Session |
getSession()
Returns a session |
private static org.hibernate.Session |
openSession()
Open session |
static void |
setup()
Setup |
static void |
setup(java.lang.String theseConnectionSettings)
Setup |
static void |
shutdown()
Closes the session factory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.log4j.Logger LOG
private static java.lang.String theConnectionSettings
private static org.hibernate.SessionFactory theSessionFactory
Constructor Detail |
---|
private SessionBroker()
Method Detail |
---|
static org.hibernate.SessionFactory getInstance() throws org.hibernate.HibernateException, java.io.FileNotFoundException
org.hibernate.HibernateException
java.io.FileNotFoundException
public static void setup(java.lang.String theseConnectionSettings)
theseConnectionSettings
- command line argumentspublic static void setup() throws org.hibernate.HibernateException, java.io.FileNotFoundException
java.sql.SQLException
org.hibernate.HibernateException
java.io.FileNotFoundException
private static java.util.Properties getConnectionProperties() throws java.io.FileNotFoundException
java.io.FileNotFoundException
public static java.lang.String getConnectionData() throws java.io.FileNotFoundException
java.io.FileNotFoundException
public static void shutdown()
private static org.hibernate.Session openSession() throws org.hibernate.HibernateException, java.io.FileNotFoundException
org.hibernate.HibernateException
java.io.FileNotFoundException
java.sql.SQLException
public static org.hibernate.Session getSession() throws org.hibernate.HibernateException, java.io.FileNotFoundException
java.sql.SQLException
org.hibernate.HibernateException
java.io.FileNotFoundException
public static void closeSession(org.hibernate.Session thisSession) throws org.hibernate.HibernateException
thisSession
- session
org.hibernate.HibernateException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |