Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


com.tangosol.net.cache
Class ReadWriteBackingMap.Entry

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.net.cache.BackingMapBinaryEntry
          extended by com.tangosol.net.cache.ReadWriteBackingMap.Entry

All Implemented Interfaces:
BinaryEntry, InvocableMap.Entry, QueryMap.Entry, java.util.Map.Entry
Enclosing class:
ReadWriteBackingMap

public class ReadWriteBackingMap.Entry
extends BackingMapBinaryEntry

A queue entry that is scheduled to come out of the front of the queue no earlier than some specific point in time.

Since:
Coherence 3.6

Field Summary

 

Fields inherited from class com.tangosol.net.cache.BackingMapBinaryEntry
m_binKey, m_binValue, m_binValueOrig, m_cExpiryDelay, m_ctx, m_oKey, m_oValue, m_oValueOrig, NO_VALUE

 

Constructor Summary
ReadWriteBackingMap.Entry(Binary binKey, Binary binValue, Binary binValueOrig, BackingMapManagerContext ctx)
          Construct an Entry with just a key.

 

Method Summary
 void expire(long cMillis)
          Update the entry with the specified expiry delay.
 ObservableMap getBackingMap()
          Obtain a reference to the backing map that this Entry corresponds to.
 Binary getChangedBinaryValue()
          Return the Binary value changed by the BinaryEntryStore.
 long getRipeMillis()
          Determine when the entry becomes ripe to be persisted.
 boolean isChanged()
          Specifies whether or not the underlying value has been changed during BinaryEntryStore operations.
 boolean isRemoved()
          Specifies whether or not the underlying value has been removed during BinaryEntryStore operations.
protected  void setRipeMillis(long ldtMillis)
          Specify the times when the entry has to be persisted.
 java.lang.Object setValue(java.lang.Object oValue)
          Store the value corresponding to this entry.
protected  void startTracking()
          Start tracking changes by the BinaryEntryStore.
protected  void stopTracking()
          Stop tracking changes by the BinaryEntryStore.
 void updateBinaryValue(Binary binValue)
          Update the binary value for this entry.

 

Methods inherited from class com.tangosol.net.cache.BackingMapBinaryEntry
equals, extract, getBackingMapContext, getBinaryKey, getBinaryValue, getContext, getExpiryDelay, getKey, getOriginalBinaryValue, getOriginalValue, getSerializer, getValue, hashCode, isPresent, isReadOnly, remove, setValue, toString, update

 

Constructor Detail

ReadWriteBackingMap.Entry

public ReadWriteBackingMap.Entry(Binary binKey,
                                 Binary binValue,
                                 Binary binValueOrig,
                                 BackingMapManagerContext ctx)
Construct an Entry with just a key.
Parameters:
binKey - the Binary key
binValue - the Binary value; could be null representing a non-existing or removed entry
binValueOrig - an original Binary value; could be null representing a non-existing entry
ctx - the BackingMapManagerContext

Method Detail

setValue

public java.lang.Object setValue(java.lang.Object oValue)
Store the value corresponding to this entry. If the entry does not exist, then the entry will be created by invoking this method, even with a null value (assuming the Map supports null values).
Specified by:
setValue in interface InvocableMap.Entry
Specified by:
setValue in interface java.util.Map.Entry
Overrides:
setValue in class BackingMapBinaryEntry
Parameters:
oValue - the new value for this Entry
Returns:
the previous value of this Entry, or null if the Entry did not exist

updateBinaryValue

public void updateBinaryValue(Binary binValue)
Update the binary value for this entry.

Passing a non-null binary is functionally equivalent to:

   setValue(getContext().getValueFromInternalConverter().convert(binValue));
 
Passing null value is functionally equivalent to removing the entry.
   remove(false);
 
Specified by:
updateBinaryValue in interface BinaryEntry
Overrides:
updateBinaryValue in class BackingMapBinaryEntry
Parameters:
binValue - a raw binary value to for this entry or null

getBackingMap

public ObservableMap getBackingMap()
Obtain a reference to the backing map that this Entry corresponds to. The returned Map should be used in a read-only manner.

Note: This method is a shortcut for the getBackingMapContext.getBackingMap() call. As of Coherence 3.7, the returned type has been narrowed to ObservableMap.

Specified by:
getBackingMap in interface BinaryEntry
Overrides:
getBackingMap in class BackingMapBinaryEntry
Returns:
the backing map reference; null if the entry does not have any backing map association

expire

public void expire(long cMillis)
Update the entry with the specified expiry delay.

Note: this method only has an effect only if the associated backing map implements the CacheMap interface

Specified by:
expire in interface BinaryEntry
Overrides:
expire in class BackingMapBinaryEntry
Parameters:
cMillis - the number of milliseconds until the entry will expire; pass CacheMap.EXPIRY_DEFAULT to use the default expiry setting; pass CacheMap.EXPIRY_NEVER to indicate that the entry should never expire

getRipeMillis

public long getRipeMillis()
Determine when the entry becomes ripe to be persisted.
Returns:
the time at which the entry becomes ripe

setRipeMillis

protected void setRipeMillis(long ldtMillis)
Specify the times when the entry has to be persisted. This property is immutable once set.
Parameters:
ldtMillis - the time when the entry becomes ripe

isChanged

public boolean isChanged()
Specifies whether or not the underlying value has been changed during BinaryEntryStore operations.
Returns:
true iff during the BinaryEntryStore operations any of the value mutating methods were called (including remove)

isRemoved

public boolean isRemoved()
Specifies whether or not the underlying value has been removed during BinaryEntryStore operations.
Returns:
true iff during the BinaryEntryStore operations the remove() operation was called

getChangedBinaryValue

public Binary getChangedBinaryValue()
Return the Binary value changed by the BinaryEntryStore.
Returns:
the changed Binary value

startTracking

protected void startTracking()
Start tracking changes by the BinaryEntryStore.

stopTracking

protected void stopTracking()
Stop tracking changes by the BinaryEntryStore.

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


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