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 TypeMethodDescriptiongetService(ServiceConfigurationInterface serviceConfiguration) Gets a service that has been initialized with the specified service configuration.getService(ServiceConfigurationInterface serviceConfiguration, DiscoveryServiceInterface discoveryService) Gets a service initialized with the specified service configuration.Gets a profile of a service which can be created by this service factory.booleanDetermines 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.RemoteServiceInterfaceis 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.RemoteServiceInterfaceis 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:
falseif this factory allows creation of multiple services by calling getService method ortrueif 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.
-