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
TheClassSchemeclass is responsible for building customCachingSchemes and customCacheStoreSchemes.Note: The
ParameterizedBuilderinterface is needed by bothCacheStoreSchemeandElementProcessorHelper.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:
Injectable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.tangosol.coherence.config.builder.MapBuilder
MapBuilder.Dependencies
-
Nested 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_serviceDependencies
-
Fields inherited from interface com.tangosol.coherence.config.scheme.ServiceScheme
DELIM_APPLICATION_SCOPE, DELIM_DOMAIN_PARTITION
-
-
Constructor Summary
Constructors Constructor Description ClassScheme()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<NamedEventInterceptorBuilder>getEventInterceptorBuilders()StringgetServiceType()Return the service type.booleanisRunningClusterNeeded()Return true if a running cluster is needed before using a service.Objectrealize(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.NamedCacherealizeCache(ParameterResolver resolver, MapBuilder.Dependencies dependencies)Realizes aNamedCache(possibly "ensuring it") based on the state of the builder, the providedParameterResolverandMapBuilderdependencies.MaprealizeMap(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, setCustomBuilder
-
Methods inherited from class com.tangosol.coherence.config.scheme.AbstractCachingScheme
establishMapListeners, getDefaultParameterResolver, getListenerBuilder, realizeBackingMapManager, setListenerBuilder, validate
-
Methods inherited from class com.tangosol.coherence.config.scheme.AbstractServiceScheme
ensureService, getDefaultServiceName, getScopedServiceName, getScopeName, getServiceBuilder, getServiceDependencies, getServiceName, getXml, injectScopeNameIntoService, isAutoStart, realizeService, setAutoStart, setScopeName, setServiceDependencies, setServiceName, setXml
-
Methods inherited from class com.tangosol.coherence.config.scheme.AbstractScheme
getSchemeName, isAnonymous, setSchemeName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.tangosol.coherence.config.scheme.Scheme
getSchemeName, isAnonymous
-
Methods inherited from interface com.tangosol.coherence.config.scheme.ServiceScheme
getScopedServiceName, getServiceBuilder, getServiceName, isAutoStart
-
-
-
-
Method Detail
-
getServiceType
public String getServiceType()
Return the service type.- Specified by:
getServiceTypein interfaceServiceScheme- Overrides:
getServiceTypein classAbstractLocalCachingScheme<Object>- Returns:
- the service type
-
getEventInterceptorBuilders
public List<NamedEventInterceptorBuilder> 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
public NamedCache realizeCache(ParameterResolver resolver, MapBuilder.Dependencies dependencies)
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
public Map realizeMap(ParameterResolver resolver, MapBuilder.Dependencies dependencies)
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
public Object 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.- 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
public boolean realizes(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).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
-
-