Class CacheObjectImpl
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.CacheObjectAdapter
-
- org.apache.ignite.internal.processors.cache.CacheObjectImpl
-
- All Implemented Interfaces:
Externalizable,Serializable,CacheObject,Message
- Direct Known Subclasses:
PlatformCacheObjectImpl,UserCacheObjectImpl
public class CacheObjectImpl extends CacheObjectAdapter
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.ignite.internal.processors.cache.CacheObjectAdapter
HEAD_SIZE, val, valBytes
-
Fields inherited from interface org.apache.ignite.internal.processors.cache.CacheObject
TYPE_BINARY, TYPE_BINARY_ENUM, TYPE_BYTE_ARR, TYPE_REGULAR
-
Fields inherited from interface org.apache.ignite.plugin.extensions.communication.Message
DIRECT_TYPE_SIZE
-
-
Constructor Summary
Constructors Constructor Description CacheObjectImpl()CacheObjectImpl(Object val, byte[] valBytes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description shortdirectType()Gets message type.booleanequals(Object obj)voidfinishUnmarshal(CacheObjectValueContext ctx, ClassLoader ldr)inthashCode()booleanisPlatformType()Gets flag indicating whether object value is a platform type.voidonAckReceived()Method called when ack message received.CacheObjectprepareForCache(CacheObjectContext ctx)Prepares cache object for cache (e.g. copies user-provided object if needed).voidprepareMarshal(CacheObjectValueContext ctx)<T> Tvalue(CacheObjectValueContext ctx, boolean cpy)<T> Tvalue(CacheObjectValueContext ctx, boolean cpy, ClassLoader ldr)Deserializes a value from an internal representation.byte[]valueBytes(CacheObjectValueContext ctx)-
Methods inherited from class org.apache.ignite.internal.processors.cache.CacheObjectAdapter
cacheObjectType, fieldsCount, needCopy, objectPutSize, putValue, putValue, putValue, putValue, putValue, putValue, readExternal, readFrom, toString, valueBytesFromValue, valueBytesLength, valueFromValueBytes, writeExternal, writeTo
-
-
-
-
Constructor Detail
-
CacheObjectImpl
public CacheObjectImpl()
-
CacheObjectImpl
public CacheObjectImpl(Object val, byte[] valBytes)
- Parameters:
val- Value.valBytes- Value bytes.
-
-
Method Detail
-
isPlatformType
public boolean isPlatformType()
Gets flag indicating whether object value is a platform type. Platform types will be automatically deserialized on public API cache operations regardless whetherIgniteCache.withKeepBinary()is used or not.- Returns:
- Platform type flag.
-
value
@Nullable public <T> T value(CacheObjectValueContext ctx, boolean cpy)
- Parameters:
ctx- Context.cpy- Iftrueneed to copy value.- Returns:
- Value.
-
value
@Nullable public <T> T value(CacheObjectValueContext ctx, boolean cpy, ClassLoader ldr)
Deserializes a value from an internal representation.- Parameters:
ctx- Context.cpy- Iftrueneed to copy value.ldr- Class loader, if it isnull, default class loader will be used.- Returns:
- Value.
-
valueBytes
public byte[] valueBytes(CacheObjectValueContext ctx) throws IgniteCheckedException
- Parameters:
ctx- Context.- Returns:
- Value bytes.
- Throws:
IgniteCheckedException- If failed.
-
prepareMarshal
public void prepareMarshal(CacheObjectValueContext ctx) throws IgniteCheckedException
- Parameters:
ctx- Context.- Throws:
IgniteCheckedException- If failed.
-
finishUnmarshal
public void finishUnmarshal(CacheObjectValueContext ctx, ClassLoader ldr) throws IgniteCheckedException
- Parameters:
ctx- Context.ldr- Class loader.- Throws:
IgniteCheckedException- If failed.
-
onAckReceived
public void onAckReceived()
Method called when ack message received.
-
directType
public short directType()
Gets message type.- Returns:
- Message type.
-
prepareForCache
public CacheObject prepareForCache(CacheObjectContext ctx)
Prepares cache object for cache (e.g. copies user-provided object if needed).- Parameters:
ctx- Cache context.- Returns:
- Instance to store in cache.
-
-