public abstract class GridCacheMessage extends Object implements Message
Modifier and Type | Field and Description |
---|---|
protected boolean |
addDepInfo |
static String |
CACHE_MSG_INDEX_FIELD_NAME
Cache message index field name.
|
protected int |
cacheId
Cache ID.
|
protected boolean |
forceAddDepInfo
Force addition of deployment info regardless of
addDepInfo flag value. |
static int |
MAX_CACHE_MSG_LOOKUP_INDEX
Maximum number of cache lookup indexes.
|
DIRECT_TYPE_SIZE
Constructor and Description |
---|
GridCacheMessage() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
addDeploymentInfo()
Deployment enabled flag indicates whether deployment info has to be added to this message.
|
protected void |
appendFlag(StringBuilder str,
String name) |
int |
cacheId() |
void |
cacheId(int cacheId) |
IgniteCheckedException |
classError() |
GridDeploymentInfo |
deployInfo() |
Throwable |
error() |
void |
finishUnmarshal(GridCacheSharedContext ctx,
ClassLoader ldr)
This method is called after the message is deserialized and is responsible for
unmarshalling state marshalled in
prepareMarshal(GridCacheSharedContext) method. |
protected void |
finishUnmarshalCacheObjects(Collection<? extends CacheObject> col,
GridCacheContext ctx,
ClassLoader ldr) |
void |
finishUnmarshalCacheObjects(List<? extends CacheObject> col,
GridCacheContext ctx,
ClassLoader ldr) |
boolean |
ignoreClassErrors() |
int |
lookupIndex()
Gets message lookup index.
|
protected List<byte[]> |
marshalCollection(Collection<?> col,
GridCacheContext ctx) |
protected void |
marshalInfo(GridCacheEntryInfo info,
GridCacheContext ctx) |
protected void |
marshalInfos(Iterable<? extends GridCacheEntryInfo> infos,
GridCacheContext ctx) |
protected byte[][] |
marshalInvokeArguments(Object[] args,
GridCacheContext ctx) |
protected void |
marshalTx(Iterable<IgniteTxEntry> txEntries,
GridCacheSharedContext ctx) |
long |
messageId() |
IgniteLogger |
messageLogger(GridCacheSharedContext ctx) |
static int |
nextIndexId()
Gets next ID for indexed message ID.
|
void |
onAckReceived()
Method called when ack message received.
|
void |
onClassError(IgniteCheckedException err)
If class loading error occurred during unmarshalling and
ignoreClassErrors() is
set to true , then the error will be passed into this method. |
int |
partition() |
boolean |
partitionExchangeMessage() |
void |
prepare(GridDeploymentInfo depInfo) |
void |
prepareMarshal(GridCacheSharedContext ctx)
This method is called before the whole message is serialized
and is responsible for pre-marshalling state.
|
protected void |
prepareMarshalCacheObject(CacheObject obj,
GridCacheContext ctx) |
protected void |
prepareMarshalCacheObjects(Collection<? extends CacheObject> col,
GridCacheContext ctx) |
void |
prepareMarshalCacheObjects(List<? extends CacheObject> col,
GridCacheContext ctx) |
protected void |
prepareObject(Object o,
GridCacheContext ctx) |
boolean |
readFrom(ByteBuffer buf,
MessageReader reader)
Reads this message from provided byte buffer.
|
AffinityTopologyVersion |
topologyVersion()
Gets topology version or -1 in case of topology version is not required for this message.
|
String |
toString() |
protected boolean |
transferExpiryPolicy() |
protected <T> List<T> |
unmarshalCollection(Collection<byte[]> byteCol,
GridCacheSharedContext ctx,
ClassLoader ldr) |
protected void |
unmarshalInfo(GridCacheEntryInfo info,
GridCacheContext ctx,
ClassLoader ldr) |
protected void |
unmarshalInfos(Iterable<? extends GridCacheEntryInfo> infos,
GridCacheContext ctx,
ClassLoader ldr) |
protected Object[] |
unmarshalInvokeArguments(byte[][] byteCol,
GridCacheSharedContext ctx,
ClassLoader ldr) |
protected void |
unmarshalTx(Iterable<IgniteTxEntry> txEntries,
boolean near,
GridCacheSharedContext ctx,
ClassLoader ldr) |
boolean |
writeTo(ByteBuffer buf,
MessageWriter writer)
Writes this message to provided byte buffer.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
directType, fieldsCount
public static final int MAX_CACHE_MSG_LOOKUP_INDEX
public static final String CACHE_MSG_INDEX_FIELD_NAME
protected boolean addDepInfo
protected boolean forceAddDepInfo
addDepInfo
flag value.@GridToStringInclude protected int cacheId
@Nullable public Throwable error()
public static int nextIndexId()
public boolean partitionExchangeMessage()
True
if this message is partition exchange message.public boolean ignoreClassErrors()
True
if class loading errors should be ignored, false otherwise.public int lookupIndex()
MAX_CACHE_MSG_LOOKUP_INDEX
.public int partition()
-1
if it cannot be determined.public void onClassError(IgniteCheckedException err)
ignoreClassErrors()
is
set to true
, then the error will be passed into this method.err
- Error.public IgniteCheckedException classError()
onClassError(IgniteCheckedException)
method.public long messageId()
public int cacheId()
public void cacheId(int cacheId)
cacheId
- Cache ID.public AffinityTopologyVersion topologyVersion()
public abstract boolean addDeploymentInfo()
true
or if deployment info must be added to the the message, false
otherwise.protected final void prepareObject(@Nullable Object o, GridCacheContext ctx) throws IgniteCheckedException
o
- Object to prepare for marshalling.ctx
- Context.IgniteCheckedException
- If failed.public final void prepare(GridDeploymentInfo depInfo)
depInfo
- Deployment to set.GridCacheDeployable.prepare(GridDeploymentInfo)
public GridDeploymentInfo deployInfo()
GridCacheDeployable.deployInfo()
public void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException
ctx
- Cache context.IgniteCheckedException
- If failed.public void finishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException
prepareMarshal(GridCacheSharedContext)
method.ctx
- Context.ldr
- Class loader.IgniteCheckedException
- If failed.protected final void marshalInfo(GridCacheEntryInfo info, GridCacheContext ctx) throws IgniteCheckedException
info
- Entry to marshal.ctx
- Context.IgniteCheckedException
- If failed.protected final void unmarshalInfo(GridCacheEntryInfo info, GridCacheContext ctx, ClassLoader ldr) throws IgniteCheckedException
info
- Entry to unmarshal.ctx
- Context.ldr
- Loader.IgniteCheckedException
- If failed.protected final void marshalInfos(Iterable<? extends GridCacheEntryInfo> infos, GridCacheContext ctx) throws IgniteCheckedException
infos
- Entries to marshal.ctx
- Context.IgniteCheckedException
- If failed.protected final void unmarshalInfos(Iterable<? extends GridCacheEntryInfo> infos, GridCacheContext ctx, ClassLoader ldr) throws IgniteCheckedException
infos
- Entries to unmarshal.ctx
- Context.ldr
- Loader.IgniteCheckedException
- If failed.protected final void marshalTx(Iterable<IgniteTxEntry> txEntries, GridCacheSharedContext ctx) throws IgniteCheckedException
txEntries
- Entries to marshal.ctx
- Context.IgniteCheckedException
- If failed.protected boolean transferExpiryPolicy()
True
if entries expire policy should be marshalled.protected final void unmarshalTx(Iterable<IgniteTxEntry> txEntries, boolean near, GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException
txEntries
- Entries to unmarshal.ctx
- Context.ldr
- Loader.IgniteCheckedException
- If failed.@Nullable protected final byte[][] marshalInvokeArguments(@Nullable Object[] args, GridCacheContext ctx) throws IgniteCheckedException
args
- Arguments to marshal.ctx
- Context.IgniteCheckedException
- If failed.@Nullable protected final Object[] unmarshalInvokeArguments(@Nullable byte[][] byteCol, GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException
byteCol
- Collection to unmarshal.ctx
- Context.ldr
- Loader.IgniteCheckedException
- If failed.@Nullable protected List<byte[]> marshalCollection(@Nullable Collection<?> col, GridCacheContext ctx) throws IgniteCheckedException
col
- Collection to marshal.ctx
- Context.IgniteCheckedException
- If failed.public final void prepareMarshalCacheObjects(@Nullable List<? extends CacheObject> col, GridCacheContext ctx) throws IgniteCheckedException
col
- Collection.ctx
- Cache context.IgniteCheckedException
- If failed.protected final void prepareMarshalCacheObject(CacheObject obj, GridCacheContext ctx) throws IgniteCheckedException
obj
- Object.ctx
- Context.IgniteCheckedException
- If failed.protected final void prepareMarshalCacheObjects(@Nullable Collection<? extends CacheObject> col, GridCacheContext ctx) throws IgniteCheckedException
col
- Collection.ctx
- Cache context.IgniteCheckedException
- If failed.public final void finishUnmarshalCacheObjects(@Nullable List<? extends CacheObject> col, GridCacheContext ctx, ClassLoader ldr) throws IgniteCheckedException
col
- Collection.ctx
- Context.ldr
- Class loader.IgniteCheckedException
- If failed.protected final void finishUnmarshalCacheObjects(@Nullable Collection<? extends CacheObject> col, GridCacheContext ctx, ClassLoader ldr) throws IgniteCheckedException
col
- Collection.ctx
- Context.ldr
- Class loader.IgniteCheckedException
- If failed.public void onAckReceived()
onAckReceived
in interface Message
@Nullable protected <T> List<T> unmarshalCollection(@Nullable Collection<byte[]> byteCol, GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException
byteCol
- Collection to unmarshal.ctx
- Context.ldr
- Loader.IgniteCheckedException
- If failed.public IgniteLogger messageLogger(GridCacheSharedContext ctx)
ctx
- Context.public boolean writeTo(ByteBuffer buf, MessageWriter writer)
public boolean readFrom(ByteBuffer buf, MessageReader reader)
protected final void appendFlag(StringBuilder str, String name)
str
- Bulder.name
- Flag name.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.0.0 Release Date : April 30 2017