AVM now configures itself via Spring. Also adjusted jndi-client and catalina-virtual

to be semi-not-broken.  The current limitation is that you've got to start tomcat from
$TOMCAT_HOME for things to work (fix soon).


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3267 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-06-29 21:37:17 +00:00
parent 7d940d08e1
commit 106273bde8
15 changed files with 261 additions and 114 deletions

View File

@@ -21,39 +21,51 @@ import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
/**
* Like 83.7 gazillion others, a HibernateHelper. This will go away.
* @author britt
*/
public class HibernateHelper
{
private static Configuration fgCfg = null;
private static SessionFactory fgFactory = null;
/**
* The single instance of this.
*/
private static HibernateHelper fgInstance = null;
static
/**
* The Hibernate Configuration object.
*/
private Configuration fCfg;
/**
* The Hibernate SessionFactory;
*/
private SessionFactory fFactory;
public HibernateHelper()
{
Reset();
fCfg = null;
fFactory = null;
setup();
fgInstance = this;
}
public static SessionFactory GetSessionFactory()
public SessionFactory getSessionFactory()
{
return fgFactory;
return fFactory;
}
public static Configuration GetConfiguration()
public Configuration getConfiguration()
{
return fgCfg;
return fCfg;
}
public static void Reset()
public void setup()
{
if (fgFactory != null)
{
fgFactory.close();
}
try
{
fgCfg = new Configuration();
fgCfg.configure();
fgFactory = fgCfg.buildSessionFactory();
fCfg = new Configuration();
fCfg.configure();
fFactory = fCfg.buildSessionFactory();
}
catch (Throwable t)
{
@@ -61,4 +73,14 @@ public class HibernateHelper
System.exit(1);
}
}
public void shutdown()
{
fFactory.close();
}
public static HibernateHelper GetInstance()
{
return fgInstance;
}
}