Class AbstractServiceFactory
- All Implemented Interfaces:
ServiceFactoryInterface
- Direct Known Subclasses:
DiscoveryServiceFactory,EventBrokerDiscoveryServiceFactory,EventBrokerServiceFactory,SessionServiceFactory,StoredProcessServiceFactory
A concrete subclass must implement
getService(ServiceConfigurationInterface, DiscoveryServiceInterface)
that will be used to obtain an instance of a service given the specified service
configuration.
- Since:
- 1.1
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractServiceFactory(ServiceProfile serviceProfile) Constructs a default instance. -
Method Summary
Modifier and TypeMethodDescriptionfinal RemoteServiceInterfacegetService(ServiceConfigurationInterface serviceConfiguration) Gets a service from the factory and registers it with the local discovery service.abstract RemoteServiceInterfacegetService(ServiceConfigurationInterface serviceConfiguration, DiscoveryServiceInterface discoveryService) Gets a service initialized with the specified service configuration.final ServiceProfileGets a profile of a service which can be created by this service factory.final booleanDetermines whether or not the service factory allows only one instance of a service per application.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
AbstractServiceFactory
Constructs a default instance.Use this constructor if the service manufactured by the service factory does not permit is configuration to be updated in an additive manner.
- Parameters:
serviceProfile- The service's profile.
-
-
Method Details
-
isSingletonFactory
public final boolean isSingletonFactory()Determines whether or not the service factory allows only one instance of a service per application.- Specified by:
isSingletonFactoryin interfaceServiceFactoryInterface- Returns:
falseif this factory allows creation of multiple services by calling itsgetService(ServiceConfigurationInterface, DiscoveryServiceInterface)method ortrueif only one service is allowed per application.
-
getServiceProfile
Gets a profile of a service which can be created by this service factory.- Specified by:
getServiceProfilein interfaceServiceFactoryInterface- Returns:
- Service profile.
-
getService
public final RemoteServiceInterface getService(ServiceConfigurationInterface serviceConfiguration) throws ServiceException Gets a service from the factory and registers it with the local discovery service. Gets a service that has been initialized with the specified service configuration.RemoteServiceInterfaceis the base interface implemented by all services.The service obtained using this method will be registered with the
local discovery service. UsegetService(ServiceConfigurationInterface, DiscoveryServiceInterface)if you wish to register the service with a different discovery service.- Specified by:
getServicein interfaceServiceFactoryInterface- Parameters:
serviceConfiguration- Service configuration.- Returns:
- service implementation
- Throws:
ServiceException- if unable to obtain a service based upon the specified configuration.- See Also:
-
getService
public abstract RemoteServiceInterface getService(ServiceConfigurationInterface serviceConfiguration, DiscoveryServiceInterface discoveryService) throws ServiceException Description copied from interface:ServiceFactoryInterfaceGets a service initialized with the specified service configuration.RemoteServiceInterfaceis the base interface implemented by all services.- Specified by:
getServicein interfaceServiceFactoryInterface- 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.- See Also:
-