org.apache.avalon.framework.service
Class DefaultServiceManager
java.lang.Object
org.apache.avalon.framework.service.DefaultServiceManager
- ServiceManager
public class DefaultServiceManager
extends java.lang.Object
implements ServiceManager
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.
CVS $Revision: 1.20 $ $Date: 2004/02/11 14:34:26 $
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 .
|
DefaultServiceManager
public DefaultServiceManager()
Construct ServiceManager
with no parent.
DefaultServiceManager
public DefaultServiceManager(ServiceManager parent)
Construct ServiceManager
with specified parent.
parent
- this ServiceManager
's parent
checkWriteable
protected final void checkWriteable()
throws IllegalStateException
Checks if this ServiceManager
is writeable.
getObjectMap
protected final Map getObjectMap()
Helper method for subclasses to retrieve object map.
getParent
protected final ServiceManager getParent()
Helper method for subclasses to retrieve parent.
- the parent
ServiceManager
hasService
public boolean hasService(String key)
Check to see if a Object
exists for a key.
key
- a string identifying the key to check.
- True if the object exists, False if it does not.
lookup
public Object lookup(String key)
throws ServiceException
Retrieve Object
by key from ServiceManager
.
makeReadOnly
public void makeReadOnly()
Makes this ServiceManager
read-only.
put
public void put(String key,
Object object)
Place Object
into ServiceManager
.
key
- the object's keyobject
- an Object
value
release
public void release(Object object)
Release the Object
.
object
- The Object
to release.
toString
public String toString()
Build a human readable representation of this
ServiceManager
.
- the description of this
ServiceManager