|
|||||||||||
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 java.util.Map |
getObjectMap()
Helper method for subclasses to retrieve object map. |
protected ServiceManager |
getParent()
Helper method for subclasses to retrieve parent. |
boolean |
hasService(java.lang.String key)
Check to see if a Object exists for a key. |
java.lang.Object |
lookup(java.lang.String key)
Retrieve Object by key from ServiceManager . |
void |
makeReadOnly()
Makes this ServiceManager read-only. |
void |
put(java.lang.String key,
java.lang.Object object)
Place Object into ServiceManager . |
void |
release(java.lang.Object object)
Release the Object . |
java.lang.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 parentMethod Detail |
public java.lang.Object lookup(java.lang.String key) throws ServiceException
Object
by key from ServiceManager
.
lookup
in interface ServiceManager
key
- the key
Object
ServiceException
- if an error occurspublic boolean hasService(java.lang.String key)
Object
exists for a key.
hasService
in interface ServiceManager
key
- a string identifying the key to check.
public void put(java.lang.String key, java.lang.Object object)
Object
into ServiceManager
.
key
- the object's keyobject
- an Object
valuepublic java.lang.String toString()
ServiceManager
.
ServiceManager
protected final ServiceManager getParent()
ServiceManager
protected final java.util.Map getObjectMap()
public void makeReadOnly()
ServiceManager
read-only.
protected final void checkWriteable() throws java.lang.IllegalStateException
ServiceManager
is writeable.
java.lang.IllegalStateException
- if this ServiceManager
is
read-onlypublic void release(java.lang.Object object)
Object
.
release
in interface ServiceManager
object
- The Object
to release.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |