Class DefaultServiceManager
java.lang.Object
org.apache.avalon.framework.service.DefaultServiceManager
- All Implemented Interfaces:
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.- Version:
- CVS $Revision: 1.20 $ $Date: 2004/02/11 14:34:26 $
- Author:
- Avalon Development Team
-
Constructor Summary
ConstructorsConstructorDescriptionConstructServiceManagerwith no parent.DefaultServiceManager(ServiceManager parent) ConstructServiceManagerwith specified parent. -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidChecks if thisServiceManageris writeable.protected final MapHelper method for subclasses to retrieve object map.protected final ServiceManagerHelper method for subclasses to retrieve parent.booleanhasService(String key) Check to see if aObjectexists for a key.RetrieveObjectby key fromServiceManager.voidMakes thisServiceManagerread-only.voidPlaceObjectintoServiceManager.voidRelease theObject.toString()Build a human readable representation of thisServiceManager.
-
Constructor Details
-
DefaultServiceManager
public DefaultServiceManager()ConstructServiceManagerwith no parent. -
DefaultServiceManager
ConstructServiceManagerwith specified parent.- Parameters:
parent- thisServiceManager's parent
-
-
Method Details
-
lookup
RetrieveObjectby key fromServiceManager.- Specified by:
lookupin interfaceServiceManager- Parameters:
key- the key- Returns:
- the
Object - Throws:
ServiceException- if an error occurs
-
hasService
Check to see if aObjectexists for a key.- Specified by:
hasServicein interfaceServiceManager- Parameters:
key- a string identifying the key to check.- Returns:
- True if the object exists, False if it does not.
-
put
PlaceObjectintoServiceManager.- Parameters:
key- the object's keyobject- anObjectvalue
-
toString
Build a human readable representation of thisServiceManager. -
getParent
Helper method for subclasses to retrieve parent.- Returns:
- the parent
ServiceManager
-
getObjectMap
Helper method for subclasses to retrieve object map.- Returns:
- the object map
-
makeReadOnly
public void makeReadOnly()Makes thisServiceManagerread-only. -
checkWriteable
Checks if thisServiceManageris writeable.- Throws:
IllegalStateException- if thisServiceManageris read-only
-
release
Release theObject.- Specified by:
releasein interfaceServiceManager- Parameters:
object- TheObjectto release.
-