com.cafesoft.core.service
Class StandardServiceConfig

java.lang.Object
  extended by com.cafesoft.core.service.StandardServiceConfig
All Implemented Interfaces:
ServiceConfig

public class StandardServiceConfig
extends Object
implements ServiceConfig

StandardServiceConfig provides the standard implementation of ServiceConfig, which provides a Service with configuration parameters and it's execution context.


Constructor Summary
StandardServiceConfig(String id, Properties prop, ServiceContext context)
          Create a new StandardServiceConfig.
 
Method Summary
 String getId()
          Get the Service identifier.
 String getInitParameter(String name)
          Returns a String containing the value of the named initialization parameter.
 String getInitParameter(String name, String defaultValue)
          Returns a String containing the value of the named initialization parameter or the default value.
 Iterator getInitParameterNames()
          Returns the names of the Security Domains's initialization parameters as an Iterator of String objects, or an empty Iterator if the Security Domain has no initialization parameters.
 ServiceContext getServiceContext()
          Returns a reference to the ServiceContext in which the Service is executing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardServiceConfig

public StandardServiceConfig(String id,
                             Properties prop,
                             ServiceContext context)
Create a new StandardServiceConfig.

Parameters:
id - the Service identifier, which must be unique within the ServiceManager managing the associated Service.
prop - a Properties object containg the Service initialization parameters accessible via getInitParameter(name).
context - the ServiceContext implementation.
Method Detail

getId

public String getId()
Get the Service identifier.

Specified by:
getId in interface ServiceConfig
Returns:
the identifier for the Service.

getServiceContext

public ServiceContext getServiceContext()
Returns a reference to the ServiceContext in which the Service is executing.

Specified by:
getServiceContext in interface ServiceConfig
Returns:
the ServiceContext
See Also:
ServiceContext

getInitParameter

public String getInitParameter(String name)
Returns a String containing the value of the named initialization parameter.

Specified by:
getInitParameter in interface ServiceConfig
Parameters:
name - a String specifying the name of the initialization parameter.
Returns:
a String containing the value of the initialization parameter or null if the parameter does not exist.

getInitParameter

public String getInitParameter(String name,
                               String defaultValue)
Returns a String containing the value of the named initialization parameter or the default value.

Specified by:
getInitParameter in interface ServiceConfig
Parameters:
name - a String specifying the name of the initialization parameter
defaultValue - the default value to be returned if the initialization parameter does not exist or it's value is null
Returns:
a String containing the value of the initialization parameter or null if the parameter does not exist

getInitParameterNames

public Iterator getInitParameterNames()
Returns the names of the Security Domains's initialization parameters as an Iterator of String objects, or an empty Iterator if the Security Domain has no initialization parameters.

Specified by:
getInitParameterNames in interface ServiceConfig
Returns:
an Iterator of String objects containing the names of the Services's initialization parameters


Generated on 10:38:35 AM April 14, 2011, © 1996-2010 Cafésoft LLC. All rights reserved.