Class ClassScheme
- All Implemented Interfaces:
BackingMapManagerBuilder,BuilderCustomization<Object>,MapBuilder,NamedCacheBuilder,ParameterizedBuilder<Object>,ParameterizedBuilder.ReflectionSupport,ServiceBuilder,CachingScheme,ObservableCachingScheme,Scheme,ServiceScheme
public class ClassScheme
extends AbstractLocalCachingScheme<Object>
implements ParameterizedBuilder<Object>, ParameterizedBuilder.ReflectionSupport
The
ClassScheme class is responsible for building custom CachingSchemes and
custom CacheStoreSchemes.
Note: The ParameterizedBuilder interface is needed by both
CacheStoreScheme and ElementProcessorHelper.
This class will automatically inject the following types and named values into realized classes that have been annotated with @Injectable.
-
BackingMapManagerContext(optionally named "manager-context") -
ConfigurableCacheFactory - Cache Name (as a
String.class named "cache-name") - Context
ClassLoader(optionally named "class-loader") -
ResourceRegistry -
CacheConfig - together with any other resource, named or otherwise, available
in the
ResourceRegistryprovided by theConfigurableCacheFactory.
- Since:
- Coherence 12.1.2
- Author:
- pfm 2012.02.27
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tangosol.coherence.config.builder.MapBuilder
MapBuilder.DependenciesNested classes/interfaces inherited from interface com.tangosol.coherence.config.builder.ParameterizedBuilder
ParameterizedBuilder.ReflectionSupport -
Field Summary
Fields inherited from class com.tangosol.coherence.config.scheme.AbstractServiceScheme
m_serviceDependenciesFields inherited from interface com.tangosol.coherence.config.scheme.ServiceScheme
DELIM_APPLICATION_SCOPE, DELIM_DOMAIN_PARTITION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn the service type.booleanReturn true if a running cluster is needed before using a service.realize(ParameterResolver resolver, ClassLoader loader, ParameterList listParameters) Realizes (creates if necessary) an instance of a object of type T, using the providedParameterResolverto resolve values any referencedParameters.realizeCache(ParameterResolver resolver, MapBuilder.Dependencies dependencies) Realizes aNamedCache(possibly "ensuring it") based on the state of the builder, the providedParameterResolverandMapBuilderdependencies.realizeMap(ParameterResolver resolver, MapBuilder.Dependencies dependencies) Realize aMapbased on the state of theMapBuilder, resolvable parameters and providedMapBuilder.Dependencies.booleanrealizes(Class<?> clzClass, ParameterResolver resolver, ClassLoader loader) Determines if theParameterizedBuilderwill realize an instance of the specified class (without requiring the builder to actually realize an object).protected voidvalidate()Validate the ClassScheme properties.Methods inherited from class com.tangosol.coherence.config.scheme.AbstractLocalCachingScheme
getCustomBuilder, setCustomBuilderMethods inherited from class com.tangosol.coherence.config.scheme.AbstractCachingScheme
establishMapListeners, getDefaultParameterResolver, getListenerBuilder, realizeBackingMapManager, setListenerBuilder, validateMethods inherited from class com.tangosol.coherence.config.scheme.AbstractServiceScheme
ensureService, getDefaultServiceName, getScopedServiceName, getScopeName, getServiceBuilder, getServiceDependencies, getServiceName, getXml, injectScopeNameIntoService, isAutoStart, realizeService, setAutoStart, setScopeName, setServiceDependencies, setServiceName, setXmlMethods inherited from class com.tangosol.coherence.config.scheme.AbstractScheme
getSchemeName, isAnonymous, setSchemeNameMethods 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
getScopedServiceName, getServiceBuilder, getServiceName, isAutoStart
-
Constructor Details
-
ClassScheme
public ClassScheme()
-
-
Method Details
-
getServiceType
Return the service type.- Specified by:
getServiceTypein interfaceServiceScheme- Overrides:
getServiceTypein classAbstractLocalCachingScheme<Object>- Returns:
- the service type
-
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- Overrides:
getEventInterceptorBuildersin classAbstractLocalCachingScheme<Object>- Returns:
- an
ListoverNamedEventInterceptorBuilders
-
isRunningClusterNeeded
public boolean isRunningClusterNeeded()Return true if a running cluster is needed before using a service.- Specified by:
isRunningClusterNeededin interfaceServiceBuilder- Overrides:
isRunningClusterNeededin classAbstractLocalCachingScheme<Object>- Returns:
trueif a running cluster is needed before using a service
-
realizeCache
Realizes aNamedCache(possibly "ensuring it") based on the state of the builder, the providedParameterResolverandMapBuilderdependencies.The
MapBuilderdependencies are required to satisfy the requirement when realizing aNamedCacheadditionally involves realizing one or more internalMaps.- Specified by:
realizeCachein interfaceNamedCacheBuilder- Overrides:
realizeCachein classAbstractCachingScheme- Parameters:
resolver- the ParameterResolverdependencies- theMapBuilderdependencies- Returns:
- a
NamedCache
-
realizeMap
Realize aMapbased on the state of theMapBuilder, resolvable parameters and providedMapBuilder.Dependencies.- Specified by:
realizeMapin interfaceMapBuilder- Overrides:
realizeMapin classAbstractCachingScheme- Parameters:
resolver- theParameterResolverdependencies- theMapBuilder.Dependenciesfor realizing theMap- Returns:
- a
Map
-
realize
Realizes (creates if necessary) an instance of a object of type T, using the providedParameterResolverto resolve values any referencedParameters.- Specified by:
realizein interfaceParameterizedBuilder<Object>- Parameters:
resolver- theParameterResolverfor resolving namedParametersloader- theClassLoaderfor loading any necessary classes and ifnulltheClassLoaderused to load the builder will be used insteadlistParameters- an optionalParameterList(may benull) to be used for realizing the instance, eg: used as constructor parameters- Returns:
- an instance of T
-
realizes
Determines if theParameterizedBuilderwill realize an instance of the specified class (without requiring the builder to actually realize an object).This method is synonymous with the Java keyword
instanceofbut allows dynamic runtime type querying of the types of objects a builder may realize.- Specified by:
realizesin interfaceParameterizedBuilder.ReflectionSupport- Parameters:
clzClass- the expected typeresolver- theParameterResolverto use for resolving necessaryParametersloader- theClassLoaderfor loading any necessary classes and ifnulltheClassLoaderused to load the builder will be used instead- Returns:
trueif theParameterizedBuilderwill realize an instance of the class,falseotherwise
-
validate
protected void validate()Validate the ClassScheme properties.- Overrides:
validatein classAbstractScheme
-