summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-06-01 22:46:17 (EDT)
committerEike Stepper2008-06-01 22:46:17 (EDT)
commit697aa7bbc5de256eeddcef0d9f1554fecd7210ad (patch)
tree3a5e58e3d938744ce8c7f6a35eee77d6fb728d0f
parent719c33cf03a20ab46554d56f6b2332a2af2c2836 (diff)
downloadcdo-697aa7bbc5de256eeddcef0d9f1554fecd7210ad.zip
cdo-697aa7bbc5de256eeddcef0d9f1554fecd7210ad.tar.gz
cdo-697aa7bbc5de256eeddcef0d9f1554fecd7210ad.tar.bz2
[227883] Integrate Hibernate/Teneo into CDO build
https://bugs.eclipse.org/bugs/show_bug.cgi?id=227883
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernatePackageHandler.java21
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStore.java18
2 files changed, 10 insertions, 29 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernatePackageHandler.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernatePackageHandler.java
index f275e8d..efbe56b 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernatePackageHandler.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernatePackageHandler.java
@@ -47,7 +47,7 @@ import java.util.List;
* @author Eike Stepper
* @author Martin Taal
*/
-public class HibernatePackageHandler
+public class HibernatePackageHandler extends Lifecycle
{
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, HibernateStoreWriter.class);
@@ -358,36 +358,31 @@ public class HibernatePackageHandler
cdoPackageInfos = null;
}
- protected void doActivate()
+ @Override
+ protected void doActivate() throws Exception
{
- if (TRACER.isEnabled())
- {
- TRACER.trace("Activating CDOPackageHandler");
- }
-
+ super.doActivate();
initConfiguration();
initSchema();
}
+ @Override
protected void doDeactivate() throws Exception
{
- if (TRACER.isEnabled())
- {
- TRACER.trace("Deactivating CDOPackageHandler");
- }
-
if (sessionFactory != null)
{
sessionFactory.close();
sessionFactory = null;
}
+
+ super.doDeactivate();
}
protected void initConfiguration()
{
if (TRACER.isEnabled())
{
- TRACER.trace("Initializing datastore for CDO metadata");
+ TRACER.trace("Initializing configuration for CDO metadata");
}
InputStream in = null;
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStore.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStore.java
index 18ed969..5b242ae 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStore.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStore.java
@@ -193,25 +193,13 @@ public class HibernateStore extends Store implements IHibernateStore
@Override
protected void doActivate() throws Exception
{
- if (TRACER.isEnabled())
- {
- TRACER.trace("Activating HibernateStore");
- }
-
super.doActivate();
-
- // Activate the package store
- packageHandler.doActivate();
+ packageHandler.activate();
}
@Override
protected void doDeactivate() throws Exception
{
- if (TRACER.isEnabled())
- {
- TRACER.trace("De-Activating HibernateStore");
- }
-
if (hibernateSessionFactory != null)
{
if (TRACER.isEnabled())
@@ -223,8 +211,7 @@ public class HibernateStore extends Store implements IHibernateStore
hibernateSessionFactory = null;
}
- packageHandler.doDeactivate();
-
+ packageHandler.deactivate();
super.doDeactivate();
}
@@ -267,7 +254,6 @@ public class HibernateStore extends Store implements IHibernateStore
try
{
hibernateConfiguration = new Configuration();
-
if (mappingProvider != null)
{
mappingProvider.setHibernateStore(this);