Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


com.tangosol.coherence.config.scheme
Class AbstractServiceScheme

java.lang.Object
  extended by com.tangosol.coherence.config.scheme.AbstractScheme
      extended by com.tangosol.coherence.config.scheme.AbstractServiceScheme

All Implemented Interfaces:
ServiceBuilder, Scheme, ServiceScheme
Direct Known Subclasses:
AbstractCachingScheme, InvocationScheme, RemoteInvocationScheme

public abstract class AbstractServiceScheme
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

Constructor Summary
AbstractServiceScheme()
           

 

Method Summary
 java.util.List getEventInterceptorBuilders()
          Obtains the List of NamedEventInterceptorBuilders that have been defined for the ServiceScheme.
 java.lang.String getScopedServiceName()
          Return the service name with any scoping applied.
 java.lang.String getScopedServiceName(java.lang.String sScopeNameOverride)
          Return the service name with any scoping applied.
 java.lang.String getScopeName()
          Return the scope name.
 ServiceBuilder getServiceBuilder()
          Return the ServiceBuilder that is needed to build a service.
 java.lang.String getServiceName()
          Return the service name.
 XmlElement getXml()
          Return the XmlElement that contains the Service configuration.
protected  void injectScopeNameIntoService(Service service)
          Get the wrapped Service from the SafeService and invoke setScopeName() on the wrapped Service.
 boolean isAutoStart()
          Return true if the service has auto-start enabled.
abstract  boolean isRunningClusterNeeded()
          Return true if a running cluster is needed before using a service.
 Service realizeService(com.tangosol.config.expression.ParameterResolver resolver, java.lang.ClassLoader loader, Cluster cluster)
          Realize (ensure) a Service.
 void setAutoStart(boolean fEnabled)
          Set the auto-start enabled flag.
 void setScopeName(java.lang.String sName)
          Set the scope name.
 void setServiceName(java.lang.String sName)
          Set the service name.
 void setXml(XmlElement element)
          Set the XML so that we can create a Service using the SafeCluster.ensureService.
protected  void validate()
          Validate the properties.

 

Methods inherited from class com.tangosol.coherence.config.scheme.AbstractScheme
getSchemeName, isAnonymous, setSchemeName

 

Methods inherited from interface com.tangosol.coherence.config.scheme.ServiceScheme
getServiceType

 

Methods inherited from interface com.tangosol.coherence.config.scheme.Scheme
getSchemeName, isAnonymous

 

Constructor Detail

AbstractServiceScheme

public AbstractServiceScheme()

Method Detail

realizeService

public Service realizeService(com.tangosol.config.expression.ParameterResolver resolver,
                              java.lang.ClassLoader loader,
                              Cluster cluster)
Realize (ensure) a Service. The returned Service is fully configured and ready to be used.
Specified by:
realizeService in interface ServiceBuilder
Parameters:
resolver - the ParameterResover
loader - the ClassLoader
cluster - 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:
isRunningClusterNeeded in interface ServiceBuilder

getScopeName

public java.lang.String getScopeName()
Return the scope name.
Specified by:
getScopeName in interface ServiceBuilder
Returns:
the scope name

setScopeName

@Injectable
public void setScopeName(java.lang.String sName)
Set the scope name.
Specified by:
setScopeName in interface ServiceBuilder
Parameters:
sName - the scope name

setXml

public void setXml(XmlElement element)
Set the XML so that we can create a Service using the SafeCluster.ensureService.
Specified by:
setXml in interface ServiceBuilder
Parameters:
element - the distributed-scheme XML

getXml

public XmlElement getXml()
Return the XmlElement that contains the Service configuration.
Specified by:
getXml in interface ServiceBuilder
Returns:
the XmlElement

isAutoStart

public boolean isAutoStart()
Return true if the service has auto-start enabled.
Specified by:
isAutoStart in interface ServiceScheme
Returns:
the auto-start flag.

setAutoStart

@Injectable(value="autostart")
public void setAutoStart(boolean fEnabled)
Set the auto-start enabled flag.
Parameters:
fEnabled - the auto-start enabled flag

getServiceBuilder

public ServiceBuilder getServiceBuilder()
Return the ServiceBuilder that is needed to build a service.
Specified by:
getServiceBuilder in interface ServiceScheme
Returns:
the ServiceBuilder or null if the scheme does not support services.

setServiceName

@Injectable
public void setServiceName(java.lang.String sName)
Set the service name.
Parameters:
sName - the service name.

getServiceName

public java.lang.String getServiceName()
Return the service name.
Specified by:
getServiceName in interface ServiceScheme
Returns:
the service name

getScopedServiceName

public java.lang.String getScopedServiceName()
Return the service name with any scoping applied.
Specified by:
getScopedServiceName in interface ServiceScheme
Returns:
the scoped service name

getScopedServiceName

public java.lang.String getScopedServiceName(java.lang.String sScopeNameOverride)
Return the service name with any scoping applied.
Specified by:
getScopedServiceName in interface ServiceScheme
Parameters:
sScopeNameOverride - the scope name to be used in preference to a configured scope name
Returns:
the scoped service name

getEventInterceptorBuilders

public java.util.List getEventInterceptorBuilders()
Obtains the List of NamedEventInterceptorBuilders that have been defined for the ServiceScheme.

Note: For those ServiceSchemes don't support event interceptors, the returned value must be an empty list.

Specified by:
getEventInterceptorBuilders in interface ServiceScheme
Returns:
an List over NamedEventInterceptorBuilders

validate

protected void validate()
Validate the properties.
Overrides:
validate in class AbstractScheme

injectScopeNameIntoService

protected void injectScopeNameIntoService(Service service)
Get the wrapped Service from the SafeService and invoke setScopeName() on the wrapped Service.
Parameters:
service - The safe service

Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.