1 23 24 package com.sun.ejb.containers; 25 26 import java.util.*; 27 import javax.transaction.*; 28 import javax.transaction.xa.*; 29 import com.sun.enterprise.*; 30 31 32 42 43 public class PMTransactionImpl implements Transaction { 44 45 private Transaction tx; 46 47 PMTransactionImpl(Transaction tx) 48 { 49 this.tx = tx; 50 } 51 52 public int getStatus() throws SystemException { 53 return tx.getStatus(); 54 } 55 56 57 public void registerSynchronization(Synchronization pmsync) 58 throws RollbackException, IllegalStateException , 59 SystemException { 60 61 Switch theSwitch = Switch.getSwitch(); 63 ContainerFactoryImpl cf = (ContainerFactoryImpl)theSwitch.getContainerFactory(); 64 cf.getContainerSync(tx).addPMSynchronization(pmsync); 65 } 66 67 68 public void setRollbackOnly() 69 throws IllegalStateException , SystemException { 70 71 tx.setRollbackOnly(); 72 } 73 74 public boolean equals(Object object) { 75 if (object == this) 76 return true; 77 else if ( !(object instanceof PMTransactionImpl) ) 78 return false; 79 else 80 return tx.equals(((PMTransactionImpl)object).tx); 81 } 82 83 public int hashCode() { 84 return tx.hashCode(); 85 } 86 87 88 public void commit() throws RollbackException, 89 HeuristicMixedException, HeuristicRollbackException, 90 SecurityException , SystemException 91 { 92 throw new IllegalStateException ("Operation not allowed"); 93 } 94 95 96 public void rollback() 97 throws IllegalStateException , SystemException { 98 99 throw new IllegalStateException ("Operation not allowed"); 100 } 101 102 public boolean enlistResource(XAResource res) 103 throws RollbackException, IllegalStateException , 104 SystemException { 105 106 throw new IllegalStateException ("Operation not allowed"); 107 } 108 109 public boolean delistResource(XAResource res, int flags) 110 throws IllegalStateException , SystemException { 111 112 throw new IllegalStateException ("Operation not allowed"); 113 } 114 115 116 } 117 | Popular Tags |