1 22 package org.jboss.tm.iiop.client; 23 24 import org.omg.CORBA.LocalObject ; 25 import org.omg.CosNaming.NamingContextExt ; 26 import org.omg.CosNaming.NamingContextExtHelper ; 27 import org.omg.PortableInterceptor.ORBInitInfo ; 28 import org.omg.PortableInterceptor.ORBInitInfoPackage.InvalidName ; 29 import org.omg.PortableInterceptor.ORBInitializer ; 30 31 38 public class TransactionCurrentInitializer 39 extends LocalObject 40 implements ORBInitializer 41 { 42 43 public TransactionCurrentInitializer() 44 { 45 } 47 48 50 public void pre_init(ORBInitInfo info) 51 { 52 try 53 { 54 info.register_initial_reference("TransactionCurrent", 55 TransactionCurrent.getInstance()); 56 } 57 catch (InvalidName e) 58 { 59 throw new RuntimeException ("Could not register initial " + 60 "reference for TransactionCurrent: " + e); 61 } 62 } 63 64 public void post_init(ORBInitInfo info) 65 { 66 try 67 { 68 org.omg.CORBA.Object obj = 69 info.resolve_initial_references("NameService"); 70 NamingContextExt rootContext = NamingContextExtHelper.narrow(obj); 71 TransactionCurrent.init(rootContext); 72 } 73 catch (Exception e) 74 { 75 throw new RuntimeException ("Unexpected " + e); 76 } 77 } 78 79 } 80 | Popular Tags |