|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.apache.avalon.framework.service.DefaultServiceManager
This class is a static implementation of a ServiceManager. Allow ineritance
and extension so you can generate a tree of ServiceManager each defining
Object scope.
| Constructor Summary | |
DefaultServiceManager()
Construct ServiceManager with no parent. |
|
DefaultServiceManager(ServiceManager parent)
Construct ServiceManager with specified parent. |
|
| Method Summary | |
protected void |
checkWriteable()
Checks if this ServiceManager is writeable. |
protected Map |
getObjectMap()
Helper method for subclasses to retrieve object map. |
protected ServiceManager |
getParent()
Helper method for subclasses to retrieve parent. |
boolean |
hasService(String key)
Check to see if a Object exists for a key. |
Object |
lookup(String key)
Retrieve Object by key from ServiceManager. |
void |
makeReadOnly()
Makes this ServiceManager read-only. |
void |
put(String key,
Object object)
Place Object into ServiceManager. |
void |
release(Object object)
Release the Object. |
String |
toString()
Build a human readable representation of this ServiceManager. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public DefaultServiceManager()
ServiceManager with no parent.
public DefaultServiceManager(ServiceManager parent)
ServiceManager with specified parent.
parent - this ServiceManager's parent| Method Detail |
public Object lookup(String key)
throws ServiceException
Object by key from ServiceManager.
lookup in interface ServiceManagerkey - the key
Object
ServiceException - if an error occurspublic boolean hasService(String key)
Object exists for a key.
hasService in interface ServiceManagerkey - a string identifying the key to check.
public void put(String key,
Object object)
Object into ServiceManager.
key - the object's keyobject - an Object valuepublic String toString()
ServiceManager.
toString in class ObjectServiceManagerprotected final ServiceManager getParent()
ServiceManagerprotected final Map getObjectMap()
public void makeReadOnly()
ServiceManager read-only.
protected final void checkWriteable()
throws IllegalStateException
ServiceManager is writeable.
IllegalStateException - if this ServiceManager is
read-onlypublic void release(Object object)
Object.
release in interface ServiceManagerobject - The Object to release.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||