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
ConstructorsConstructorDescriptionConstructServiceManager
with no parent.DefaultServiceManager
(ServiceManager parent) ConstructServiceManager
with specified parent. -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
Checks if thisServiceManager
is writeable.protected final Map
Helper method for subclasses to retrieve object map.protected final ServiceManager
Helper method for subclasses to retrieve parent.boolean
hasService
(String key) Check to see if aObject
exists for a key.RetrieveObject
by key fromServiceManager
.void
Makes thisServiceManager
read-only.void
PlaceObject
intoServiceManager
.void
Release theObject
.toString()
Build a human readable representation of thisServiceManager
.
-
Constructor Details
-
DefaultServiceManager
public DefaultServiceManager()ConstructServiceManager
with no parent. -
DefaultServiceManager
ConstructServiceManager
with specified parent.- Parameters:
parent
- thisServiceManager
's parent
-
-
Method Details
-
lookup
RetrieveObject
by key fromServiceManager
.- Specified by:
lookup
in interfaceServiceManager
- Parameters:
key
- the key- Returns:
- the
Object
- Throws:
ServiceException
- if an error occurs
-
hasService
Check to see if aObject
exists for a key.- Specified by:
hasService
in interfaceServiceManager
- Parameters:
key
- a string identifying the key to check.- Returns:
- True if the object exists, False if it does not.
-
put
PlaceObject
intoServiceManager
.- Parameters:
key
- the object's keyobject
- anObject
value
-
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 thisServiceManager
read-only. -
checkWriteable
Checks if thisServiceManager
is writeable.- Throws:
IllegalStateException
- if thisServiceManager
is read-only
-
release
Release theObject
.- Specified by:
release
in interfaceServiceManager
- Parameters:
object
- TheObject
to release.
-