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

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

Deprecated. ECM is no longer supported

final class ServiceManagerReferenceProxy
extends AbstractReferenceProxy
implements org.apache.avalon.framework.service.ServiceManager

Reference Proxy to a ServiceManager

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.service.ServiceManager m_serviceManager
          Deprecated.  
 
Constructor Summary
ServiceManagerReferenceProxy(org.apache.avalon.framework.service.ServiceManager serviceManager, AbstractReferenceProxyLatch latch, java.lang.String name)
          Deprecated. Create a new proxy.
 
Method Summary
 boolean hasService(java.lang.String role)
          Deprecated. Check to see if a Object exists for a role.
 java.lang.Object lookup(java.lang.String role)
          Deprecated. Get the Object associated with the given role.
 void release(java.lang.Object service)
          Deprecated. Return the Object 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_serviceManager

private org.apache.avalon.framework.service.ServiceManager m_serviceManager
Deprecated. 
Constructor Detail

ServiceManagerReferenceProxy

ServiceManagerReferenceProxy(org.apache.avalon.framework.service.ServiceManager serviceManager,
                             AbstractReferenceProxyLatch latch,
                             java.lang.String name)
Deprecated. 
Create a new proxy.

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

lookup

public java.lang.Object lookup(java.lang.String role)
                        throws org.apache.avalon.framework.service.ServiceException
Deprecated. 
Get the Object associated with the given role. For instance, If the ServiceManager 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.service.ServiceManager
Parameters:
role - The role name of the Object to retrieve.
Returns:
an Object value
Throws:
org.apache.avalon.framework.service.ServiceException - if an error occurs

hasService

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

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

release

public void release(java.lang.Object service)
Deprecated. 
Return the Object when you are finished with it. This allows the ServiceManager to handle the End-Of-Life Lifecycle events associated with the Object. Please note, that no Exception should be thrown at this point. This is to allow easy use of the ServiceManager system without having to trap Exceptions on a release.

Specified by:
release in interface org.apache.avalon.framework.service.ServiceManager
Parameters:
object - The Object we are releasing.