1 22 package org.jboss.tm.iiop.wrapper; 23 24 import java.rmi.RemoteException ; 25 26 import org.jboss.iiop.CorbaORB; 27 import org.jboss.tm.remoting.interfaces.Status; 28 import org.jboss.tm.remoting.interfaces.Synchronization; 29 30 38 public class OTSSynchronizationWrapper implements Synchronization 39 { 40 42 45 private org.omg.CosTransactions.Synchronization otsSynchronization; 46 47 49 54 public OTSSynchronizationWrapper(org.omg.CosTransactions.Synchronization otsSynchronization) 55 { 56 this.otsSynchronization = otsSynchronization; 57 } 58 59 61 public org.omg.CosTransactions.Synchronization getWrappedSynchronization() 62 { 63 return otsSynchronization; 64 } 65 66 68 public String toString() 69 { 70 return CorbaORB.getInstance().object_to_string(otsSynchronization); 71 } 72 73 75 public static OTSSynchronizationWrapper fromString(String s) 76 { 77 org.omg.CORBA.Object obj = CorbaORB.getInstance().string_to_object(s); 78 org.omg.CosTransactions.Synchronization otsSynch = 79 org.omg.CosTransactions.SynchronizationHelper.narrow(obj); 80 return new OTSSynchronizationWrapper(otsSynch); 81 } 82 83 85 89 public void beforeCompletion() throws RemoteException 90 { 91 try 92 { 93 otsSynchronization.before_completion(); 94 } 95 catch (org.omg.CORBA.SystemException se) 96 { 97 throw javax.rmi.CORBA.Util.mapSystemException(se); 98 } 99 } 100 101 105 public void afterCompletion(Status s) throws RemoteException 106 { 107 try 108 { 109 otsSynchronization.after_completion(Util.jbossToCosTransactions(s)); 110 } 111 catch (org.omg.CORBA.SystemException se) 112 { 113 throw javax.rmi.CORBA.Util.mapSystemException(se); 114 } 115 } 116 117 } 118 | Popular Tags |