Package com.tangosol.util
Class NullImplementation.NullBackingMapManagerContext
java.lang.Object
com.tangosol.util.NullImplementation.NullBackingMapManagerContext
- All Implemented Interfaces:
BackingMapManagerContext
,XmlConfigurable
- Enclosing class:
NullImplementation
public static class NullImplementation.NullBackingMapManagerContext
extends Object
implements BackingMapManagerContext
An implementation of BackingMapManagerContext that does nothing.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final NullImplementation.NullBackingMapManagerContext
Singleton instance.Fields inherited from interface com.tangosol.net.BackingMapManagerContext
DECO_CUSTOM, DECO_EXPIRY, DECO_STORE
-
Method Summary
Modifier and TypeMethodDescriptionaddInternalValueDecoration
(Object oValue, int nDecorId, Object oDecor) Decorate a specified value in the internal form with a specified decoration in the "normal" Object form.getBackingMap
(String sCacheName) Obtain a reference to the backing map that corresponds to the specified cache name.getBackingMapContext
(String sCacheName) Obtain a reference to theBackingMapContext
that corresponds to the specified cache name.Return the CacheService associated with this context.Return the ClassLoader associated with this context.Determine the current configuration of the associated BackingMapManager.getInternalValueDecoration
(Object oValue, int nDecorId) Obtain a decoration from the specified value in the internal form.Return a converter that allows the manager (or a backing map managed thereby) to convert a key object from its internal form (as managed by the CacheService) into its "normal" (Object) form.int
getKeyPartition
(Object oKey) Determine the partition to which the specified key belongs.Return a converter that allows the manager (or a backing map managed thereby) to convert a key object into its internal form as managed by the CacheService.Return the BackingMapManager this object is a context for.getPartitionKeys
(String sCacheName, int nPartition) Obtain a collection of keys in the internal format that belong to the specified partition for the specified backing map.Return a converter that allows the manager (or a backing map managed thereby) to convert a value object from its internal form (as managed by the CacheService) into its "normal" (Object) form.Return a converter that allows the manager (or a backing map managed thereby) to convert a value object into its internal form as managed by the CacheService.boolean
isInternalValueDecorated
(Object oValue, int nDecorId) Check whether or not the specified value in the internal form is decorated.boolean
isKeyOwned
(Object oKey) Determines whether or not the specified key (in the internal format) is managed (i.e. controlled) by this service member.removeInternalValueDecoration
(Object oValue, int nDecorId) Remove a decoration from the specified value in the internal form.void
setClassLoader
(ClassLoader loader) Assign the ClassLoader this context is associated with.void
setConfig
(XmlElement xml) Specify the configuration for the associated BackingMapManager.
-
Field Details
-
INSTANCE
Singleton instance.
-
-
Method Details
-
getManager
Return the BackingMapManager this object is a context for.- Specified by:
getManager
in interfaceBackingMapManagerContext
- Returns:
- the BackingMapManager this object is a context for
-
getCacheService
Return the CacheService associated with this context.- Specified by:
getCacheService
in interfaceBackingMapManagerContext
- Returns:
- the CacheService associated with this context
-
getClassLoader
Return the ClassLoader associated with this context.- Specified by:
getClassLoader
in interfaceBackingMapManagerContext
- Returns:
- the ClassLoader associated with this context
-
setClassLoader
Assign the ClassLoader this context is associated with.- Specified by:
setClassLoader
in interfaceBackingMapManagerContext
- Parameters:
loader
- the ClassLoader associated with this context
-
getKeyToInternalConverter
Return a converter that allows the manager (or a backing map managed thereby) to convert a key object into its internal form as managed by the CacheService.- Specified by:
getKeyToInternalConverter
in interfaceBackingMapManagerContext
- Returns:
- the object-to-internal converter
-
getKeyFromInternalConverter
Return a converter that allows the manager (or a backing map managed thereby) to convert a key object from its internal form (as managed by the CacheService) into its "normal" (Object) form. If a ClassLoader is available, it will be used if deserialization is involved in the conversion.- Specified by:
getKeyFromInternalConverter
in interfaceBackingMapManagerContext
- Returns:
- the internal-to-object converter
-
getValueToInternalConverter
Return a converter that allows the manager (or a backing map managed thereby) to convert a value object into its internal form as managed by the CacheService.- Specified by:
getValueToInternalConverter
in interfaceBackingMapManagerContext
- Returns:
- the object-to-internal converter
-
getValueFromInternalConverter
Return a converter that allows the manager (or a backing map managed thereby) to convert a value object from its internal form (as managed by the CacheService) into its "normal" (Object) form. If a ClassLoader is available, it will be used if deserialization is involved in the conversion.- Specified by:
getValueFromInternalConverter
in interfaceBackingMapManagerContext
- Returns:
- the internal-to-object converter
-
isKeyOwned
Determines whether or not the specified key (in the internal format) is managed (i.e. controlled) by this service member. In other words, is the specified key under the management of the backing map whose manager this context represents. The key does not have to actually exist for this method to evaluate it; the answer is not backing map- specific.- Specified by:
isKeyOwned
in interfaceBackingMapManagerContext
- Parameters:
oKey
- the resource key in the internal format- Returns:
- true iff the key is managed by this service member
-
getKeyPartition
Determine the partition to which the specified key belongs.- Specified by:
getKeyPartition
in interfaceBackingMapManagerContext
- Parameters:
oKey
- a key in its internal format- Returns:
- the partition ID that the specified key is assigned to
-
getPartitionKeys
Obtain a collection of keys in the internal format that belong to the specified partition for the specified backing map. The returned Set must be used in a read-only manner.- Specified by:
getPartitionKeys
in interfaceBackingMapManagerContext
- Parameters:
sCacheName
- the cache name for the backing map to retrieve the set of keys fornPartition
- the partition ID- Returns:
- the Set of keys in the internal format; could be null if the backing map does not exists or the specified partition is not owned by this node
-
getBackingMap
Obtain a reference to the backing map that corresponds to the specified cache name. The returned Map must be used in a read-only manner.- Specified by:
getBackingMap
in interfaceBackingMapManagerContext
- Parameters:
sCacheName
- the cache name- Returns:
- the backing map reference; null if the backing map does not exist
-
addInternalValueDecoration
Decorate a specified value in the internal form with a specified decoration in the "normal" Object form. It's important to understand that applying theinternal converter
to either passed-in or returned internal values will produce identical values in Object form.- Specified by:
addInternalValueDecoration
in interfaceBackingMapManagerContext
- Parameters:
oValue
- a value in the internal formnDecorId
- a decoration identifier; valid decoration identifiers are any of the DECO_* constant valuesoDecor
- a decoration value in Object form- Returns:
- a decorated value in the internal form
-
removeInternalValueDecoration
Remove a decoration from the specified value in the internal form. If the specified value is not decorated, the call will have no effect. It's important to understand that applying theinternal converter
to either passed-in or returned internal values will produce identical values in Object form.- Specified by:
removeInternalValueDecoration
in interfaceBackingMapManagerContext
- Parameters:
oValue
- a decorated value in the internal formnDecorId
- a decoration identifier; valid decoration identifiers are any of the DECO_* constant values- Returns:
- an un-decorated value in the internal form
-
isInternalValueDecorated
Check whether or not the specified value in the internal form is decorated.- Specified by:
isInternalValueDecorated
in interfaceBackingMapManagerContext
- Parameters:
oValue
- a decorated value in the internal formnDecorId
- a decoration identifier; valid decoration identifiers are any of the DECO_* constant values- Returns:
- true if the value is decorated using the specified decoration id; false otherwise
-
getInternalValueDecoration
Obtain a decoration from the specified value in the internal form. If the specified value is decorated with the specified decoration id, a value in a "normal" Object form is returned; otherwise null.- Specified by:
getInternalValueDecoration
in interfaceBackingMapManagerContext
- Parameters:
oValue
- a decorated value in the internal formnDecorId
- a decoration identifier; valid decoration identifiers are any of the DECO_* constant values- Returns:
- an un-decorated value in the internal form
-
getBackingMapContext
Obtain a reference to theBackingMapContext
that corresponds to the specified cache name.Note: calling this method will not create a backing map for the specified cache name; it will return null if the cache has yet to be used (e.g. via
ConfigurableCacheFactory.ensureCache
call) or has been destroyed- Specified by:
getBackingMapContext
in interfaceBackingMapManagerContext
- Parameters:
sCacheName
- the cache name- Returns:
- the corresponding context; null if the cache does not exist
-
getConfig
Determine the current configuration of the associated BackingMapManager.- Specified by:
getConfig
in interfaceBackingMapManagerContext
- Specified by:
getConfig
in interfaceXmlConfigurable
- Returns:
- the XML configuration or null
-
setConfig
Specify the configuration for the associated BackingMapManager. The configuration content is shared between all instances of the corresponding CacheService running on different cluster nodes.- Specified by:
setConfig
in interfaceBackingMapManagerContext
- Specified by:
setConfig
in interfaceXmlConfigurable
- Parameters:
xml
- the XML configuration
-