|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.avalon.fortress.impl.lookup.FortressServiceManager
This is the Default ServiceManager for the Container. It provides a very simple abstraction, and makes it easy for the Container to manage the references.
| Constructor Summary | |
FortressServiceManager(Container container,
ServiceManager parent)
This constructor is for a ContainerComponentManager with a parent ComponentLocator |
|
| Method Summary | |
boolean |
hasService(java.lang.String role)
Check to see if a Object exists for a key. |
java.lang.Object |
lookup(java.lang.String role)
Get the Object associated with the given key. |
void |
release(java.lang.Object component)
Return the Object when you are finished with it. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public FortressServiceManager(Container container,
ServiceManager parent)
throws java.lang.NullPointerException
container - the implparent - the parent service manager
java.lang.NullPointerException - if the supplied impl is null| Method Detail |
public java.lang.Object lookup(java.lang.String role)
throws ServiceException
ServiceManagerObject associated with the given key. For
instance, If the ServiceManager had a
LoggerComponent stored and referenced by key,
the following could be used:
try
{
LoggerComponent log;
myComponent = (LoggerComponent) manager.lookup( LoggerComponent.ROLE );
}
catch (...)
{
...
}
lookup in interface ServiceManagerrole - The lookup key of the Object to retrieve.
Object value
ServiceException - if an error occurspublic boolean hasService(java.lang.String role)
ServiceManagerObject exists for a key.
hasService in interface ServiceManagerrole - a string identifying the key to check.
public void release(java.lang.Object component)
ServiceManagerObject 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 ServiceManagercomponent - The Object we are releasing, may also be
a null reference
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||