Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


com.tangosol.util
Interface BinaryEntry

All Superinterfaces:
InvocableMap.Entry, java.util.Map.Entry, QueryMap.Entry
All Known Implementing Classes:
BackingMapBinaryEntry, ConverterCollections.ConverterMapEvent.ConverterMapEventBinaryEntry, InvocableMapHelper.RoutingBinaryEntry, ReadWriteBackingMap.Entry

public interface BinaryEntry
extends InvocableMap.Entry

Map.Entry that internally stores both key and value in a Binary format and uses an underlying Serializer to convert it to and from an Object view.

Since:
Coherence 3.5
Author:
as 2009.01.05

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.
 BackingMapContext getBackingMapContext()
          Obtain a reference to the backing map context for the cache that this Entry corresponds to.
 Binary getBinaryKey()
          Return a raw binary key for this entry.
 Binary getBinaryValue()
          Return a raw binary value for this entry.
 BackingMapManagerContext getContext()
          Return the context this entry operates within.
 Binary getOriginalBinaryValue()
          Return a raw original binary value for this entry.
 java.lang.Object getOriginalValue()
          Return an original value for this entry.
 Serializer getSerializer()
          Return a Serializer that is used to serialize/deserialize this entry.
 boolean isReadOnly()
          Check whether this BinaryEntry allows data modification operations.
 void remove(boolean fSynthetic)
          Remove this Entry from the Map if it is present in the Map.
 void setValue(java.lang.Object oValue, boolean fSynthetic)
          Store the value corresponding to this entry.
 void updateBinaryValue(Binary binValue)
          Update the binary value for this entry.
 void updateBinaryValue(Binary binValue, boolean fSynthetic)
          Update the binary value for this entry.

 

Methods inherited from interface com.tangosol.util.InvocableMap.Entry
getKey, getValue, isPresent, setValue, update

 

Methods inherited from interface com.tangosol.util.QueryMap.Entry
extract

 

Methods inherited from interface java.util.Map.Entry
equals, hashCode

 

Method Detail

getBinaryKey

Binary getBinaryKey()
Return a raw binary key for this entry.
Returns:
a raw binary key for this entry

getBinaryValue

Binary getBinaryValue()
Return a raw binary value for this entry.
Returns:
a raw binary value for this entry; null if the value does not exist

getSerializer

Serializer getSerializer()
Return a Serializer that is used to serialize/deserialize this entry.
Returns:
a Serializer that is used to serialize/deserialize this entry

getContext

BackingMapManagerContext getContext()
Return the context this entry operates within.

Note: This method is a shortcut for the getBackingMapContext.getManagerContext() call.

Returns:
the BackingMapManagerContext for this entry

updateBinaryValue

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);
 
Parameters:
binValue - new binary value to be stored in this entry or null

updateBinaryValue

void updateBinaryValue(Binary binValue,
                       boolean fSynthetic)
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);
 
This method will bypass any CacheStore or BinaryEntryStore implementations, iff fSynthetic is true and the BackingMap associated with this entry is a ReadWriteBackingMap.
Parameters:
binValue - new binary value to be stored in this entry or null
fSynthetic - pass true only if the insertion into or modification of the Map should be treated as a synthetic event
Since:
Coherence 12.1.2

getOriginalValue

java.lang.Object getOriginalValue()
Return an original value for this entry.
Returns:
an original value for this entry
Since:
Coherence 3.6

getOriginalBinaryValue

Binary getOriginalBinaryValue()
Return a raw original binary value for this entry.
Returns:
a raw original binary value for this entry; null if the original value did not exist
Since:
Coherence 3.6

getBackingMap

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.

Returns:
the backing map reference; null if the entry does not have any backing map association
Since:
Coherence 3.6

getBackingMapContext

BackingMapContext getBackingMapContext()
Obtain a reference to the backing map context for the cache that this Entry corresponds to.
Returns:
the corresponding BackingMapContext; null if the entry does not have any backing map association
Since:
Coherence 3.7

expire

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

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
Since:
Coherence 3.7

isReadOnly

boolean isReadOnly()
Check whether this BinaryEntry allows data modification operations.
Returns:
true iff the entry is "read-only"
Since:
Coherence 3.7

setValue

void setValue(java.lang.Object oValue,
              boolean fSynthetic)
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).

Unlike the other form of setValue, this form does not return the previous value, and as a result may be significantly less expensive (in terms of cost of execution) for certain Map implementations.

As of Coherence 12.1.2, if fSynthetic is true and the BackingMap associated with this entry is a ReadWriteBackingMap, this method will bypass the CacheStore or BinaryEntryStore.

Specified by:
setValue in interface InvocableMap.Entry
Parameters:
oValue - the new value for this Entry
fSynthetic - pass true only if the insertion into or modification of the Map should be treated as a synthetic event

remove

void remove(boolean fSynthetic)
Remove this Entry from the Map if it is present in the Map.

This method supports both the operation corresponding to Map.remove(java.lang.Object) as well as synthetic operations such as eviction. If the containing Map does not differentiate between the two, then this method will always be identical to InvocableMap.this.remove(getKey()).

As of Coherence 12.1.2, if fSynthetic is true and the BackingMap associated with this entry is a ReadWriteBackingMap, this method will bypass the CacheStore or BinaryEntryStore.

Specified by:
remove in interface InvocableMap.Entry
Parameters:
fSynthetic - pass true only if the removal from the Map should be treated as a synthetic event

Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


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