ch.ledcom.hephaistos.dao
Class HibernatePlugIn

java.lang.Object
  |
  +--ch.ledcom.hephaistos.dao.HibernatePlugIn
All Implemented Interfaces:
org.apache.struts.action.PlugIn

public class HibernatePlugIn
extends java.lang.Object
implements org.apache.struts.action.PlugIn

Implements the PlugIn interface to configure the Hibernate data persistence library. A configured net.sf.hibernate.SessionFactory is stored in the ServletContext of the web application unless the property storedInServletContext is set to false.

<plugin class="net.sf.hibernate.plugins.struts.HibernatePlugIn"> <set-property name="configFilePath"" value="path-to-config-file"/> <set-property name="storedInServletContext"" value="true-or-false"/> </plugin>

Version:
1.0
Author:
Bradley M. Handy

Field Summary
static java.lang.String SESSION_FACTORY_KEY
          the key under which the SessionFactory instance is stored in the ServletContext.
 
Constructor Summary
HibernatePlugIn()
           
 
Method Summary
 void destroy()
          Destroys the SessionFactory instance.
 void init(org.apache.struts.action.ActionServlet servlet, org.apache.struts.config.ModuleConfig config)
          Initializes the SessionFactory.
 void setConfigFilePath(java.lang.String configFilePath)
          Setter for property configFilePath.
 void setStoredInServletContext(java.lang.String storedInServletContext)
          Setter for property storedInServletContext.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SESSION_FACTORY_KEY

public static final java.lang.String SESSION_FACTORY_KEY
the key under which the SessionFactory instance is stored in the ServletContext.

Constructor Detail

HibernatePlugIn

public HibernatePlugIn()
Method Detail

destroy

public void destroy()
Destroys the SessionFactory instance.

Specified by:
destroy in interface org.apache.struts.action.PlugIn

init

public void init(org.apache.struts.action.ActionServlet servlet,
                 org.apache.struts.config.ModuleConfig config)
          throws javax.servlet.ServletException
Initializes the SessionFactory.

Specified by:
init in interface org.apache.struts.action.PlugIn
Parameters:
servlet - the ActionServlet instance under which the plugin will run.
config - the ModuleConfig for the module under which the plugin will run.
javax.servlet.ServletException

setConfigFilePath

public void setConfigFilePath(java.lang.String configFilePath)
Setter for property configFilePath.

Parameters:
configFilePath - New value of property configFilePath.

setStoredInServletContext

public void setStoredInServletContext(java.lang.String storedInServletContext)
Setter for property storedInServletContext.

Parameters:
storedInServletContext - New value of property storedInServletContext.


Copyright © 2004 LedCom. All Rights Reserved.