1 26 27 package org.objectweb.openccm.Components; 28 29 import org.objectweb.openccm.Components.HomeManager; 30 import org.objectweb.openccm.Components.HomeManagerHelper; 31 32 41 42 public abstract class Runtime 43 { 44 50 53 protected static boolean already_initialized_ = false; 54 55 58 protected static HomeManager home_manager_; 59 60 66 69 private 70 Runtime() 71 { 72 } 73 74 80 84 protected static void 85 register_valuetype_factories() 86 { 87 register_value_factory(org.omg.Components.ComponentPortDescriptionHelper.id(), 88 new ComponentPortDescriptionFactory()); 89 90 register_value_factory(org.omg.Components.ConfigValueHelper.id(), 91 new ConfigValueFactory()); 92 93 register_value_factory(org.omg.Components.ConnectionDescriptionHelper.id(), 94 new ConnectionDescriptionFactory()); 95 96 register_value_factory(org.omg.Components.ConsumerDescriptionHelper.id(), 97 new ConsumerDescriptionFactory()); 98 99 register_value_factory(org.omg.Components.CookieHelper.id(), 100 new CookieFactory()); 101 102 register_value_factory(org.omg.Components.EmitterDescriptionHelper.id(), 103 new EmitterDescriptionFactory()); 104 105 register_value_factory(org.omg.Components.FacetDescriptionHelper.id(), 106 new FacetDescriptionFactory()); 107 108 register_value_factory(org.omg.Components.FacetDescriptionHelper.id(), 109 new FacetDescriptionFactory()); 110 111 register_value_factory(org.omg.Components.PublisherDescriptionHelper.id(), 112 new PublisherDescriptionFactory()); 113 114 register_value_factory(org.omg.Components.ReceptacleDescriptionHelper.id(), 115 new ReceptacleDescriptionFactory()); 116 117 register_value_factory(org.omg.Components.SubscriberDescriptionHelper.id(), 118 new SubscriberDescriptionFactory()); 119 } 120 121 124 protected static void 125 create_home_manager() 126 { 127 HomeManagerImpl manager = new HomeManagerImpl(); 130 131 org.omg.CORBA.Object ref = manager._this_object(org.objectweb.openccm.corba.TheORB.getORB()); 133 HomeManager managerRef = HomeManagerHelper.narrow(ref); 134 135 home_manager_ = managerRef; 137 138 org.objectweb.openccm.corba.TheORB.register_initial_reference( 140 "ComponentHomeFinder", managerRef); 141 } 142 143 149 154 public static void 155 init() 156 { 157 if(already_initialized_ == false) 158 { 159 register_valuetype_factories(); 161 162 create_home_manager(); 164 165 already_initialized_ = true; 166 } 167 } 168 169 176 public static void 177 init(org.omg.CORBA.ORB orb) 178 { 179 org.objectweb.openccm.corba.TheORB.setORB(orb); 181 182 init(); 184 } 185 186 196 public static org.omg.CORBA.ORB 197 init(String [] args) 198 { 199 org.objectweb.openccm.corba.TheORB.initialize(args); 201 202 init(); 204 205 return org.objectweb.openccm.corba.TheORB.getORB(); 207 } 208 209 215 public static void 216 register_value_factory(String id, 217 org.omg.CORBA.portable.ValueFactory factory) 218 { 219 org.objectweb.openccm.corba.TheORB.register_value_factory(id, factory); 220 } 221 222 225 public static HomeManager 226 get_home_manager() 227 { 228 return home_manager_; 229 } 230 } 231 | Popular Tags |