final class ComponentManagerReferenceProxy extends AbstractReferenceProxy implements org.apache.avalon.framework.component.ComponentManager
| Modifier and Type | Field and Description |
|---|---|
private org.apache.avalon.framework.component.ComponentManager |
m_componentManager
Deprecated.
|
| Constructor and Description |
|---|
ComponentManagerReferenceProxy(org.apache.avalon.framework.component.ComponentManager componentManager,
AbstractReferenceProxyLatch latch,
java.lang.String name)
Deprecated.
Create a new proxy.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasComponent(java.lang.String role)
Deprecated.
Check to see if a
Component exists for a role. |
org.apache.avalon.framework.component.Component |
lookup(java.lang.String role)
Deprecated.
Get the
Component associated with the given role. |
void |
release(org.apache.avalon.framework.component.Component component)
Deprecated.
Return the
Component when you are finished with it. |
finalize, getNameprivate org.apache.avalon.framework.component.ComponentManager m_componentManager
ComponentManagerReferenceProxy(org.apache.avalon.framework.component.ComponentManager componentManager,
AbstractReferenceProxyLatch latch,
java.lang.String name)
componentManager - ComponentManager being proxied.latch - Latch wich will be notified when this proxy is finalized.name - Name of the proxy.public org.apache.avalon.framework.component.Component lookup(java.lang.String role)
throws org.apache.avalon.framework.component.ComponentException
Component associated with the given role. For
instance, If the ComponentManager had a
LoggerComponent stored and referenced by role, I would use
the following call:
try
{
MyComponent log;
myComponent = (MyComponent) manager.lookup(MyComponent.ROLE);
}
catch (...)
{
...
}
lookup in interface org.apache.avalon.framework.component.ComponentManagerrole - The role name of the Component to retrieve.org.apache.avalon.framework.component.ComponentException - if an error occurspublic boolean hasComponent(java.lang.String role)
Component exists for a role.hasComponent in interface org.apache.avalon.framework.component.ComponentManagerrole - a string identifying the role to check.public void release(org.apache.avalon.framework.component.Component component)
Component when you are finished with it. This
allows the ComponentManager to handle the End-Of-Life Lifecycle
events associated with the Component. Please note, that no Exceptions
should be thrown at this point. This is to allow easy use of the
ComponentManager system without having to trap Exceptions on a release.release in interface org.apache.avalon.framework.component.ComponentManagercomponent - The Component we are releasing.