### *** This class provides Binary Compatibility only, not Source Compatibility ***

Package com.sas.services

# Class ServiceConfiguration

java.lang.Object
com.sas.services.ServiceConfiguration

All Implemented Interfaces:
  `ServiceConfigurationInterface`, `Serializable`

Direct Known Subclasses:
  `DiscoveryServiceConfiguration`, `MetadataSourceConfiguration`, `ServiceDiscoveryConfiguration`

@SASScope("ALL") @BinaryCompatibilityOnly public class ServiceConfiguration extends Object implements ServiceConfigurationInterface
Configuration data for a service.

A map is employed to store a service's various configurations.

Since:
  1.0
See Also:
  - Serialized Form

- ## Field Summary

  ### Fields inherited from interface com.sas.services.ServiceConfigurationInterface

  `CONFIGURATION_METADATA_SOURCE, CONFIGURATION_SERVICE_DISCOVERY`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ServiceConfiguration()`
  Constructs a default instance of a service configuration which is basically a map of 0..* ancillary configurations.
  `ServiceConfiguration(Object initializationObject)`
  Constructs an instance with the specified initialization object.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final void`
  `addServiceConfiguration(Object key, ServiceConfigurationInterface serviceConfiguration)`
  Adds a service configuration keyed by the specified value.
  `final Environment`
  `getEnvironment()`
  Gets the environment object.
  `final Object`
  `getInitializationObject()`
  Gets an object that is to be used to initialize or reconfigure a service.
  `final ServiceConfigurationInterface`
  `getServiceConfiguration(Object key)`
  Gets the ancillary service configuration associated with the specified key.
  `final Iterator<ServiceConfigurationInterface>`
  `getServiceConfigurations()`
  Gets an iterator of all of the ancillary service configurations.
  `final void`
  `removeServiceConfiguration(Object key)`
  Removes the ancillary service configuration associated with the specified key.
  `final void`
  `setEnvironment(Environment environment)`
  Sets the environment object.
  `final void`
  `setInitializationObject(Object initializationObject)`
  Sets an object that is to be used to initialize or reconfigure a service.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ServiceConfiguration

    public ServiceConfiguration()
    Constructs a default instance of a service configuration which is basically a map of 0..* ancillary configurations.

  - ### ServiceConfiguration

    public ServiceConfiguration(Object initializationObject)
    Constructs an instance with the specified initialization object. This initialization object will only be used by the service in the instantiating process. Its attribute is marked transient to prevent it from being marshaled to remote clients.
    Parameters:
      `initializationObject` - An object to be used to initialize.

- ## Method Details

  - ### addServiceConfiguration

    public final void addServiceConfiguration(Object key, ServiceConfigurationInterface serviceConfiguration)
    Adds a service configuration keyed by the specified value. Note that the service configuration must be serializable.
    Specified by:
      `addServiceConfiguration` in interface `ServiceConfigurationInterface`
    Parameters:
      `key` - Key to be associated with this configuration.
      `serviceConfiguration` - A configuration to be associated with the service using the specified key.
    Throws:
      `IllegalArgumentException` - if a parameter is specified which is `null` or not serializable.

  - ### removeServiceConfiguration

    public final void removeServiceConfiguration(Object key)
    Removes the ancillary service configuration associated with the specified key.
    Specified by:
      `removeServiceConfiguration` in interface `ServiceConfigurationInterface`
    Parameters:
      `key` - Ancillary service configuration lookup key.

  - ### getServiceConfiguration

    public final ServiceConfigurationInterface getServiceConfiguration(Object key)
    Gets the ancillary service configuration associated with the specified key.
    Specified by:
      `getServiceConfiguration` in interface `ServiceConfigurationInterface`
    Parameters:
      `key` - Ancillary service configuration lookup key.
    Returns:
      Ancillary service configuration associated with the specified lookup key or `null` if a configuration is not defined for the key.

  - ### getServiceConfigurations

    public final Iterator<ServiceConfigurationInterface> getServiceConfigurations()
    Gets an iterator of all of the ancillary service configurations. The iterated type will be `ServiceConfigurationInterface`.
    Specified by:
      `getServiceConfigurations` in interface `ServiceConfigurationInterface`
    Returns:
      Iterator of ancillary configurations.

  - ### getInitializationObject

    public final Object getInitializationObject()
    Gets an object that is to be used to initialize or reconfigure a service.
    Specified by:
      `getInitializationObject` in interface `ServiceConfigurationInterface`
    Returns:
      Initialization object

  - ### setInitializationObject

    public final void setInitializationObject(Object initializationObject)
    Sets an object that is to be used to initialize or reconfigure a service.
    Specified by:
      `setInitializationObject` in interface `ServiceConfigurationInterface`
    Parameters:
      `initializationObject` - Object containing data to initialize or reconfigure a service.

  - ### getEnvironment

    public final Environment getEnvironment()
    Gets the environment object. The environment object encapsulates runtime services provided by the container.
    Specified by:
      `getEnvironment` in interface `ServiceConfigurationInterface`
    Returns:
      the environment object. May be `null`.

  - ### setEnvironment

    public final void setEnvironment(Environment environment)
    Sets the environment object. The environment object encapsulates runtime services provided by the container.
    Parameters:
      `environment` - the environment object.