1 26 27 package org.objectweb.openccm.corba; 28 29 36 37 public abstract class TheTradingService 38 { 39 45 48 private static org.omg.CosTrading.Lookup trader_ = null; 49 50 53 private static org.omg.CosTradingRepos.ServiceTypeRepository repos_ = null; 54 55 61 64 private 65 TheTradingService() 66 { 67 } 68 69 75 81 86 public static org.omg.CosTrading.Lookup 87 getLookup() 88 { 89 if(trader_ == null) 90 { 91 org.omg.CORBA.Object trader_ref = null; 92 try { 93 trader_ref = TheORB.getORB().resolve_initial_references("TradingService"); 94 } catch (org.omg.CORBA.ORBPackage.InvalidName ex) { 95 return null; 97 } 98 setTrader(org.omg.CosTrading.LookupHelper.narrow(trader_ref)); 99 } 100 return trader_; 101 } 102 103 108 public static org.omg.CosTrading.Register 109 getRegister() 110 { 111 if (getLookup() == null) return null; 112 return getLookup().register_if(); 113 } 114 115 120 public static org.omg.CosTradingRepos.ServiceTypeRepository 121 getRepository() 122 { 123 if(repos_ == null) 124 { 125 getLookup(); 126 } 127 return repos_; 128 } 129 130 135 public static void 136 setTrader(org.omg.CosTrading.Lookup trader) 137 { 138 trader_ = trader; 139 140 org.omg.CORBA.Object to_narrow = trader_.admin_if().type_repos(); 141 repos_ = org.omg.CosTradingRepos.ServiceTypeRepositoryHelper.narrow(to_narrow); 142 } 143 144 } 145 | Popular Tags |