|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BackingMapContext
The BackingMapContext provides an execution context to server side agents such as EntryProcessors
and EntryAggregators
. As of Coherence 3.7, this context is also used to initialize pluggable indexes
to provide contextual knowledge about the backing map and cache for which the index is created.
Method Summary | |
---|---|
ObservableMap |
getBackingMap() Deprecated. As of Coherence 12.1.3, replaced with getBackingMapEntry(java.lang.Object) |
InvocableMap.Entry |
getBackingMapEntry(java.lang.Object oKey) Return an InvocableMap.Entry for the specified key (in its internal format) from the associated cache, obtaining exclusive access to that cache entry. |
java.lang.String |
getCacheName() Return the name of the cache that this BackingMapContext is associated with. |
java.util.Map |
getIndexMap() Return a map of indexes defined for the cache that this BackingMapContext is associated with. |
BackingMapManagerContext |
getManagerContext() Return the "parent" BackingMapManagerContext for this context. |
InvocableMap.Entry |
getReadOnlyEntry(java.lang.Object oKey) Return an read-only InvocableMap.Entry for the specified key (in its internal format) from the associated cache. |
Method Detail |
---|
BackingMapManagerContext getManagerContext()
BackingMapManagerContext
for this context. Inversely, this context could be retrieved using the getBackingMapContext
API.BackingMapManagerContext
java.lang.String getCacheName()
cache
that this BackingMapContext is associated with.ObservableMap getBackingMap()
getBackingMapEntry(java.lang.Object)
instantiateBackingMap
call. In the case the returned map is not observable
, it will be wrapped by the WrapperObservableMap
.java.util.Map getIndexMap()
cache
that this BackingMapContext is associated with. The returned map must be treated in the read-only manner.InvocableMap.Entry getBackingMapEntry(java.lang.Object oKey)
This method may only be called within the context of an EntryProcessor invocation. Any changes made to the entry will be persisted with the same lifecycle as those made by the enclosing invocation. The returned entry is only valid for the duration of the enclosing invocation and multiple calls to this method within the same invocation context will return the same entry object.
Because this method implicitly locks the specified cache entry, callers may use it to access, insert, update, modify, or remove cache entries from within the context of an EntryProcessor invocation. Operating on the entries returned by this method differs from operating directly against the backing map, as the returned entries provide an isolated, read-consistent view. The implicit lock acquisition attempted by this method could create a deadlock if entries are locked in conflicting orders on different threads. It is the caller's responsibility to ensure that cache entries are accessed (locked) in a deadlock-free manner.
The usage of this method is highly encouraged instead of direct operations against the backing map retrieved by (now deprecated) BackingMapManagerContext.getBackingMap(String)
method.
oKey
- the key (in internal format) to obtain an entry for; must not be nulljava.lang.IllegalStateException
- if called from outside of an EntryProcessor invocation contextjava.lang.IllegalMonitorStateException
- if a deadlock is detected while attempting to obtain exclusive access to the entryjava.lang.IllegalArgumentException
- if attempting to access an entry that does not belong to partition(s) associated with the caller's contextInvocableMap.Entry getReadOnlyEntry(java.lang.Object oKey)
This method may be called within the context of an EntryProcessor or Aggregator invocation
oKey
- the key (in internal format) to obtain an entry for; must not be nulljava.lang.IllegalStateException
- if called from an inactive invocation context
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |