org.jboss.seam.persistence
Class ManagedHibernateSession

java.lang.Object
  extended by org.jboss.seam.persistence.ManagedHibernateSession
All Implemented Interfaces:
Serializable, EventListener, javax.servlet.http.HttpSessionActivationListener, Synchronization, Mutable, PersistenceContextManager

@Scope(value=CONVERSATION)
@BypassInterceptors
public class ManagedHibernateSession
extends Object
implements Serializable, javax.servlet.http.HttpSessionActivationListener, Mutable, PersistenceContextManager, Synchronization

A Seam component that manages a conversation-scoped extended persistence context that can be shared by arbitrary other components.

Author:
Gavin King
See Also:
Serialized Form

Constructor Summary
ManagedHibernateSession()
           
 
Method Summary
 void afterCompletion(int status)
           
 void beforeCompletion()
           
 void changeFlushMode(FlushModeType flushMode)
           
 boolean clearDirty()
          Get and clear the dirty flag.
 void create(Component component)
           
 void destroy()
           
 String getComponentName()
           
 List<Filter> getFilters()
          Hibernate filters to enable automatically
 org.hibernate.Session getSession()
           
 Expressions.ValueExpression<org.hibernate.SessionFactory> getSessionFactory()
           
 String getSessionFactoryJndiName()
          The JNDI name of the Hibernate SessionFactory, if it is to be obtained from JNDI
 void sessionDidActivate(javax.servlet.http.HttpSessionEvent event)
           
 void sessionWillPassivate(javax.servlet.http.HttpSessionEvent event)
           
 void setFilters(List<Filter> filters)
           
 void setSessionFactory(Expressions.ValueExpression<org.hibernate.SessionFactory> sessionFactory)
          A value binding expression that returns a SessionFactory, if it is to be obtained as a Seam component reference
 void setSessionFactoryJndiName(String sessionFactoryName)
           
protected  void setSessionFlushMode(FlushModeType flushMode)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ManagedHibernateSession

public ManagedHibernateSession()
Method Detail

clearDirty

public boolean clearDirty()
Description copied from interface: Mutable
Get and clear the dirty flag.

Specified by:
clearDirty in interface Mutable
Returns:
true if the instance is dirty and requires replication

create

@Create
public void create(Component component)

getSession

@Unwrap
public org.hibernate.Session getSession()
                                 throws Exception
Throws:
Exception

sessionWillPassivate

public void sessionWillPassivate(javax.servlet.http.HttpSessionEvent event)
Specified by:
sessionWillPassivate in interface javax.servlet.http.HttpSessionActivationListener

sessionDidActivate

public void sessionDidActivate(javax.servlet.http.HttpSessionEvent event)
Specified by:
sessionDidActivate in interface javax.servlet.http.HttpSessionActivationListener

destroy

@Destroy
public void destroy()

afterCompletion

public void afterCompletion(int status)
Specified by:
afterCompletion in interface Synchronization

beforeCompletion

public void beforeCompletion()
Specified by:
beforeCompletion in interface Synchronization

getComponentName

public String getComponentName()

changeFlushMode

public void changeFlushMode(FlushModeType flushMode)
Specified by:
changeFlushMode in interface PersistenceContextManager

setSessionFlushMode

protected void setSessionFlushMode(FlushModeType flushMode)

getSessionFactoryJndiName

public String getSessionFactoryJndiName()
The JNDI name of the Hibernate SessionFactory, if it is to be obtained from JNDI


setSessionFactoryJndiName

public void setSessionFactoryJndiName(String sessionFactoryName)

setSessionFactory

public void setSessionFactory(Expressions.ValueExpression<org.hibernate.SessionFactory> sessionFactory)
A value binding expression that returns a SessionFactory, if it is to be obtained as a Seam component reference


getSessionFactory

public Expressions.ValueExpression<org.hibernate.SessionFactory> getSessionFactory()

getFilters

public List<Filter> getFilters()
Hibernate filters to enable automatically


setFilters

public void setFilters(List<Filter> filters)

toString

public String toString()
Overrides:
toString in class Object