public class DefaultServiceManager extends Object implements ServiceManager
ServiceManager. Allow ineritance
and extension so you can generate a tree of ServiceManager each defining
Object scope.| Constructor and Description |
|---|
DefaultServiceManager()
Construct
ServiceManager with no parent. |
DefaultServiceManager(ServiceManager parent)
Construct
ServiceManager with specified parent. |
| Modifier and Type | Method and Description |
|---|---|
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. |
public DefaultServiceManager()
ServiceManager with no parent.public DefaultServiceManager(ServiceManager parent)
ServiceManager with specified parent.parent - this ServiceManager's parentpublic Object lookup(String key) throws ServiceException
Object by key from ServiceManager.lookup in interface ServiceManagerkey - the keyObjectServiceException - 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.protected 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.Copyright © 2021. All rights reserved.