final class ServiceManagerReferenceProxy extends AbstractReferenceProxy implements org.apache.avalon.framework.service.ServiceManager
| Modifier and Type | Field and Description |
|---|---|
private org.apache.avalon.framework.service.ServiceManager |
m_serviceManager
Deprecated.
|
| Constructor and Description |
|---|
ServiceManagerReferenceProxy(org.apache.avalon.framework.service.ServiceManager serviceManager,
AbstractReferenceProxyLatch latch,
java.lang.String name)
Deprecated.
Create a new proxy.
|
| Modifier and Type | Method and Description |
|---|---|
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. |
finalize, getNameprivate org.apache.avalon.framework.service.ServiceManager m_serviceManager
ServiceManagerReferenceProxy(org.apache.avalon.framework.service.ServiceManager serviceManager,
AbstractReferenceProxyLatch latch,
java.lang.String name)
serviceManager - ServiceManager being proxied.latch - Latch wich will be notified when this proxy is finalized.name - Name of the proxy.public java.lang.Object lookup(java.lang.String role)
throws org.apache.avalon.framework.service.ServiceException
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 (...)
{
...
}
lookup in interface org.apache.avalon.framework.service.ServiceManagerrole - The role name of the Object to retrieve.Object valueorg.apache.avalon.framework.service.ServiceException - if an error occurspublic boolean hasService(java.lang.String role)
Object exists for a role.hasService in interface org.apache.avalon.framework.service.ServiceManagerrole - a string identifying the role to check.public void release(java.lang.Object service)
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.release in interface org.apache.avalon.framework.service.ServiceManagerobject - The Object we are releasing.