| java.lang.Object com.sun.portal.common.service.impl.ServiceContextImpl
ServiceContextImpl | public class ServiceContextImpl implements ServiceContext(Code) | | Defines a set of methods that a services uses to communicate with
its service container.
A ServiceContext groups a set of services.
The ServiceContext object is contained within the ServiceConfig
object, which the service container provides the service when the
service is initialized.
author: Alejandro Abdelnur |
Inner Class :static class ServiceData | |
Method Summary | |
synchronized void | destroy() Destroys all the services in the context. | public Object | getAttribute(String name) Returns the service container attribute with the given name, or null
if there is no attribute by that name. | public Iterator | getAttributeNames() Returns an Iterator containing the attribute names available within
this service context. | public String | getInitParameter(String name) Returns a String containing the value of the named context-wide
initialization parameter, or null if the parameter does not exist. | public Iterator | getInitParameterNames() Returns the names of the context's initialization parameters as
an Iterator of String objects, or an empty Iterator if the context
has no initialization parameters. | public Logger | getLogger() Returns the context's logger object. | public Service | getService(String name) Returns a service from a ServiceContext. | synchronized void | init() Initializes all the services specified in the constructor. | public void | removeAttribute(String name) Removes the attribute with the given name from the service context. | public void | setAttribute(String name, Object value) Binds an object to a given attribute name in this service context. |
EXCO_OFFSET | final public static int EXCO_OFFSET(Code) | | |
EXCO_SERVICE_DESTROY | final public static int EXCO_SERVICE_DESTROY(Code) | | |
EXCO_SERVICE_DESTROY_EXCEPTION | final public static int EXCO_SERVICE_DESTROY_EXCEPTION(Code) | | |
EXCO_SERVICE_DESTROY_TIMEOUT | final public static int EXCO_SERVICE_DESTROY_TIMEOUT(Code) | | |
EXCO_SERVICE_INIT | final public static int EXCO_SERVICE_INIT(Code) | | |
EXCO_SERVICE_INIT_EXCEPTION | final public static int EXCO_SERVICE_INIT_EXCEPTION(Code) | | |
EXCO_SERVICE_INIT_TIMEOUT | final public static int EXCO_SERVICE_INIT_TIMEOUT(Code) | | |
ServiceContextImpl | ServiceContextImpl(String name, Map initParams, ServiceData[] servicesData)(Code) | | Creates a ServiceContext object.
Parameters: initParams - Map containing all the context initializationparameters Parameters: servicesData - array containing all the information necessaryto manage the defined services. |
destroy | synchronized void destroy()(Code) | | Destroys all the services in the context.
|
getAttribute | public Object getAttribute(String name)(Code) | | Returns the service container attribute with the given name, or null
if there is no attribute by that name.
Parameters: name - a String specifying the name of the attribute an Object containing the value of the attribute, or nullif no attribute exists matching the given name |
getAttributeNames | public Iterator getAttributeNames()(Code) | | Returns an Iterator containing the attribute names available within
this service context. Use the getAttribute(java.lang.String) method
with an attribute name to get the value of an attribute.
an Iterator of attribute names |
getInitParameter | public String getInitParameter(String name)(Code) | | Returns a String containing the value of the named context-wide
initialization parameter, or null if the parameter does not exist.
Parameters: name - a String containing the name of the parameter whosevalue is requested a String containing at value of the specified parameter |
getInitParameterNames | public Iterator getInitParameterNames()(Code) | | Returns the names of the context's initialization parameters as
an Iterator of String objects, or an empty Iterator if the context
has no initialization parameters.
an Iterator of String objects containing the names of thecontext's initialization parameters |
getLogger | public Logger getLogger()(Code) | | Returns the context's logger object.
the Logger object associated with the context. |
getService | public Service getService(String name)(Code) | | Returns a service from a ServiceContext.
Parameters: name - a String with the name ofthe service to retrieve the service with the specified name or null if theservice does not exist |
init | synchronized void init() throws ServiceException(Code) | | Initializes all the services specified in the constructor.
throws: ServiceException - if any of the services fails the initialization |
removeAttribute | public void removeAttribute(String name)(Code) | | Removes the attribute with the given name from the service context.
After removal, subsequent calls to getAttribute(java.lang.String)
to retrieve the attribute's value will return null.
Parameters: name - a String specifying the name of the attribute |
setAttribute | public void setAttribute(String name, Object value)(Code) | | Binds an object to a given attribute name in this service context.
If the name specified is already used for an attribute, this method
will replace the attribute with the new to the new attribute.
Parameters: name - a String specifying the name of the attribute value an Object representing the attribute to be bound |
|
|