1 7 8 10 package org.jboss.net.axis.server; 11 12 import org.jboss.axis.AxisFault; 13 import org.jboss.axis.MessageContext; 14 15 import javax.transaction.NotSupportedException ; 16 import javax.transaction.Status ; 17 import javax.transaction.SystemException ; 18 19 33 34 public class TransactionRequestHandler extends TransactionResponseHandler 35 { 36 37 protected static final Object MARKER = new Object (); 38 39 public TransactionRequestHandler() throws Exception 40 { 41 } 42 43 47 51 public void invoke(MessageContext msgContext) throws AxisFault 52 { 53 try 54 { 55 if (userTransaction.getStatus() == Status.STATUS_NO_TRANSACTION 56 && msgContext.getProperty(Constants.TRANSACTION_PROPERTY) == null) 57 { 58 userTransaction.begin(); 59 msgContext.setProperty(Constants.TRANSACTION_PROPERTY, MARKER); 60 } 61 } 62 catch (SystemException e) 63 { 64 throw new AxisFault("Could not analyze tx setting.", e); 65 } 66 catch (NotSupportedException e) 67 { 68 throw new AxisFault("Could not begin tx.", e); 69 } 70 } 71 } 72 | Popular Tags |