1 8 14 package jfun.yan; 15 16 import java.util.List ; 17 18 import jfun.yan.factory.Factory; 19 20 21 30 public interface Container extends Registrar { 31 32 33 51 <T> T instantiateComponent(Creator<T> cc) 52 throws AmbiguousComponentResolutionException, 53 ComponentInstantiationException, 54 CyclicDependencyException, 55 UnresolvedComponentException, UnsatisfiedComponentException, 56 YanException; 57 76 <T> T instantiateComponent(Object key, Creator<T> cc) 77 throws AmbiguousComponentResolutionException, 78 ComponentInstantiationException, 79 CyclicDependencyException, 80 UnresolvedComponentException, UnsatisfiedComponentException, 81 YanException; 82 83 84 85 103 <T> T getInstanceOfType(Class <T> type, ComponentMap cmap) 104 throws AmbiguousComponentResolutionException, 105 ComponentInstantiationException, 106 CyclicDependencyException, 107 UnresolvedComponentException, UnsatisfiedComponentException, 108 YanException; 109 110 123 <T> Factory<T> getFactoryOfType(Class <T> type, ComponentMap cmap) 124 throws AmbiguousComponentResolutionException, 125 UnresolvedComponentException, YanException; 126 127 128 146 <T> List <T> getInstancesOfType(Class <T> type, ComponentMap cmap) 147 throws 148 ComponentInstantiationException, 149 CyclicDependencyException, 150 UnresolvedComponentException, UnsatisfiedComponentException, 151 YanException; 152 170 <T> T getInstanceOfType(Class <T> type) 171 throws AmbiguousComponentResolutionException, 172 ComponentInstantiationException, 173 CyclicDependencyException, 174 UnresolvedComponentException, UnsatisfiedComponentException, 175 YanException; 176 177 189 <T> Factory<T> getFactoryOfType(Class <T> type) 190 throws AmbiguousComponentResolutionException, 191 UnresolvedComponentException, YanException; 192 211 <T> List <T> getInstancesOfType(Class <T> type) 212 throws 213 ComponentInstantiationException, 214 CyclicDependencyException, 215 UnresolvedComponentException, UnsatisfiedComponentException, 216 YanException; 217 233 java.util.List getInstances() 234 throws 235 ComponentInstantiationException, 236 CyclicDependencyException, 237 UnresolvedComponentException, UnsatisfiedComponentException, 238 YanException; 239 240 258 void getInstances(java.util.Map store) 259 throws 260 ComponentInstantiationException, 261 CyclicDependencyException, 262 UnresolvedComponentException, UnsatisfiedComponentException, 263 YanException; 264 282 java.util.List getInstances(ComponentMap cmap) 283 throws 284 ComponentInstantiationException, 285 CyclicDependencyException, 286 UnresolvedComponentException, UnsatisfiedComponentException, 287 YanException; 288 289 309 void getInstances(java.util.Map store, ComponentMap cmap) 310 throws 311 ComponentInstantiationException, 312 CyclicDependencyException, 313 UnresolvedComponentException, UnsatisfiedComponentException, 314 YanException; 315 316 322 Dependency getDependency(Object key); 323 324 329 Dependency getDependencyOfType(Class type); 330 331 332 346 void verify() 347 throws AmbiguousComponentResolutionException, 348 CyclicDependencyException, 349 UnresolvedComponentException, UnsatisfiedComponentException, 350 YanException; 351 352 366 Class verifyComponent(Component cc) 367 throws AmbiguousComponentResolutionException, 368 CyclicDependencyException, 369 UnsatisfiedComponentException, 370 YanException; 371 372 385 Class verifyKey(Object key) 386 throws 387 CyclicDependencyException, 388 UnresolvedComponentException, UnsatisfiedComponentException, 389 YanException; 390 391 392 407 Class verifyType(Class type) 408 throws AmbiguousComponentResolutionException, 409 CyclicDependencyException, 410 UnsatisfiedComponentException, 411 YanException; 412 413 418 Class getComponentType(Object key); 419 435 Object getInstance(Object key, ComponentMap cmap) 436 throws 437 ComponentInstantiationException, 438 CyclicDependencyException, 439 UnresolvedComponentException, UnsatisfiedComponentException, 440 YanException; 441 442 453 Factory getFactory(Object key, ComponentMap cmap) 454 throws UnresolvedComponentException, YanException; 455 471 Object getInstance(Object key)throws 472 ComponentInstantiationException, 473 CyclicDependencyException, 474 UnresolvedComponentException, UnsatisfiedComponentException, 475 YanException; 476 486 Factory getFactory(Object key) 487 throws UnresolvedComponentException, YanException; 488 493 void registerValue(Object key, Object v); 494 495 500 void registerValue(Object v); 501 502 509 void registerComponent(Component cc) 510 throws UnknownComponentTypeException; 511 512 518 void registerConstructor(Class c); 519 525 void registerConstructor(Object key, Class c); 526 532 void registerConstructor(Class c, Class [] param_types); 533 540 void registerConstructor(Object key, Class c, 541 Class [] param_types); 542 543 549 void registerStaticMethod(Class c, String name); 550 557 void registerStaticMethod(Object key, Class c, String name); 558 564 void registerStaticMethod(Class c, String name, 565 Class [] param_types); 566 574 void registerStaticMethod(Object key, Class c, String name, 575 Class [] param_types); 576 577 587 Container inherit(Registrar parent); 588 589 } | Popular Tags |