1 26 27 package org.objectweb.openccm.Components; 28 29 import org.objectweb.openccm.Components.HomeManagerPOA; 30 import org.objectweb.openccm.Components.HomeInfo; 31 32 40 41 public class HomeManagerImpl 42 extends HomeManagerPOA 43 { 44 50 53 private org.objectweb.ccm.util.Table by_cookies_; 54 55 58 private org.objectweb.ccm.util.Table by_home_repids_; 59 60 63 private org.objectweb.ccm.util.Table by_component_repids_; 64 65 68 private org.objectweb.ccm.util.Table by_home_names_; 69 70 76 79 public 80 HomeManagerImpl() 81 { 82 by_cookies_ = new org.objectweb.ccm.util.Table(); 83 by_home_repids_ = new org.objectweb.ccm.util.Table(); 84 by_component_repids_ = new org.objectweb.ccm.util.Table(); 85 by_home_names_ = new org.objectweb.ccm.util.Table(); 86 } 87 88 94 100 106 112 public void 113 shutdown() 114 { 115 org.objectweb.openccm.corba.TheORB.shutdown(true); 116 } 117 118 124 138 public org.omg.Components.CCMHome 139 find_home_by_component_type(String comp_repid) 140 throws org.omg.Components.HomeNotFound 141 { 142 Object result = by_component_repids_.get(comp_repid); 144 145 if(result == null) 147 { 148 throw new org.omg.Components.HomeNotFound(); 149 } 150 151 return (org.omg.Components.CCMHome)result; 153 } 154 155 168 public org.omg.Components.CCMHome 169 find_home_by_home_type(String home_repid) 170 throws org.omg.Components.HomeNotFound 171 { 172 Object result = by_home_repids_.get(home_repid); 174 175 if(result == null) 177 { 178 throw new org.omg.Components.HomeNotFound(); 179 } 180 181 return (org.omg.Components.CCMHome)result; 183 } 184 185 198 public org.omg.Components.CCMHome 199 find_home_by_name(String home_name) 200 throws org.omg.Components.HomeNotFound 201 { 202 Object result = by_home_names_.get(home_name); 204 205 if(result == null) 207 { 208 throw new org.omg.Components.HomeNotFound(); 209 } 210 211 return (org.omg.Components.CCMHome)result; 213 } 214 215 221 234 public org.omg.Components.Cookie 235 register_home(org.omg.Components.CCMHome home, 236 String home_repid, 237 String component_repid, 238 String name) 239 { 240 by_home_repids_.put(home_repid, home); 242 243 by_component_repids_.put(component_repid, home); 245 246 by_home_names_.put(name, home); 248 249 org.omg.Components.Cookie cookie = CookieImpl.generate(); 251 252 by_cookies_.put(cookie, 254 new HomeInfo(home, 255 home_repid, 256 component_repid, 257 name) ); 258 259 return cookie; 261 } 262 263 274 public void 275 unregister_home(org.omg.Components.Cookie ck) 276 throws org.omg.Components.CookieRequired 277 { 278 HomeInfo home_info = (HomeInfo)by_cookies_.get(ck); 280 281 if(home_info == null) 283 { 284 throw new org.omg.Components.CookieRequired(); 285 } 286 287 by_home_repids_.remove(home_info.home_repid); 289 290 by_component_repids_.remove(home_info.component_repid); 292 293 by_home_names_.remove(home_info.name); 295 } 296 } 297 | Popular Tags |