|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.directwebremoting.hibernate.H3SessionAjaxFilter
public class H3SessionAjaxFilter
An AjaxFilter
that uses DWR Hibernate support classes to do a
Session#beginTransaction()
before passing the control on to the chain
and a Transaction#commit()
after.
Field Summary | |
---|---|
protected static java.lang.String |
ATTRIBUTE_SESSION
Under what name do we store the session factory? |
Constructor Summary | |
---|---|
H3SessionAjaxFilter()
|
Method Summary | |
---|---|
java.lang.Object |
doFilter(java.lang.Object object,
java.lang.reflect.Method method,
java.lang.Object[] params,
AjaxFilterChain chain)
The doFilter method of the AjaxFilter is called by DWR each
time an Ajax request is made on a method that this filter is configured
against. |
static Session |
getCurrentSession(ServletContext context)
Get access to a Session, given the SessionFactory linked in
setSessionFactory(ServletContext, SessionFactory) |
static void |
setSessionFactory(ServletContext context,
SessionFactory sessionFactory)
Assigns a SessionFactory to a ServletContext so DWR knows
how to get hold of a org.hibernate.Session . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String ATTRIBUTE_SESSION
Constructor Detail |
---|
public H3SessionAjaxFilter()
Method Detail |
---|
public java.lang.Object doFilter(java.lang.Object object, java.lang.reflect.Method method, java.lang.Object[] params, AjaxFilterChain chain) throws java.lang.Exception
AjaxFilter
doFilter
method of the AjaxFilter is called by DWR each
time an Ajax request is made on a method that this filter is configured
against. The AjaxFilterChain passed in to this method allows
the filter to pass on method details to next entity in the chain.
Typically the method would do the following:
- Examine the request
- Optionally alter the method, object or parameters
- Either invoke the next entity in the chain using the AjaxFilterChain
or decide to take some other action instead.
- Optionally modify the value returned to the user
- Take some other action (e.g. logging)
- Specified by:
doFilter
in interface AjaxFilter
- Parameters:
object
- The object to execute the method on (i.e. 'this')method
- The method to executeparams
- The parameters to the method callchain
- Allow the request to be passed on
- Returns:
- The results of the method execution
- Throws:
java.io.IOException
- When some I/O error occurs
java.lang.Exception
- When some processing goes wrong
public static void setSessionFactory(ServletContext context, SessionFactory sessionFactory)
SessionFactory
to a ServletContext
so DWR knows
how to get hold of a org.hibernate.Session
.
context
- The Servlet environment to store the ServletContext insessionFactory
- The Hibernate session factory to registerpublic static Session getCurrentSession(ServletContext context)
SessionFactory
linked in
setSessionFactory(ServletContext, SessionFactory)
context
- The webapp to link the calls together
SessionFactory
or null if
setSessionFactory(ServletContext, SessionFactory)
has not been
called for this ServletContext
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |