org.jencks.interceptor
Class TransactionContexFilter

java.lang.Object
  extended byorg.jencks.interceptor.TransactionContexFilter
All Implemented Interfaces:
Filter

public class TransactionContexFilter
extends Object
implements Filter

This servlet filter is used to enter in a transactional context automtically at every servlet call and exit of it when the response is sent back to the client.

This class must be used with a mechanism (for example, Acegi) to use injection on filters.

The following is an example of use:

... Geronimo Transaction Context Filter org.springframework.web.filter.DelegatingFilterProxy targetBeanName org.springframework.jca.interceptor.TransactionContexFilter

Geronimo Transaction Context Filter /* ...

Author:
Thierry Templier
See Also:
TrackedConnectionAssociator.enter(InstanceContext), TrackedConnectionAssociator.exit(InstanceContext), InstanceContext, DefaultInstanceContext

Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
TransactionContexFilter()
           
 
Method Summary
 void destroy()
           
 void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
          This is the central method of the filter which allows the request to enter in a transactionnal context and exit when the request is sent back to the client.
 void init(FilterConfig config)
           
 void setAssociator(org.apache.geronimo.transaction.TrackedConnectionAssociator associator)
          Set the TrackedConnectionAssociator instance to allow the bean to enter and exit a transactional context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected transient org.apache.commons.logging.Log logger
Constructor Detail

TransactionContexFilter

public TransactionContexFilter()
Method Detail

init

public void init(FilterConfig config)
          throws ServletException
Specified by:
init in interface Filter
Throws:
ServletException

doFilter

public void doFilter(ServletRequest request,
                     ServletResponse response,
                     FilterChain chain)
              throws IOException,
                     ServletException
This is the central method of the filter which allows the request to enter in a transactionnal context and exit when the request is sent back to the client.

Specified by:
doFilter in interface Filter
Throws:
IOException
ServletException
See Also:
#enterContext(Set, Set), #exitContext(InstanceContext)

destroy

public void destroy()
Specified by:
destroy in interface Filter

setAssociator

public void setAssociator(org.apache.geronimo.transaction.TrackedConnectionAssociator associator)
Set the TrackedConnectionAssociator instance to allow the bean to enter and exit a transactional context.



Copyright © 2005 LogicBlaze, Inc.. All Rights Reserved.