com.atomikos.icatch.jta.jsp
Class TransactionTag

java.lang.Object
  extended by BodyTagSupport
      extended by com.atomikos.icatch.jta.jsp.TransactionTag

public final class TransactionTag
extends BodyTagSupport

A JSP tag handler for transaction demarcation in a JSP page.


Constructor Summary
TransactionTag()
           
 
Method Summary
 void doCatch(Throwable arg)
          This method is invoked by the JSP engine whenever there is an exception in the body.
 void doFinally()
          Invoked at the end of the tag.
 int doStartTag()
          Invoked before the body is evaluated.
 void setTimeout(String seconds)
          Sets the timeout for new transactions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionTag

public TransactionTag()
Method Detail

setTimeout

public void setTimeout(String seconds)
Sets the timeout for new transactions. Specified as an attribute in the JSP opening tag.

Parameters:
seconds - The timeout in seconds.

doStartTag

public int doStartTag()
               throws JspException
Invoked before the body is evaluated. This method will start a new transaction.

Throws:
JspException - On failure.

doCatch

public void doCatch(Throwable arg)
             throws Throwable
This method is invoked by the JSP engine whenever there is an exception in the body. In this case, the transaction will be marked for rollback.

Parameters:
arg - The exception that has happened. This exception is re-raised after marking the transaction for rollback.
Throws:
Throwable

doFinally

public void doFinally()
Invoked at the end of the tag. This method will try to commit the transaction. If any exception happened, then the transaction will have been marked for rollback so commit will fail.



Copyright © 2012. All Rights Reserved.