Package com.sas.services

# Interface ServiceFactoryInterface

All Known Implementing Classes:
  `AbstractServiceFactory`, `DiscoveryServiceFactory`, `EventBrokerDiscoveryServiceFactory`, `EventBrokerServiceFactory`, `SessionServiceFactory`, `StoredProcessServiceFactory`

public interface ServiceFactoryInterface
An interface used to acquire an implementation of a service based upon a desired service configuration. Each service must provide its own factory implementation.

A naming convention of "XxxServiceFactory.java" is suggested where "Xxx" represents the service type. For example, a factory used to get an instance of a `AuthenticationServiceInterface` would be named "AuthenticationServiceFactory".

An abstract implementation of a service factory `AbstractServiceFactory` is available to be subclassed.

Since:
  1.0

- ## Method Summary

  Modifier and Type
  Method
  Description
  `RemoteServiceInterface`
  `getService(ServiceConfigurationInterface serviceConfiguration)`
  Gets a service that has been initialized with the specified service configuration.
  `RemoteServiceInterface`
  `getService(ServiceConfigurationInterface serviceConfiguration, DiscoveryServiceInterface discoveryService)`
  Gets a service initialized with the specified service configuration.
  `ServiceProfile`
  `getServiceProfile()`
  Gets a profile of a service which can be created by this service factory.
  `boolean`
  `isSingletonFactory()`
  Determines whether or not the service factory allows only one instance of a service per application.

- ## Method Details

  - ### getService

    RemoteServiceInterface getService(ServiceConfigurationInterface serviceConfiguration) throws ServiceException
    Gets a service that has been initialized with the specified service configuration.

    `RemoteServiceInterface` is the base interface implemented by all services.

    Parameters:
      `serviceConfiguration` - Service configuration.
    Returns:
      service implementation
    Throws:
      `ServiceException` - if unable to obtain a service based upon the specified configuration.

  - ### getService

    RemoteServiceInterface getService(ServiceConfigurationInterface serviceConfiguration, DiscoveryServiceInterface discoveryService) throws ServiceException
    Gets a service initialized with the specified service configuration.

    `RemoteServiceInterface` is the base interface implemented by all services.

    Parameters:
      `serviceConfiguration` - Service configuration.
      `discoveryService` - This discovery service which may be used to locate other services. A service which can be discovered must register itself with this discovery service.
    Returns:
      service implementation
    Throws:
      `ServiceException` - if unable to obtain a service based upon the specified configuration.

  - ### isSingletonFactory

    boolean isSingletonFactory()
    Determines whether or not the service factory allows only one instance of a service per application.
    Returns:
      `false` if this factory allows creation of multiple services by calling getService method or `true` if only one service is allowed per application.

  - ### getServiceProfile

    ServiceProfile getServiceProfile()
    Gets a profile of a service which can be created by this service factory.
    Returns:
      Service profile.