|
IBM WebSphere Extended Deployment (XD)TM, Release 6.1 ObjectGrid API Specification |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface BackingMap
This is the public interface to the BackingMap. It is returned when a new Map is defined on the ObjectGrid. It allows the Map to be customized with various plugins or by setting properties. The defaults are:
Evictor, but an internal time-based evictor is provided by defaultLoaderMapEventListenersMapIndexPluginsObjectTransformerOptimisticCallbackCopyMode of CopyMode.COPY_ON_READ_AND_COMMITLockStrategy of LockStrategy.OPTIMISTICnull values are supportedTTLType.NONE
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.ibm.websphere.objectgrid.ClientReplicableMap |
|---|
ClientReplicableMap.Mode |
| Field Summary | |
|---|---|
static int |
CLIENT
Constant used to indicate this map is a client to a server map |
static int |
DEFAULT_LOCK_TIMEOUT
Default lock timeout used if setLockTimeout(int)
is not invoked. |
static int |
DEFAULT_NUMBER_OF_BUCKETS
Default number of lock buckets used if setNumberOfBuckets(int)
is not invoked. |
static int |
DEFAULT_NUMBER_OF_LOCK_BUCKETS
Default number of lock buckets used if setNumberOfLockBuckets(int)
is not invoked. |
static int |
LOCAL
Constant used to indicate this map is not a distributed map. |
static int |
SERVER
Constant used to indicate this map is a server map. |
| Fields inherited from interface com.ibm.websphere.objectgrid.ClientReplicableMap |
|---|
CONTINUOUS_REPLICATION, NONE, SNAPSHOT_REPLICATION |
| Method Summary | |
|---|---|
void |
addMapEventListener(MapEventListener eventListener)
Adds a MapEventListener to this BackingMap. |
void |
addMapIndexPlugin(MapIndexPlugin index)
Adds an MapIndexPlugin to this Map. |
void |
createDynamicIndex(MapIndexPlugin index,
DynamicIndexCallback dynamicIndexCallback)
Creates a dynamic index on the BackingMap. |
void |
createDynamicIndex(java.lang.String name,
boolean isRangeIndex,
java.lang.String attributeName,
DynamicIndexCallback dynamicIndexCallback)
Creates a dynamic index on the BackingMap. |
boolean |
getCopyKey()
Gets whether keys are copied for this BackingMap. |
CopyMode |
getCopyMode()
Gets the CopyMode being used by this BackingMap. |
EntityMetadata |
getEntityMetadata()
Retreive the metadata for the entity associated with this backing map. |
Evictor |
getEvictor()
Gets the Evictor being used by this BackingMap. |
Loader |
getLoader()
Gets the Loader being used by this BackingMap. |
LockStrategy |
getLockStrategy()
Gets the LockStrategy object being used by this BackingMap. |
int |
getLockTimeout()
Gets the lock timeout value used by the lock manager for this BackingMap. |
java.util.List |
getMapEventListeners()
Gets the current list of MapEventListeners. |
java.util.List |
getMapIndexPlugins()
Returns the current list of MapIndexPlugin objects for this BackingMap. |
int |
getMapType()
Returns the type of BackingMap. |
java.lang.String |
getName()
Gets the name of the BackingMap. |
boolean |
getNullValuesSupported()
Gets whether this BackingMap supports null values
or not. |
int |
getNumberOfBuckets()
Gets the number of buckets defined for this BackingMap. |
int |
getNumberOfLockBuckets()
Gets the number of lock buckets defined for the hash map used by lock manager for this backing map. |
ObjectGrid |
getObjectGrid()
Gets the ObjectGrid that owns this BackingMap. |
ObjectTransformer |
getObjectTransformer()
Gets the ObjectTransformer object being used by this
BackingMap and/or Loader. |
OptimisticCallback |
getOptimisticCallback()
Gets the OptimisticCallback being used by this BackingMap
and/or Loader or null if the LockStrategy is not optimistic. |
int |
getPartitionId()
Gets the partition identifier being used by this BackingMap. |
PartitionManager |
getPartitionManager()
Allows access to the PartitionManager that is defined for this
BackingMap. |
boolean |
getPreLoadMode()
Returns whether this BackingMap will be asynchronously preloaded or not
if a Loader is set. |
boolean |
getReadOnly()
Retrieves the map type. |
int |
getTimeToLive()
Gets the number of seconds for an entry to live. |
TTLType |
getTtlEvictorType()
Gets how expiration time of a BackingMap entry is computed. |
void |
removeDynamicIndex(java.lang.String name)
Removes a dynamic index on the BackingMap. |
void |
removeMapEventListener(MapEventListener eventListener)
Removes a MapEventListener from this BackingMap. |
void |
setCopyKey(boolean copy)
Sets whether or not the key needs to be copied when a map entry is created. |
void |
setCopyMode(CopyMode mode,
java.lang.Class valueInterface)
Sets the CopyMode. |
void |
setEvictor(Evictor e)
Associates an Evictor with this BackingMap. |
void |
setLoader(Loader loader)
Associates a Loader with this BackingMap. |
void |
setLockStrategy(LockStrategy lockStrategy)
Sets the LockStrategy. |
void |
setLockTimeout(int seconds)
Sets the lock timeout used by the lock manager for this BackingMap. |
void |
setMapEventListeners(java.util.List eventListenerList)
Sets the list of MapEventListener objects. |
void |
setMapIndexPlugins(java.util.List indexList)
Sets the list of MapIndexPlugin objects for this BackingMap. |
void |
setNullValuesSupported(boolean nullValuesSupported)
Sets whether this BackingMap supports null values. |
void |
setNumberOfBuckets(int numBuckets)
Sets the number of buckets used by this BackingMap. |
void |
setNumberOfLockBuckets(int numBuckets)
Sets the number of lock buckets used by the lock manager for this BackingMap. |
void |
setObjectTransformer(ObjectTransformer t)
Sets the ObjectTransformer object for use by this BackingMap and/or
Loader. |
void |
setOptimisticCallback(OptimisticCallback checker)
Sets the OptimisticCallback. |
void |
setPreloadMode(boolean async)
Sets the preload mode if a Loader is set for this BackingMap. |
void |
setReadOnly(boolean readOnlyEnabled)
Sets the map type of this BackingMap. |
void |
setTimeToLive(int seconds)
Sets "time to live" of each map entry in seconds. |
void |
setTtlEvictorType(TTLType type)
Sets how expiration time of a BackingMap entry is computed. |
| Methods inherited from interface com.ibm.websphere.objectgrid.ClientReplicableMap |
|---|
disableClientReplication, enableClientReplication, getReplicationMode |
| Field Detail |
|---|
static final int DEFAULT_LOCK_TIMEOUT
setLockTimeout(int)
is not invoked.
static final int DEFAULT_NUMBER_OF_BUCKETS
setNumberOfBuckets(int)
is not invoked.
static final int DEFAULT_NUMBER_OF_LOCK_BUCKETS
setNumberOfLockBuckets(int)
is not invoked.
static final int LOCAL
getMapType(),
Constant Field Valuesstatic final int SERVER
getMapType(),
Constant Field Valuesstatic final int CLIENT
getMapType(),
Constant Field Values| Method Detail |
|---|
java.lang.String getName()
BackingMap.
BackingMap was created.void setEvictor(Evictor e)
Evictor with this BackingMap.
An Evictor aids with cleaning up the cache based on whatever
algorithm is desired (LRU, LFU, etc). Passing null to this
method removes a previously set Evictor object from an earlier
invocation of this method.
Note, to avoid an IllegalStateException, this method must be called
prior to the ObjectGrid.initialize() method. Also, keep in mind that the
ObjectGrid.getSession() method implicitly calls the
ObjectGrid.initialize() method if it has yet to be called by the application.
e - Evictor instance
java.lang.IllegalStateException - if this method is called after the
ObjectGrid.initialize() method is called.Evictor,
ObjectGrid.initialize(),
ObjectGrid.getSession()Evictor getEvictor()
Evictor being used by this BackingMap.
setEvictor(Evictor) method of
this interface or null if setEvictor was not previously called
for this BackingMap object.Evictor,
setEvictor(Evictor)void setObjectTransformer(ObjectTransformer t)
BackingMap and/or
Loader.
An ObjectTransformer aids with the "serialization" of non-Serializable
objects. It allows a custom copy function to be installed for more
efficient object copy operations.
Note, to avoid an IllegalStateException, this method must be called
prior to the ObjectGrid.initialize() method. Also, keep in mind that the
ObjectGrid.getSession() method implicitly calls the
ObjectGrid.initialize() method if it has yet to be called by the application.
t - ObjectTransformer instance
java.lang.IllegalArgumentException - if the passed in ObjectTransformer
is null
java.lang.IllegalStateException - if this method is called after the
ObjectGrid.initialize() method is called.ObjectTransformer,
ObjectGrid.initialize(),
ObjectGrid.getSession()ObjectTransformer getObjectTransformer()
ObjectTransformer object being used by this
BackingMap and/or Loader.
setObjectTransformer(ObjectTransformer)
method of this interface or the default ObjectTransformer object if the
setObjectTransformer method was not previously called for this object.ObjectTransformer,
setObjectTransformer(ObjectTransformer)void setOptimisticCallback(OptimisticCallback checker)
OptimisticCallback.
The OptimisticCallback will be used to check the versions of cache entries during the commit phase. If no OptimisticCallback was previously set, a default OptimisticCallback will be used. For Entities, the default OptimisticCallback will use a version field that was specified in the entity metadata. For POJO objects or Entities that do not have a version field specified, the default OptimisticCallback uses the entire object as the version value. In order for it to work for POJO objects, the application's value object needs to have a useful equals(Object) method. If your application does not require versioning, but is using Optimistic locking, the NoVersioningOptimistCallback should be used.
Note, to avoid an IllegalStateException, this method must be called
prior to the ObjectGrid.initialize() method. Also, keep in mind that the
ObjectGrid.getSession() method implicitly calls the
ObjectGrid.initialize() method if it has yet to be called by the application.
checker - OptimisticCallback instance
java.lang.IllegalArgumentException - if the passed in OptimisticCallback
is null
java.lang.IllegalStateException - if this method is called after the
ObjectGrid.initialize() method is called.OptimisticCallback,
NoVersioningOptimisticCallback,
LockStrategy.OPTIMISTIC,
ObjectGrid.initialize(),
ObjectGrid.getSession()OptimisticCallback getOptimisticCallback()
OptimisticCallback being used by this BackingMap
and/or Loader or null if the LockStrategy is not optimistic.
If no OptimisticCallback was previously set, a default OptimisticCallback will be used. For Entities, the default OptimisticCallback will use a version field that was specified in the entity metadata. For POJO objects or Entities that do not have a version field specified, the default OptimisticCallback uses the entire object as the version value. In order for it to work for POJO objects, the application's value object needs to have a useful equals(Object) method. If your application does not require versioning, but is using Optimistic locking, the NoVersioningOptimistCallback should be used.
setOptimisticCallback(OptimisticCallback)
method of this interface or the default OptimisticCallback object if the
setOptimisticCallback method was not previously called for this object.
If Optimistic locking is not being used, this method will return null after ObjectGrid.initialize()
has been invoked.NoVersioningOptimisticCallback,
OptimisticCallback,
LockStrategy.OPTIMISTIC,
setOptimisticCallback(OptimisticCallback)void setLoader(Loader loader)
Loader with this BackingMap.
Only one Loader can be associated with a given BackingMap.
Passing null to this method removes a previously set
Loader object from an earlier invocation of this method
and indicates that this BackingMap is not associated with a
Loader.
Note, to avoid an IllegalStateException, this method must be called
prior to the ObjectGrid.initialize() method. Also, keep in mind that the
ObjectGrid.getSession() method implicitly calls the
ObjectGrid.initialize() method if it has yet to be called by the application.
loader - Loader instance
java.lang.IllegalStateException - if this method is called after the
ObjectGrid.initialize() method is called.Loader,
ObjectGrid.initialize(),
ObjectGrid.getSession()Loader getLoader()
BackingMap.
setLoader(Loader) method of
this interface or null if setLoader was not previously called for this
object.Loader,
setLoader(Loader)void setPreloadMode(boolean async)
Loader is set for this BackingMap.
If the parameter is true then the Loader.preloadMap(Session, BackingMap) is
invoked asynchronously; otherwise it blocks the execution when loading data
so the cache is unavailable until preload completes. Preloading occurs during
ObjectGrid initialization.
Note, to avoid an IllegalStateException, this method must be called
prior to the ObjectGrid.initialize() method. Also, keep in mind that the
ObjectGrid.getSession() method implicitly calls the
ObjectGrid.initialize() method if it has yet to be called by the application.
async - If this is true then the cache is loaded asynchronously otherwise it blocks
and the cache is unavailable until preload completes.
java.lang.IllegalStateException - if this method is called after the
ObjectGrid.initialize() method is called.Loader.preloadMap(Session, BackingMap)boolean getPreLoadMode()
BackingMap will be asynchronously preloaded or not
if a Loader is set.
If true is returned then the Loader.preloadMap(Session, BackingMap) method is
invoked asynchronously; otherwise it blocks the execution when loading data
so the cache is unavailable until preload completes. Preloading occurs during
ObjectGrid initialization.
setPreloadMode(boolean) method of
this interface or false if setPreloadeMode was not previously
called for this object.Loader.preloadMap(Session, BackingMap),
setPreloadMode(boolean)
void addMapIndexPlugin(MapIndexPlugin index)
throws IndexAlreadyDefinedException
MapIndexPlugin to this Map. This method assumes the index implementation was constructed
with the name of the attribute to index. The name of the index is specified when
the index is constructed.
Note, to avoid an IllegalStateException, this method must be called
prior to ObjectGrid.initialize() method. Also, keep in mind that the
ObjectGrid.getSession() method implicitly calls the
ObjectGrid.initialize() method if it has yet to be called by the application.
index - The index implementation.
IndexAlreadyDefinedException - if this index already exists.
java.lang.IllegalStateException - if this method is called after the
ObjectGrid.initialize() method is called.MapIndexPlugin,
ObjectGrid.initialize(),
ObjectGrid.getSession()java.util.List getMapIndexPlugins()
MapIndexPlugin objects for this BackingMap.
MapIndexPlugins for this BackingMap.
The list is empty if the addMapIndexPlugin(MapIndexPlugin)
or setMapIndexPlugins(List) method was
not previously called for this BackingMap.addMapIndexPlugin(MapIndexPlugin),
setMapIndexPlugins(List)void setMapIndexPlugins(java.util.List indexList)
MapIndexPlugin objects for this BackingMap.
If the BackingMap already has a List of MapIndexPlugin objects,
that list is replaced by the List passed as
an argument to the current invocation of this method.
Note, to avoid an IllegalStateException, this method must be called
prior to ObjectGrid.initialize() method. Also, keep in mind that the
ObjectGrid.getSession() method implicitly calls the
ObjectGrid.initialize() method if it has yet to be called by the application.
indexList - A non-null reference to a List of MapIndexPlugin objects.
java.lang.IllegalArgumentException - is thrown if indexList is null
or the indexList contains either a null reference
or an object that is not an instanceof MapIndexPlugin.MapIndexPlugin,
ObjectGrid.initialize(),
ObjectGrid.getSession()
void setCopyMode(CopyMode mode,
java.lang.Class valueInterface)
CopyMode.
The CopyMode determines whether a get operation of an entry
in the BackingMap returns the actual value, a copy of the value,
or a proxy for the value. In the case of a proxy, the copy of the value does not occur
unless a set method of the application provided value interface is invoked.
It also determines that when a transaction is committed, whether a copy
of the value object of an entry that was marked as dirty by the transaction
is put into the BackingMap at commit time. The CopyMode
does not specify if the object is copied when being read or written to a
Loader. It is the responsibility of the implementor of a
Loader to make copies as appropriate. The default
CopyMode is CopyMode.COPY_ON_READ_AND_COMMIT.
Note, to avoid an IllegalStateException, this method must be called
prior to the ObjectGrid.initialize() method. Also, keep in mind that the
ObjectGrid.getSession() method implicitly calls the
ObjectGrid.initialize() method if it has yet to be called by the application.
mode - must be one of the final static variables defined in CopyMode.
See CopyMode class for an explanation of each mode and how the valueInterface
is used for CopyMode.COPY_ON_WRITE .valueInterface - is a value interface Class object.
A non-null valueInterface is required when mode is set to
CopyMode.COPY_ON_WRITE. It is ignored for all other modes.
java.lang.IllegalArgumentException - if mode is CopyMode.COPY_ON_WRITE and
valueInterface parameter is null and CGLIB isn't in the classpath.
java.lang.IllegalStateException - if this method is called after the
ObjectGrid.initialize() method is called.CopyMode,
ObjectGrid.initialize(),
ObjectGrid.getSession()CopyMode getCopyMode()
CopyMode being used by this BackingMap.
setCopyMode(CopyMode, Class) method of
this interface or the default CopyMode object if setCopyMode was not previously
called for this object.CopyMode,
setCopyMode(CopyMode, Class)void setLockStrategy(LockStrategy lockStrategy)
LockStrategy.
The locking strategy represented by the LockStrategy object
determines if the internal ObjectGrid lock manager is
used whenever a map entry is accessed by a transaction. The default
strategy is LockStrategy.OPTIMISTIC.
Note, to avoid an IllegalStateException, this method must be called
prior to the ObjectGrid.initialize() method. Also, keep in mind that the
ObjectGrid.getSession() method implicitly calls the
ObjectGrid.initialize() method if it has yet to be called by the application.
lockStrategy - must be one of the final static variables defined in
LockStrategy. See LockStrategy class for an explanation of each
locking strategy.
java.lang.IllegalStateException - if this method is called after the
ObjectGrid.initialize() method is called.LockStrategy,
ObjectGrid.initialize(),
ObjectGrid.getSession()LockStrategy getLockStrategy()
LockStrategy object being used by this BackingMap.
setLockStrategy(LockStrategy) method of
this interface or the default LockStrategy object if setLockStrategy was not previously
called for this object.LockStrategy,
setLockStrategy(LockStrategy)void setMapEventListeners(java.util.List eventListenerList)
MapEventListener objects.
If this BackingMap already has a List of
MapEventListeners, that list is replaced by the
List passed as an argument to the current invocation
of this method. This method can be called before and
after the ObjectGrid.initialize() method.
eventListenerList - A non-null reference to a List of
MapEventListener objects.
java.lang.IllegalArgumentException - is thrown if eventListenerList is null
or the eventListenerList contains either a null
reference or an object that is not an instance of
MapEventListener.MapEventListenerjava.util.List getMapEventListeners()
MapEventListeners.
MapEventListener for this BackingMap.MapEventListenervoid addMapEventListener(MapEventListener eventListener)
MapEventListener to this BackingMap.
Note, this method is allowed to be invoked before and after the
ObjectGrid.initialize() method.
eventListener - A non-null reference to a MapEventListener to add to the list.
java.lang.IllegalArgumentException - if eventListener is null.MapEventListenervoid removeMapEventListener(MapEventListener eventListener)
MapEventListener from this BackingMap.
Note, this method is allowed to be invoked before and after the
ObjectGrid.initialize() method.
eventListener - A non-null reference to an event listener that was
previously added by invoking either the addMapEventListener(MapEventListener)
or setMapEventListeners(List) method of this interface.
java.lang.IllegalArgumentException - if eventListener is null.MapEventListener,
addMapEventListener(MapEventListener),
setMapEventListeners(List)int getPartitionId()
BackingMap.
BackingMap
instance. If there is only a single partition defined
for this BackingMap object, a 0 will be returned (default).void setReadOnly(boolean readOnlyEnabled)
BackingMap.
A map can be a read only map or a read/write map. Passing true as the parameter value will make this map a read only map; passing false as the parameter value will make this map a read/write map.
Note, to avoid an IllegalStateException, this method must be called
prior to the ObjectGrid.initialize() method. Also, keep in mind that the
ObjectGrid.getSession() method implicitly calls the
ObjectGrid.initialize() method if it has yet to be called by the application.
readOnlyEnabled - If set to true, this BackingMap will be a read only map. If false, the
map will be a read/write map.
java.lang.IllegalStateException - if this method is called after the
ObjectGrid.initialize() method is called.boolean getReadOnly()
setReadOnly(boolean) method of this interface.
True is returned if this a read only map. A return value of false implies that this is
a read/write map. If setReadOnly was never called, the default return
value is false.setReadOnly(boolean)ObjectGrid getObjectGrid()
ObjectGrid that owns this BackingMap.
ObjectGridvoid setNumberOfBuckets(int numBuckets)
BackingMap.
The BackingMap implementation uses a hash map for its
implementation. If there are a lot of entries in the BackingMap
then more buckets means better performance because the risk of collisions
is lower as the number of buckets grows. More buckets also means more
concurrency. If number of buckets is 0, no entries will be stored in the
map, but the appropriate ObjectGrid and BackingMap plugins will still be called.
Once the ObjectGrid is initialized this parameter cannot be changed.
Therefore, to avoid an IllegalStateException, this method must be called
prior to the ObjectGrid.initialize() method. Also, keep in mind that the
ObjectGrid.getSession() method implicitly calls the
ObjectGrid.initialize() method if it has yet to be called by the application.
numBuckets - The number of buckets to use.
java.lang.IllegalArgumentException - if numBuckets is less than 0.
java.lang.IllegalStateException - if this method is called after the
ObjectGrid.initialize() method is called.ObjectGrid.initialize(),
ObjectGrid.getSession()int getNumberOfBuckets()
BackingMap.
setNumberOfBuckets(int) method or
DEFAULT_NUMBER_OF_BUCKETS if setNumberOfBuckets was never called.setNumberOfBuckets(int),
DEFAULT_NUMBER_OF_BUCKETSvoid setNumberOfLockBuckets(int numBuckets)
BackingMap.
When LockStrategy.OPTIMISTIC or
LockStrategy.PESSIMISTIC is used for
this BackingMap, a lock manager is created for the
BackingMap. The lock manager uses a hash map to keep track of
entries that are locked by 1 or more transactions. If there are a
lot of entries in the hash map, then more lock buckets means better
performance as the risk of collisions is lower as the number of buckets
grows. More lock buckets also means more concurrency. When the lock strategy
is LockStrategy.NONE, no lock manager
is used by this BackingMap. In this case, a call to this
method does nothing.
Once the ObjectGrid is initialized, the number of lock buckets
cannot be changed. Therefore, to avoid an IllegalStateException, this
method must be called prior to the ObjectGrid.initialize() method.
Also, keep in mind that the ObjectGrid.getSession() method
implicitly calls the ObjectGrid.initialize() method if it
has yet to be called by the application.
numBuckets - The number of lock buckets to use.
java.lang.IllegalArgumentException - if numBuckets is less than 1.
java.lang.IllegalStateException - if this method is called after the
ObjectGrid.initialize() method is called.LockStrategy,
ObjectGrid.initialize(),
ObjectGrid.getSession()int getNumberOfLockBuckets()
setNumberOfLockBuckets(int) method or
DEFAULT_NUMBER_OF_LOCK_BUCKETS if setNumberOfLockBuckets was never called.setNumberOfLockBuckets(int),
DEFAULT_NUMBER_OF_LOCK_BUCKETSvoid setLockTimeout(int seconds)
BackingMap.
When LockStrategy.OPTIMISTIC or
LockStrategy.PESSIMISTIC is used
for this BackingMap, a lock manager is created for the
BackingMap. To prevent deadlocks from occuring, the lock
manager has a default timeout value for waiting for a lock to be granted.
If this timeout limit is exceeeded, a LockTimeoutException
is thrown. The default value of DEFAULT_LOCK_TIMEOUT should be sufficient for most
applications, but on a heavily loaded system, a timeout may occur when no
deadlock exists. In that case, this method can be used to increase the lock
timeout value from the default to whatever is desired to prevent false
timeout exceptions from occuring. When the lock strategy is
LockStrategy.NONE, no lock manager
is used by this BackingMap. In this case, a call to this
method does nothing. A lock timeout value of zero indicates to not wait for the
lock if it is not immediately available.
Once the lock manager is initialized, the lock timeout value cannot be changed.
Therefore, to avoid an IllegalStateException, this method must be called
prior to ObjectGrid.initialize() method. Also, keep in mind that the
ObjectGrid.getSession() method implicitly calls the
ObjectGrid.initialize() method if it has yet to be called by the application.
When an entry is fetched the lock timeout can be changed for a given transaction
using ObjectMap.setLockTimeout(int)
seconds - is the lock timeout value to use in seconds.
java.lang.IllegalArgumentException - if seconds is less than 0.
java.lang.IllegalStateException - if this method is called after the
ObjectGrid.initialize() method is called.DEFAULT_LOCK_TIMEOUT,
LockStrategy,
LockTimeoutException,
ObjectGrid.initialize(),
ObjectGrid.getSession(),
ObjectMap.setLockTimeout(int)int getLockTimeout()
BackingMap.
setLockTimeout(int) method or
DEFAULT_LOCK_TIMEOUT if setLockTimeout was never called.DEFAULT_LOCK_TIMEOUT,
setLockTimeout(int)void setNullValuesSupported(boolean nullValuesSupported)
BackingMap supports null values.
If null values are supported, users need to be careful when a
get operation returns a null reference. It could
be due to the fact that the key is not found in the BackingMap,
or that the value in the BackingMap is null. To
determine if a key was not found, or the value is null, the
containsKey method can be used.
Note, to avoid an IllegalStateException, this method must be called
prior to the ObjectGrid.initialize() method. Also, keep in mind that the
ObjectGrid.getSession() method implicitly calls the
ObjectGrid.initialize() method if it has yet to be called by the application.
nullValuesSupported - If set to true, null values are
supported; otherwise null values
are not supported.
java.lang.IllegalStateException - if this method is called after the
ObjectGrid.initialize() method is called.ObjectGrid.initialize(),
ObjectGrid.getSession(),
ObjectMap.containsKey(Object)boolean getNullValuesSupported()
BackingMap supports null values
or not.
setNullValuesSupported(boolean)
method or the default value of true if setNullValuesSupported
was never called.setNullValuesSupported(boolean)void setCopyKey(boolean copy)
Copying the key object allows the application to use the same key
object for each ObjectMap operation. The application changes the key
object state prior to each ObjectMap operation so that it
can work with different entries using the same key object. If a separate
key object is used for each entry, then there is no reason to copy the key
object. This attribute allows an application to make the tradeoff of copying
key object versus using more memory as a result of separate key object used
by the application for each entry. If this method is not called, then the
default of false is used (e.g. the key is NOT copied).
Note, to avoid an IllegalStateException, this method must be called
prior to the ObjectGrid.initialize() method. Also, keep in mind that the
ObjectGrid.getSession() method implicitly calls the
ObjectGrid.initialize() method if it has yet to be called by the application.
copy - If true is specified, then this BackingMap
uses the ObjectTransformer.copyKey(Object) method
to copy the key object when necessary.
java.lang.IllegalStateException - if this method is called after the
ObjectGrid.initialize() method is called.ObjectGrid.initialize(),
ObjectGrid.getSession(),
ObjectTransformer.copyKey(Object)boolean getCopyKey()
BackingMap.
setCopyKey(boolean)
method or the default value of false if setCopyKey
was never called.setCopyKey(boolean)void setTimeToLive(int seconds)
If this method is not called, the lifetime of an entry is forever (or until
the application explicitly removes or invalidates the entry, or a user
defined Evictor evicts the entry).
Note, to avoid an IllegalStateException, this method must be called
prior to the ObjectGrid.initialize() method. Also, keep in mind that the
ObjectGrid.getSession() method implicitly calls the
ObjectGrid.initialize() method if it has yet to be called by the application.
seconds - the number of seconds a map entry is allowed to live in map
before being evicted.
java.lang.IllegalArgumentException - if seconds is less than 0.
java.lang.IllegalStateException - if this method is called after the
ObjectGrid.initialize() method is called.setTtlEvictorType(TTLType),
ObjectMap.setTimeToLive(int),
ObjectGrid.initialize(),
ObjectGrid.getSession()int getTimeToLive()
This value returned is in seconds and 0 indicates forever.
setTimeToLive(int) method or
0 if setLockTimeout was never called.setTimeToLive(int)void setTtlEvictorType(TTLType type)
BackingMap entry is computed.
If this method is not called, TTLType.NONE is used
to indicate the map entry has no expiration time (e.g. is allowed to live
until explicitly removed or invalidated by the application, or evicted
by a user defined Evictor).
Note, to avoid an IllegalStateException, this method must be called
prior to the ObjectGrid.initialize() method. Also, keep in mind that the
ObjectGrid.getSession() method implicitly calls the
ObjectGrid.initialize() method if it has yet to be called by the application.
type - must be one of the public constants declared in the
TTLType class.
java.lang.IllegalStateException - if this method is called after the
ObjectGrid.initialize() method is called.TTLType,
ObjectGrid.initialize(),
ObjectGrid.getSession()TTLType getTtlEvictorType()
BackingMap entry is computed.
TTLType that was passed to the setTtlEvictorType(TTLType) or
TTLType.NONE if setTtlEvictorType was never called.setTtlEvictorType(TTLType),
TTLType
void createDynamicIndex(java.lang.String name,
boolean isRangeIndex,
java.lang.String attributeName,
DynamicIndexCallback dynamicIndexCallback)
throws IndexAlreadyDefinedException,
java.lang.IllegalArgumentException
BackingMap.
When security is enabled, this method requires a ServerMapPermission
with action "dynamicIndex" when creating a dynamic index on a server from a client process. Refer to
ServerMapPermission for more permission details.
name - the name of the index. The name can not be null or a zero length string.isRangeIndex - Indicate whether to create a MapRangeIndex or a MapIndex.
If set to true, the index will be a type of MapRangeIndex.attributeName - The name of the attribute to be indexed. The attributeName can not be null or a zero length string.dynamicIndexCallback - The callback that will invoke upon dynamic index events. The dynamicIndexCallback
is optional and can be null.
java.lang.IllegalArgumentException - if name or attributeName is null or a zero length string.
IndexAlreadyDefinedException - if a MapIndexPlugin with the specified name already exists.MapIndex,
MapIndexPlugin,
MapRangeIndex,
ObjectMap.getIndex(String)
void createDynamicIndex(MapIndexPlugin index,
DynamicIndexCallback dynamicIndexCallback)
throws IndexAlreadyDefinedException,
java.lang.IllegalArgumentException
BackingMap.
When security is enabled, this method requires a ServerMapPermission
with action "dynamicIndex" when creating a dynamic index on a server from a client process. Refer to
ServerMapPermission for more permission details.
index - The index implementation. The index can not be null.dynamicIndexCallback - The callback that will invoke upon dynamic index events. The dynamicIndexCallback
is optional and can be null.
java.lang.IllegalArgumentException - if index is null or
index.getName() returns
null or a zero length
string.
IndexAlreadyDefinedException - if a MapIndexPlugin with the specified name already exists.MapIndexPlugin,
ObjectMap.getIndex(String)
void removeDynamicIndex(java.lang.String name)
throws IndexUndefinedException,
java.lang.IllegalArgumentException
BackingMap.
When security is enabled, this method requires a ServerMapPermission
with action "dynamicIndex" when removing a dynamic index on a server from a client process. Refer to
ServerMapPermission for more permission details.
name - the name of the index. The name can not be null.
java.lang.IllegalArgumentException - if name is null.
IndexUndefinedException - if a MapIndexPlugin with the specified name does not exists.createDynamicIndex(MapIndexPlugin, DynamicIndexCallback),
createDynamicIndex(String, boolean, String, DynamicIndexCallback)PartitionManager getPartitionManager()
PartitionManager that is defined for this
BackingMap. This access may be useful for Loaders during
Loader.preloadMap(Session, BackingMap) processing (to properly partition
the data to be loaded).
- Returns:
PartitionManager associated with this BackingMap.- Since:
- WAS XD 6.0.1
- See Also:
PartitionManager,
Loader.preloadMap(Session, BackingMap)
EntityMetadata getEntityMetadata()
int getMapType()
The return value is equivalent to one of the constants declared on this interface,
LOCAL, SERVER, or CLIENT.
|
IBM WebSphere Extended Deployment (XD)TM, Release 6.1 ObjectGrid API Specification |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||