org.apache.avalon.excalibur.component.servlet
Class ComponentManagerReferenceProxy

java.lang.Object
  extended by org.apache.avalon.excalibur.component.servlet.AbstractReferenceProxy
      extended by org.apache.avalon.excalibur.component.servlet.ComponentManagerReferenceProxy
All Implemented Interfaces:
ReferenceProxy, org.apache.avalon.framework.component.ComponentManager

Deprecated. The ComponentManager interface has been deprecated in favor of the ServiceManager.

final class ComponentManagerReferenceProxy
extends AbstractReferenceProxy
implements org.apache.avalon.framework.component.ComponentManager

Reference Proxy to a ComponentManager

Since:
4.2
Version:
CVS $Revision: 1.4 $ $Date: 2004/02/28 11:47:16 $
Author:
Avalon Development Team

Field Summary
private  org.apache.avalon.framework.component.ComponentManager m_componentManager
          Deprecated.  
 
Constructor Summary
ComponentManagerReferenceProxy(org.apache.avalon.framework.component.ComponentManager componentManager, AbstractReferenceProxyLatch latch, java.lang.String name)
          Deprecated. Create a new proxy.
 
Method Summary
 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.
 
Methods inherited from class org.apache.avalon.excalibur.component.servlet.AbstractReferenceProxy
finalize, getName
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_componentManager

private org.apache.avalon.framework.component.ComponentManager m_componentManager
Deprecated. 
Constructor Detail

ComponentManagerReferenceProxy

ComponentManagerReferenceProxy(org.apache.avalon.framework.component.ComponentManager componentManager,
                               AbstractReferenceProxyLatch latch,
                               java.lang.String name)
Deprecated. 
Create a new proxy.

Parameters:
componentManager - ComponentManager being proxied.
latch - Latch wich will be notified when this proxy is finalized.
name - Name of the proxy.
Method Detail

lookup

public org.apache.avalon.framework.component.Component lookup(java.lang.String role)
                                                       throws org.apache.avalon.framework.component.ComponentException
Deprecated. 
Get the 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 (...)
 {
     ...
 }
 

Specified by:
lookup in interface org.apache.avalon.framework.component.ComponentManager
Parameters:
role - The role name of the Component to retrieve.
Returns:
the desired component
Throws:
org.apache.avalon.framework.component.ComponentException - if an error occurs

hasComponent

public boolean hasComponent(java.lang.String role)
Deprecated. 
Check to see if a Component exists for a role.

Specified by:
hasComponent in interface org.apache.avalon.framework.component.ComponentManager
Parameters:
role - a string identifying the role to check.
Returns:
True if the component exists, False if it does not.

release

public void release(org.apache.avalon.framework.component.Component component)
Deprecated. 
Return the 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.

Specified by:
release in interface org.apache.avalon.framework.component.ComponentManager
Parameters:
component - The Component we are releasing.