Class AbstractServiceScheme<D extends ServiceDependencies>
java.lang.Object
com.tangosol.coherence.config.scheme.AbstractScheme
com.tangosol.coherence.config.scheme.AbstractServiceScheme<D>
- All Implemented Interfaces:
ServiceBuilder,Scheme,ServiceScheme
- Direct Known Subclasses:
AbstractCachingScheme,InvocationScheme,RemoteInvocationScheme
public abstract class AbstractServiceScheme<D extends ServiceDependencies>
extends AbstractScheme
implements ServiceBuilder, ServiceScheme
The
AbstractServiceScheme provides functionality common to all
schemes that use services. Some properties, such as listeners, are optional
and may not apply to every scheme.- Since:
- Coherence 12.1.2
- Author:
- pfm 2011.12.28
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DTheServiceDependenciesto be used to configure the services produced by this scheme.Fields inherited from interface com.tangosol.coherence.config.scheme.ServiceScheme
DELIM_APPLICATION_SCOPE, DELIM_DOMAIN_PARTITION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ServiceensureService(String sService, Cluster cluster) Call theCluster.ensureService(String, String)method to obtain the service.protected StringDefaultServiceName to use if none configured.Return the service name with any scoping applied.Return the scope name.Return theServiceBuilderthat is needed to build a service.Obtains theServiceDependenciesthat will be used to configureServiceproduced by this scheme.Return the service name.getXml()Deprecated.protected voidinjectScopeNameIntoService(Service service) booleanReturn true if the service has auto-start enabled.abstract booleanReturn true if a running cluster is needed before using a service.realizeService(ParameterResolver resolver, ClassLoader loader, Cluster cluster) Realize (ensure) a Service.voidsetAutoStart(boolean fEnabled) Set the auto-start enabled flag.voidsetScopeName(String sName) Set the scope name.voidsetServiceDependencies(D dependencies) Set theServiceDependenciesto be used by this scheme when configuring a newly realizedService.voidsetServiceName(String sName) Set the service name.voidsetXml(XmlElement element) Deprecated.Methods inherited from class com.tangosol.coherence.config.scheme.AbstractScheme
getSchemeName, isAnonymous, setSchemeName, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.tangosol.coherence.config.scheme.Scheme
getSchemeName, isAnonymousMethods inherited from interface com.tangosol.coherence.config.scheme.ServiceScheme
getNamedCollectionBuilder, getScopedServiceNameForProperty, getServiceType
-
Field Details
-
m_serviceDependencies
TheServiceDependenciesto be used to configure the services produced by this scheme.
-
-
Constructor Details
-
AbstractServiceScheme
public AbstractServiceScheme()
-
-
Method Details
-
realizeService
Realize (ensure) a Service. The returned Service is fully configured and ready to be used.- Specified by:
realizeServicein interfaceServiceBuilder- Parameters:
resolver- the ParameterResolverloader- the ClassLoadercluster- the Cluster which will already be running if necessary- Returns:
- the Service
-
isRunningClusterNeeded
public abstract boolean isRunningClusterNeeded()Return true if a running cluster is needed before using a service.- Specified by:
isRunningClusterNeededin interfaceServiceBuilder- Returns:
trueif a running cluster is needed before using a service
-
getScopeName
Return the scope name.- Specified by:
getScopeNamein interfaceServiceBuilder- Returns:
- the scope name
-
setScopeName
Set the scope name.- Parameters:
sName- the scope name
-
setXml
Deprecated.Deprecated: Set the XML so that we can create a Service using the SafeCluster.ensureService.- Specified by:
setXmlin interfaceServiceBuilder- Parameters:
element- the distributed-scheme XML
-
getXml
Deprecated.Return the XmlElement that contains the Service configuration.- Specified by:
getXmlin interfaceServiceBuilder- Returns:
- the XmlElement
-
isAutoStart
public boolean isAutoStart()Return true if the service has auto-start enabled.- Specified by:
isAutoStartin interfaceServiceScheme- Returns:
- the auto-start flag.
-
setAutoStart
Set the auto-start enabled flag.- Parameters:
fEnabled- the auto-start enabled flag
-
getServiceBuilder
Return theServiceBuilderthat is needed to build a service.- Specified by:
getServiceBuilderin interfaceServiceScheme- Returns:
- the
ServiceBuilderor null if the scheme does not support services.
-
setServiceName
Set the service name.- Parameters:
sName- the service name.
-
getServiceName
Return the service name.- Specified by:
getServiceNamein interfaceServiceScheme- Returns:
- the service name
-
getScopedServiceName
Return the service name with any scoping applied. The scoped name in general has the following format:[<domain-partition-name>'/'] [<application-scope>':'] <service-name>
- Specified by:
getScopedServiceNamein interfaceServiceScheme- Returns:
- the scoped service name
-
getEventInterceptorBuilders
Obtains theListofNamedEventInterceptorBuilders that have been defined for theServiceScheme.Note: For those
ServiceSchemes don't support event interceptors, the returned value must be an empty list.- Specified by:
getEventInterceptorBuildersin interfaceServiceScheme- Returns:
- an
ListoverNamedEventInterceptorBuilders
-
injectScopeNameIntoService
- Parameters:
service- The safe service
-
getServiceDependencies
Obtains theServiceDependenciesthat will be used to configureServiceproduced by this scheme.- Returns:
- the
ServiceDependencies
-
setServiceDependencies
Set theServiceDependenciesto be used by this scheme when configuring a newly realizedService.- Parameters:
dependencies- theServiceDependenciesobject
-
getDefaultServiceName
DefaultServiceName to use if none configured.- Returns:
- default service name
-
ensureService
Call theCluster.ensureService(String, String)method to obtain the service.- Parameters:
sService- the name of the servicecluster- theClusterto obtain the service from- Returns:
- the ensured service
-