ComponentSelector selects Components based on a
hint. The contract is that all the Components implement the
same role.
A role is better understood by the analogy of a play. There are many different roles in a script. Any actor or actress can play any given part and you get the same results (phrases said, movements made, etc.). The exact nuances of the performance is different.
Below is a list of things that might be considered the same role:
The ComponentSelector does not specify the methodology of
getting the Component, merely the interface used to get it.
Therefore the ComponentSelector can be implemented with a
factory pattern, an object pool, or a simple Hashtable.
Deprecated:
Use org. instead.
org.apache.avalon.framework.component.Component , org.apache.avalon.framework.component.Composable , org.apache.avalon.framework.component.ComponentManager
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: True if the component exists, False if it does not.a string identifying the role to check. hint)Check to see if a |
| public void | |
| public Component |
| hasComponent | back to summary |
|---|---|
| public boolean hasComponent(Object hint) Check to see if a
| |
| release | back to summary |
|---|---|
| public void release(Component component) Return the
| |
| select | back to summary |
|---|---|
| public Component select(Object hint) throws ComponentException Select the
try
{
Generator input;
input = (Generator)selector.select( new URL("foo://demo/url") );
}
catch (...)
{
...
}
| |