|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Container
The facade interface which provides the full functionality of yan container.
Codehaus.org.
| Method Summary | ||
|---|---|---|
java.lang.Class |
getComponentType(java.lang.Object key)
Get the type of a component identified by a key. |
|
Dependency |
getDependency(java.lang.Object key)
Get the dependency for a component key. |
|
Dependency |
getDependencyOfType(java.lang.Class type)
Get the dependency for a component type. |
|
Factory |
getFactory(java.lang.Object key)
Create an instance of Factory for a component identified by a key. |
|
Factory |
getFactory(java.lang.Object key,
ComponentMap cmap)
Create an instance of Factory for a component identified by a key. |
|
|
getFactoryOfType(java.lang.Class<T> type)
Create an instance of Factory for a component of the provided type. |
|
|
getFactoryOfType(java.lang.Class<T> type,
ComponentMap cmap)
Create an instance of Factory for a component of the provided type. |
|
java.lang.Object |
getInstance(java.lang.Object key)
Create instance for a component identified by a key. |
|
java.lang.Object |
getInstance(java.lang.Object key,
ComponentMap cmap)
Create instance for a component identified by a key. |
|
|
getInstanceOfType(java.lang.Class<T> type)
Create component instance of the provided type. |
|
|
getInstanceOfType(java.lang.Class<T> type,
ComponentMap cmap)
Create component instance of the provided type. |
|
java.util.List |
getInstances()
Create instances of all the components stored in this container. |
|
java.util.List |
getInstances(ComponentMap cmap)
Create instances of all the components stored in this container. |
|
void |
getInstances(java.util.Map store)
Create instances of all the components stored in this container. |
|
void |
getInstances(java.util.Map store,
ComponentMap cmap)
Create instances of all the components stored in this container. |
|
|
getInstancesOfType(java.lang.Class<T> type)
Create component instances of a provided type. |
|
|
getInstancesOfType(java.lang.Class<T> type,
ComponentMap cmap)
Create component instances of a provided type. |
|
Container |
inherit(Registrar parent)
Create a new Container object which represents "this inherits parent" relationship. |
|
|
instantiateComponent(Creator<T> cc)
Instantiate component instance. |
|
|
instantiateComponent(java.lang.Object key,
Creator<T> cc)
Instantiate component instance. |
|
void |
registerComponent(Component cc)
Register a Component object in the container. |
|
void |
registerConstructor(java.lang.Class c)
Register a constructor in the container. |
|
void |
registerConstructor(java.lang.Class c,
java.lang.Class[] param_types)
Register a constructor in the container. |
|
void |
registerConstructor(java.lang.Object key,
java.lang.Class c)
Register a constructor in the container. |
|
void |
registerConstructor(java.lang.Object key,
java.lang.Class c,
java.lang.Class[] param_types)
Register a constructor in the container. |
|
void |
registerStaticMethod(java.lang.Class c,
java.lang.String name)
Register a component that uses a static method to create component instance. |
|
void |
registerStaticMethod(java.lang.Class c,
java.lang.String name,
java.lang.Class[] param_types)
Register a component that uses a static method to create component instance. |
|
void |
registerStaticMethod(java.lang.Object key,
java.lang.Class c,
java.lang.String name)
Register a component that uses a static method to create component instance. |
|
void |
registerStaticMethod(java.lang.Object key,
java.lang.Class c,
java.lang.String name,
java.lang.Class[] param_types)
Register a component that uses a static method to create component instance. |
|
void |
registerValue(java.lang.Object v)
Register a value in the container. |
|
void |
registerValue(java.lang.Object key,
java.lang.Object v)
Register a value in the container. |
|
void |
verify()
Verifies the components in this container. |
|
java.lang.Class |
verifyComponent(Component cc)
Verifies that a Component is valid using the current container in resolving dependency. |
|
java.lang.Class |
verifyKey(java.lang.Object key)
Verifies a component identified by key. |
|
java.lang.Class |
verifyType(java.lang.Class type)
Verifies a component for a type. |
|
| Methods inherited from interface jfun.yan.Registrar |
|---|
registerComponent, unregisterComponent, unregisterComponentsOfType, verify |
| Methods inherited from interface jfun.yan.ComponentMap |
|---|
containsKey, containsType, getComponent, getComponentOfType, getComponents, getComponentsOfType, getDependency, getDependencyOfType, keys |
| Method Detail |
|---|
<T> T instantiateComponent(Creator<T> cc)
throws AmbiguousComponentResolutionException,
ComponentInstantiationException,
CyclicDependencyException,
UnresolvedComponentException,
UnsatisfiedComponentException,
YanException
cc - the component to instantiate.
AmbiguousComponentResolutionException - if ambiguity happens.
ComponentInstantiationException - wrapper exception for any checked exception thrown out of the actual creation.
CyclicDependencyException - if cyclic dependency is detected.
UnresolvedComponentException - if this component or any dependent component cannot be resolved.
UnsatisfiedComponentException - if some requirement of the component cannot be satisfied.
YanException - for any other exception.
<T> T instantiateComponent(java.lang.Object key,
Creator<T> cc)
throws AmbiguousComponentResolutionException,
ComponentInstantiationException,
CyclicDependencyException,
UnresolvedComponentException,
UnsatisfiedComponentException,
YanException
key - the key of the component.cc - the component to instantiate.
AmbiguousComponentResolutionException - if ambiguity happens.
ComponentInstantiationException - wrapper exception for any checked exception thrown out of the actual creation.
CyclicDependencyException - if cyclic dependency is detected.
UnresolvedComponentException - if this component or any dependent component cannot be resolved.
UnsatisfiedComponentException - if some requirement of the component cannot be satisfied.
YanException - for any other exception.
<T> T getInstanceOfType(java.lang.Class<T> type,
ComponentMap cmap)
throws AmbiguousComponentResolutionException,
ComponentInstantiationException,
CyclicDependencyException,
UnresolvedComponentException,
UnsatisfiedComponentException,
YanException
type - the type.cmap - the container to resolve dependency.
AmbiguousComponentResolutionException - if ambiguity happens.
ComponentInstantiationException - wrapper exception for any checked exception thrown out of the actual creation.
CyclicDependencyException - if cyclic dependency is detected.
UnresolvedComponentException - if this component or any dependent component cannot be resolved.
UnsatisfiedComponentException - if some requirement of the component cannot be satisfied.
YanException - for any other exception.
<T> Factory<T> getFactoryOfType(java.lang.Class<T> type,
ComponentMap cmap)
throws AmbiguousComponentResolutionException,
UnresolvedComponentException,
YanException
Factory for a component of the provided type.
when Factory.create() is called, the component is instantiated.
type - the type.cmap - the container to resolve dependency.
AmbiguousComponentResolutionException - if ambiguity happens.
UnresolvedComponentException - if this component cannot be resolved.
YanException - for any other exception.
<T> java.util.List<T> getInstancesOfType(java.lang.Class<T> type,
ComponentMap cmap)
throws ComponentInstantiationException,
CyclicDependencyException,
UnresolvedComponentException,
UnsatisfiedComponentException,
YanException
type - the type.cmap - the container to resolve dependency.
ComponentInstantiationException - wrapper exception for any checked exception thrown out of the actual creation.
CyclicDependencyException - if cyclic dependency is detected.
UnresolvedComponentException - if this component or any dependent component cannot be resolved.
UnsatisfiedComponentException - if some requirement of the component cannot be satisfied.
YanException - for any other exception.
<T> T getInstanceOfType(java.lang.Class<T> type)
throws AmbiguousComponentResolutionException,
ComponentInstantiationException,
CyclicDependencyException,
UnresolvedComponentException,
UnsatisfiedComponentException,
YanException
type - the type.
AmbiguousComponentResolutionException - if ambiguity happens.
ComponentInstantiationException - wrapper exception for any checked exception thrown out of the actual creation.
CyclicDependencyException - if cyclic dependency is detected.
UnresolvedComponentException - if this component or any dependent component cannot be resolved.
UnsatisfiedComponentException - if some requirement of the component cannot be satisfied.
YanException - for any other exception.
<T> Factory<T> getFactoryOfType(java.lang.Class<T> type)
throws AmbiguousComponentResolutionException,
UnresolvedComponentException,
YanException
Factory for a component of the provided type.
when Factory.create() is called, the component is instantiated.
type - the type.
AmbiguousComponentResolutionException - if ambiguity happens.
UnresolvedComponentException - if this component or any dependent component cannot be resolved.
YanException - for any other exception.
<T> java.util.List<T> getInstancesOfType(java.lang.Class<T> type)
throws ComponentInstantiationException,
CyclicDependencyException,
UnresolvedComponentException,
UnsatisfiedComponentException,
YanException
type - the type.
ComponentInstantiationException - wrapper exception for any checked exception thrown out of the actual creation.
CyclicDependencyException - if cyclic dependency is detected.
UnresolvedComponentException - if this component or any dependent component cannot be resolved.
UnsatisfiedComponentException - if some requirement of the component cannot be satisfied.
YanException - for any other exception.
java.util.List getInstances()
throws ComponentInstantiationException,
CyclicDependencyException,
UnresolvedComponentException,
UnsatisfiedComponentException,
YanException
ComponentInstantiationException - wrapper exception for any checked exception thrown out of the actual creation.
CyclicDependencyException - if cyclic dependency is detected.
UnresolvedComponentException - if this component or any dependent component cannot be resolved.
UnsatisfiedComponentException - if some requirement of the component cannot be satisfied.
YanException - for any other exception.
void getInstances(java.util.Map store)
throws ComponentInstantiationException,
CyclicDependencyException,
UnresolvedComponentException,
UnsatisfiedComponentException,
YanException
store - the java.util.Map object to save the component instances.
ComponentInstantiationException - wrapper exception for any checked exception thrown out of the actual creation.
CyclicDependencyException - if cyclic dependency is detected.
UnresolvedComponentException - if this component or any dependent component cannot be resolved.
UnsatisfiedComponentException - if some requirement of the component cannot be satisfied.
YanException - for any other exception.
java.util.List getInstances(ComponentMap cmap)
throws ComponentInstantiationException,
CyclicDependencyException,
UnresolvedComponentException,
UnsatisfiedComponentException,
YanException
The dependencies are resolved in the current container.
cmap - the container in which to resolve dependency.
ComponentInstantiationException - wrapper exception for any checked exception thrown out of the actual creation.
CyclicDependencyException - if cyclic dependency is detected.
UnresolvedComponentException - if this component or any dependent component cannot be resolved.
UnsatisfiedComponentException - if some requirement of the component cannot be satisfied.
YanException - for any other exception.
void getInstances(java.util.Map store,
ComponentMap cmap)
throws ComponentInstantiationException,
CyclicDependencyException,
UnresolvedComponentException,
UnsatisfiedComponentException,
YanException
The dependencies are resolved in the current container.
store - the java.util.Map object to save the component instances.cmap - the container in which to resolve dependency.
ComponentInstantiationException - wrapper exception for any checked exception thrown out of the actual creation.
CyclicDependencyException - if cyclic dependency is detected.
UnresolvedComponentException - if this component or any dependent component cannot be resolved.
UnsatisfiedComponentException - if some requirement of the component cannot be satisfied.
YanException - for any other exception.Dependency getDependency(java.lang.Object key)
key - the component key.
Dependency getDependencyOfType(java.lang.Class type)
type - the component type.
void verify()
throws AmbiguousComponentResolutionException,
CyclicDependencyException,
UnresolvedComponentException,
UnsatisfiedComponentException,
YanException
AmbiguousComponentResolutionException - if ambiguity happens.
CyclicDependencyException - if cyclic dependency is detected.
UnresolvedComponentException - if any component cannot be resolved.
UnsatisfiedComponentException - if some requirement of a component cannot be satisfied.
YanException - for any other exception.
java.lang.Class verifyComponent(Component cc)
throws AmbiguousComponentResolutionException,
CyclicDependencyException,
UnsatisfiedComponentException,
YanException
cc - the component to verify.
AmbiguousComponentResolutionException - if ambiguity happens.
CyclicDependencyException - if cyclic dependency is detected.
UnsatisfiedComponentException - if some requirement of a component cannot be satisfied.
YanException - for any other exception.
java.lang.Class verifyKey(java.lang.Object key)
throws CyclicDependencyException,
UnresolvedComponentException,
UnsatisfiedComponentException,
YanException
key - the component key.
CyclicDependencyException - if cyclic dependency is detected.
UnresolvedComponentException - if the component cannot be resolved.
UnsatisfiedComponentException - if some requirement of the component cannot be satisfied.
YanException - for any other exception.
java.lang.Class verifyType(java.lang.Class type)
throws AmbiguousComponentResolutionException,
CyclicDependencyException,
UnsatisfiedComponentException,
YanException
type - the component type.
AmbiguousComponentResolutionException - if ambiguity happens.
CyclicDependencyException - if cyclic dependency is detected.
UnresolvedComponentException - if the component cannot be resolved.
UnsatisfiedComponentException - if some requirement of the component cannot be satisfied.
YanException - for any other exception.java.lang.Class getComponentType(java.lang.Object key)
key - the component key.
java.lang.Object getInstance(java.lang.Object key,
ComponentMap cmap)
throws ComponentInstantiationException,
CyclicDependencyException,
UnresolvedComponentException,
UnsatisfiedComponentException,
YanException
key - the component key.cmap - the container to resolve dependency.
ComponentInstantiationException - wrapper exception for any checked exception thrown out of the actual creation.
CyclicDependencyException - if cyclic dependency is detected.
UnresolvedComponentException - if this component or any dependent component cannot be resolved.
UnsatisfiedComponentException - if some requirement of the component cannot be satisfied.
YanException - for any other exception.
Factory getFactory(java.lang.Object key,
ComponentMap cmap)
throws UnresolvedComponentException,
YanException
Factory for a component identified by a key.
when Factory.create() is called, the component is instantiated.
key - the component key.cmap - the container to resolve dependency.
UnresolvedComponentException - if this component cannot be resolved.
YanException - for any other exception.
java.lang.Object getInstance(java.lang.Object key)
throws ComponentInstantiationException,
CyclicDependencyException,
UnresolvedComponentException,
UnsatisfiedComponentException,
YanException
key - the component key.
ComponentInstantiationException - wrapper exception for any checked exception thrown out of the actual creation.
CyclicDependencyException - if cyclic dependency is detected.
UnresolvedComponentException - if this component or any dependent component cannot be resolved.
UnsatisfiedComponentException - if some requirement of the component cannot be satisfied.
YanException - for any other exception.
Factory getFactory(java.lang.Object key)
throws UnresolvedComponentException,
YanException
Factory for a component identified by a key.
when Factory.create() is called, the component is instantiated.
key - the component key.
UnresolvedComponentException - if this component cannot be resolved.
YanException - for any other exception.
void registerValue(java.lang.Object key,
java.lang.Object v)
key - the key of the value.v - the value.void registerValue(java.lang.Object v)
v - the value.
void registerComponent(Component cc)
throws UnknownComponentTypeException
cc - the component.
UnknownComponentTypeException - if cc.getType() == null.void registerConstructor(java.lang.Class c)
c - the class containing the constructor.
void registerConstructor(java.lang.Object key,
java.lang.Class c)
key - the component key.c - the class containing the constructor.
void registerConstructor(java.lang.Class c,
java.lang.Class[] param_types)
c - the class containing the constructor.param_types - the parameter types of the constructor.
void registerConstructor(java.lang.Object key,
java.lang.Class c,
java.lang.Class[] param_types)
key - the component key.c - the class containing the constructor.param_types - the parameter types of the constructor.
void registerStaticMethod(java.lang.Class c,
java.lang.String name)
c - the class containing the static method.name - the method name.
void registerStaticMethod(java.lang.Object key,
java.lang.Class c,
java.lang.String name)
key - the component key.c - the class containing the static method.name - the method name.
void registerStaticMethod(java.lang.Class c,
java.lang.String name,
java.lang.Class[] param_types)
c - the class containing the static method.name - the method name.
void registerStaticMethod(java.lang.Object key,
java.lang.Class c,
java.lang.String name,
java.lang.Class[] param_types)
key - the component key.c - the class containing the static method.name - the method name.param_types - the parameter types.Container inherit(Registrar parent)
parent - the parent registrar.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||