|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjfun.yan.containers.SimpleRegistrar
public class SimpleRegistrar
A simple implementation of Registrar.
It ensures the Component objects and instances are retrieved and
created in the same order as the Component objects are registered.
This implementation enables auto-wiring.
It uses SimpleDependency to resolve parameters and properties.
It is also thread-safe.
Codehaus.org.
| Constructor Summary | |
|---|---|
SimpleRegistrar()
|
|
| Method Summary | |
|---|---|
boolean |
containsKey(java.lang.Object key)
Whether a Component with a certain key is contained in the map. |
boolean |
containsType(java.lang.Class type)
Whether a Component of a certain type or its sub-type is contained in the map. |
boolean |
equals(java.lang.Object obj)
|
Component |
getComponent(java.lang.Object key)
Gets a Component identified by a key. |
Component |
getComponentOfType(java.lang.Class type)
Gets a Component object of a certain type. |
java.util.Collection |
getComponents()
Gets all components stored in this map. |
java.util.List |
getComponentsOfType(java.lang.Class type)
Gets all component objects that are of a certain type. |
Dependency |
getDependency(java.lang.Object ckey,
ComponentMap cmap)
This uses SimpleDependency which resolves parameters and arguments by type. |
Dependency |
getDependencyOfType(java.lang.Class type,
ComponentMap cmap)
This uses SimpleDependency which resolves parameters and arguments by type. |
int |
hashCode()
|
java.util.Set |
keys()
Get all the component keys. |
void |
registerComponent(java.lang.Object key,
Component cc)
Register a Component identified by a key. |
int |
size()
|
java.lang.String |
toString()
|
void |
unregisterComponent(java.lang.Object key)
Unregister a component identified by a key. |
void |
unregisterComponentsOfType(java.lang.Class type)
Unregister components of a certain type. |
void |
verify(ComponentMap cmap)
Verifies that all the registered components can be satisfied. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleRegistrar()
| Method Detail |
|---|
public int size()
public java.util.Set keys()
ComponentMap
keys in interface ComponentMappublic java.util.Collection getComponents()
ComponentMap
getComponents in interface ComponentMappublic boolean containsKey(java.lang.Object key)
ComponentMap
containsKey in interface ComponentMapkey - the component key.
public Component getComponent(java.lang.Object key)
ComponentMap
getComponent in interface ComponentMapkey - the component key.
public boolean containsType(java.lang.Class type)
ComponentMap
containsType in interface ComponentMaptype - the type of the component.
public Component getComponentOfType(java.lang.Class type)
ComponentMap
getComponentOfType in interface ComponentMaptype - the component instance type.
public java.util.List getComponentsOfType(java.lang.Class type)
ComponentMap
getComponentsOfType in interface ComponentMaptype - the component instance type.
public void unregisterComponentsOfType(java.lang.Class type)
Registrar
unregisterComponentsOfType in interface Registrartype - the component instance type.
public void registerComponent(java.lang.Object key,
Component cc)
Registrar
registerComponent in interface Registrarkey - the component key.cc - the component.public void unregisterComponent(java.lang.Object key)
Registrar
unregisterComponent in interface Registrarkey - the component key.public void verify(ComponentMap cmap)
Registrar
verify in interface Registrarcmap - the ComponentMap from which
the parts of the registered components are obtained.
public Dependency getDependency(java.lang.Object ckey,
ComponentMap cmap)
getDependency in interface ComponentMapckey - The component key.cmap - The ComponentMap object from which the parts of
the component should be obtained.
This parameter is typically passed as 'this' so that the parts are
created in the same container.
When implementing container interaction such as inheritance,
this parameter may be passed as a different ComponentMap object.
public Dependency getDependencyOfType(java.lang.Class type,
ComponentMap cmap)
getDependencyOfType in interface ComponentMaptype - The component instance type.cmap - The ComponentMap object from which the parts of
the component should be obtained.
This parameter is typically passed as 'this' so that the parts are
created in the same container.
When implementing container interaction such as inheritance,
this parameter may be passed as a different ComponentMap object.
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||