public class JwigCurrentSessionContext extends Object implements CurrentSessionContext, dk.brics.jwig.server.SessionManagerListener, dk.brics.jwig.server.DispatchListener
Modifier and Type | Field and Description |
---|---|
protected SessionFactoryImplementor |
factoryImplementor |
Constructor and Description |
---|
JwigCurrentSessionContext(SessionFactoryImplementor factoryImplementor) |
Modifier and Type | Method and Description |
---|---|
Session |
currentSession() |
static JwigCurrentSessionContext |
getCurrentSessionContext()
Gets the object that is the current session context.
|
boolean |
isAutoCloseEnabled()
Returns whether or not the the session should be closed by transaction completion.
|
boolean |
isAutoFlushEnabled()
Returns whether or not the the session should be flushed prior to transaction completion.
|
void |
sessionCreated(Session s)
Invoked by the session manager when a session is created.
|
void |
sessionEnded(Session s)
Invoked by the session manager when a session is ended in a normal way (not by timeout).
|
void |
sessionRefreshed(Session s)
Invoked by the session manager after a session is refreshed.
|
void |
sessionTimeout(Session s)
Invoked by the session manager when a session is ended by a timeout.
|
void |
setAutoCloseEnabled(boolean autoCloseEnabled)
Sets whether or not the the session should be closed by transaction completion.
|
void |
setAutoFlushEnabled(boolean autoFlushEnabled)
Sets whether or not the the session should be flushed prior to transaction completion.
|
void |
threadDismissed(Thread t)
Called when a thread leaves JWIG.
|
void |
threadDispatched(Thread t)
Called when a new thread enters the JWIG framework through the dispatcher.
|
protected SessionFactoryImplementor factoryImplementor
public JwigCurrentSessionContext(SessionFactoryImplementor factoryImplementor)
public Session currentSession() throws HibernateException
currentSession
in interface CurrentSessionContext
HibernateException
public static JwigCurrentSessionContext getCurrentSessionContext()
public boolean isAutoCloseEnabled()
public boolean isAutoFlushEnabled()
public void sessionCreated(Session s)
dk.brics.jwig.server.SessionManagerListener
sessionCreated
in interface dk.brics.jwig.server.SessionManagerListener
public void sessionEnded(Session s)
dk.brics.jwig.server.SessionManagerListener
sessionEnded
in interface dk.brics.jwig.server.SessionManagerListener
Session.end()
public void sessionRefreshed(Session s)
dk.brics.jwig.server.SessionManagerListener
sessionRefreshed
in interface dk.brics.jwig.server.SessionManagerListener
public void sessionTimeout(Session s)
dk.brics.jwig.server.SessionManagerListener
sessionTimeout
in interface dk.brics.jwig.server.SessionManagerListener
public void setAutoCloseEnabled(boolean autoCloseEnabled)
public void setAutoFlushEnabled(boolean autoFlushEnabled)
public void threadDismissed(Thread t)
dk.brics.jwig.server.DispatchListener
DispatchListener.threadDispatched(Thread)
can be assumed to have been called with the thread
before this method is calledthreadDismissed
in interface dk.brics.jwig.server.DispatchListener
public void threadDispatched(Thread t)
dk.brics.jwig.server.DispatchListener
threadDispatched
in interface dk.brics.jwig.server.DispatchListener
Copyright © 2008-2012 Anders Møller & Mathias Schwarz.