Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


com.tangosol.net.cache
Class CompactSerializationCache.DeferredCacheEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.tangosol.util.MapEvent
          extended by com.tangosol.net.cache.CacheEvent
              extended by com.tangosol.net.cache.CompactSerializationCache.DeferredCacheEvent

All Implemented Interfaces:
java.io.Serializable
Enclosing class:
CompactSerializationCache

protected class CompactSerializationCache.DeferredCacheEvent
extends CacheEvent

A DeferredCacheEvent is a CacheEvent object that defers the loading of the old value.

This event has two predominant states; active and inactive. The event is active from incarnation and can transition to inactive (via deactivate()) but not vice-versa. Being active allows the getOldValue implementation to load the value from the BinaryStore, thus all consumers of this event must ensure they call getOldValue prior to returning control when this event is dispatched.

Once inactive the correct value may no longer be available in the BinaryStore thus in this state a getOldValue will not perform a load, however will return either null or the cached old value.


Nested Class Summary

 

Nested classes/interfaces inherited from class com.tangosol.net.cache.CacheEvent
CacheEvent.TransformationState

 

Field Summary
protected  Binary f_binKey
          The Binary key used to retrieve the Binary value from the BinaryStore.
protected  boolean m_fActive
          Whether the DeferredCacheEvent is in an active or inactive state.

 

Fields inherited from class com.tangosol.net.cache.CacheEvent
m_fSynthetic, m_transformState

 

Fields inherited from class com.tangosol.util.MapEvent
ENTRY_DELETED, ENTRY_INSERTED, ENTRY_UPDATED, m_nId, m_oKey, m_oValueNew, m_oValueOld

 

Fields inherited from class java.util.EventObject
source

 

Constructor Summary
CompactSerializationCache.DeferredCacheEvent(int nId, Binary binKey, java.lang.Object oKey, java.lang.Object oValueOld, java.lang.Object oValueNew, boolean fSynthetic)
          Constructs a new DeferredCacheEvent.

 

Method Summary
protected  void deactivate()
          Deactivate this DeferredCacheEvent instance resulting in any future getOldValue() calls using the cached value ultimately bypassing load.
 java.lang.Object getOldValue()
          Return an old value associated with this event.

 

Methods inherited from class com.tangosol.net.cache.CacheEvent
getDescription, getTransformationState, isSynthetic

 

Methods inherited from class com.tangosol.util.MapEvent
dispatch, dispatch, dispatch, getDescription, getId, getKey, getMap, getNewEntry, getNewValue, getOldEntry, toString

 

Methods inherited from class java.util.EventObject
getSource

 

Field Detail

f_binKey

protected final Binary f_binKey
The Binary key used to retrieve the Binary value from the BinaryStore.

m_fActive

protected volatile boolean m_fActive
Whether the DeferredCacheEvent is in an active or inactive state.

Constructor Detail

CompactSerializationCache.DeferredCacheEvent

public CompactSerializationCache.DeferredCacheEvent(int nId,
                                                    Binary binKey,
                                                    java.lang.Object oKey,
                                                    java.lang.Object oValueOld,
                                                    java.lang.Object oValueNew,
                                                    boolean fSynthetic)
Constructs a new DeferredCacheEvent.
Parameters:
nId - this event's id, one of MapEvent.ENTRY_INSERTED, MapEvent.ENTRY_UPDATED or MapEvent.ENTRY_DELETED
binKey - the binary key into the map
oKey - the key into the map
oValueOld - the old value (for update and delete events)
oValueNew - the new value (for insert and update events)
fSynthetic - true iff the event is caused by the cache internal processing such as eviction or loading

Method Detail

getOldValue

public java.lang.Object getOldValue()
Return an old value associated with this event.

The old value represents a value deleted from or updated in a map. It is always null for "insert" notifications.

Overrides:
getOldValue in class MapEvent
Returns:
an old value

deactivate

protected void deactivate()
Deactivate this DeferredCacheEvent instance resulting in any future getOldValue() calls using the cached value ultimately bypassing load.

The contract between the DeferredCacheEvent and consumers of the event states that consumers must call getOldValue prior to returning from fireEvent.


Skip navigation links

Oracle® Fusion Middleware Java API Reference for Oracle Coherence
12c (12.1.3.0.0)

E47890-01


Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.