public abstract class GridCacheMessage<K,V> extends GridTcpCommunicationMessageAdapter
| Modifier and Type | Field and Description |
|---|---|
static String |
CACHE_MSG_INDEX_FIELD_NAME
Cache message index field name.
|
static int |
MAX_CACHE_MSG_LOOKUP_INDEX
Maximum number of cache lookup indexes.
|
BIT_SET_NOT_READ, BOOLEAN_ARR_NOT_READ, BYTE_ARR_LIST_NOT_READ, BYTE_ARR_NOT_READ, CACHE_VER_NOT_READ, CHAR_ARR_NOT_READ, CLOCK_DELTA_VER_NOT_READ, commState, DHT_PART_EXCHANGE_ID_NOT_READ, DOUBLE_ARR_NOT_READ, DR_INT_REQ_ENTRY_NOT_READ, ENUM_NOT_READ, FLOAT_ARR_NOT_READ, GRID_UUID_NOT_READ, INT_ARR_NOT_READ, LONG_ARR_NOT_READ, LONG_LIST_NOT_READ, MSG_NOT_READ, NULL, SHORT_ARR_NOT_READ, STR_NOT_READ, UUID_NOT_READ, VAL_BYTES_NOT_READ| Constructor and Description |
|---|
GridCacheMessage() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowForStartup() |
Exception |
classError() |
protected void |
clone0(GridTcpCommunicationMessageAdapter _msg)
Clones all fields of the provided message to
this. |
GridDeploymentInfo |
deployInfo() |
void |
finishUnmarshal(GridCacheContext<K,V> ctx,
ClassLoader ldr)
This method is called after the message is deserialized and is responsible for
unmarshalling state marshalled in
prepareMarshal(GridCacheContext) method. |
boolean |
ignoreClassErrors() |
int |
lookupIndex()
Gets message lookup index.
|
protected LinkedHashMap<byte[],Boolean> |
marshalBooleanLinkedMap(LinkedHashMap<?,Boolean> map,
GridCacheContext<K,V> ctx) |
protected List<byte[]> |
marshalCollection(Collection<?> col,
GridCacheContext<K,V> ctx) |
protected <T> byte[][] |
marshalFilter(GridPredicate<GridCacheEntry<K,V>>[] filter,
GridCacheContext<K,V> ctx) |
protected void |
marshalInfo(GridCacheEntryInfo<K,V> info,
GridCacheContext<K,V> ctx) |
protected void |
marshalInfos(Iterable<? extends GridCacheEntryInfo<K,V>> infos,
GridCacheContext<K,V> ctx) |
protected void |
marshalTx(Iterable<GridCacheTxEntry<K,V>> txEntries,
GridCacheContext<K,V> ctx) |
protected List<GridCacheValueBytes> |
marshalValuesCollection(Collection<?> col,
GridCacheContext<K,V> ctx) |
long |
messageId() |
static int |
nextIndexId()
Gets next ID for indexed message ID.
|
void |
onClassError(Exception err)
If class loading error occurred during unmarshalling and
ignoreClassErrors() is
set to true, then the error will be passed into this method. |
void |
prepare(GridDeploymentInfo depInfo) |
protected void |
prepareFilter(GridPredicate<GridCacheEntry<K,V>>[] filters,
GridCacheContext<K,V> ctx) |
void |
prepareMarshal(GridCacheContext<K,V> ctx)
This method is called before the whole message is serialized
and is responsible for pre-marshalling state.
|
protected void |
prepareObject(Object o,
GridCacheContext<K,V> ctx) |
protected void |
prepareObjects(Iterable<?> col,
GridCacheContext<K,V> ctx) |
boolean |
readFrom(ByteBuffer buf) |
long |
topologyVersion()
Gets topology version or -1 in case of topology version is not required for this message.
|
String |
toString() |
protected <K1> LinkedHashMap<K1,Boolean> |
unmarshalBooleanLinkedMap(Map<byte[],Boolean> byteMap,
GridCacheContext<K,V> ctx,
ClassLoader ldr) |
protected <T> List<T> |
unmarshalCollection(Collection<byte[]> byteCol,
GridCacheContext<K,V> ctx,
ClassLoader ldr) |
protected <T> GridPredicate<GridCacheEntry<K,V>>[] |
unmarshalFilter(byte[][] byteCol,
GridCacheContext<K,V> ctx,
ClassLoader ldr) |
protected void |
unmarshalInfo(GridCacheEntryInfo<K,V> info,
GridCacheContext<K,V> ctx,
ClassLoader ldr) |
protected void |
unmarshalInfos(Iterable<? extends GridCacheEntryInfo<K,V>> infos,
GridCacheContext<K,V> ctx,
ClassLoader ldr) |
protected void |
unmarshalTx(Iterable<GridCacheTxEntry<K,V>> txEntries,
GridCacheContext<K,V> ctx,
ClassLoader ldr) |
protected <T> List<T> |
unmarshalValueBytesCollection(Collection<GridCacheValueBytes> byteCol,
GridCacheContext<K,V> ctx,
ClassLoader ldr) |
boolean |
writeTo(ByteBuffer buf) |
arrayIterator, clone, directType, messageReader, messageWriterpublic static final int MAX_CACHE_MSG_LOOKUP_INDEX
public static final String CACHE_MSG_INDEX_FIELD_NAME
public static int nextIndexId()
public boolean allowForStartup()
True if this message is preloader message.public boolean ignoreClassErrors()
True if class loading errors should be ignored, false otherwise.public int lookupIndex()
MAX_CACHE_MSG_LOOKUP_INDEX.public void onClassError(Exception err)
ignoreClassErrors() is
set to true, then the error will be passed into this method.err - Error.public Exception classError()
onClassError(Exception) method.public long messageId()
public long topologyVersion()
protected final void prepareFilter(@Nullable GridPredicate<GridCacheEntry<K,V>>[] filters, GridCacheContext<K,V> ctx) throws GridException
filters - Predicate filters.ctx - Context.GridException - If failed.protected final void prepareObject(@Nullable Object o, GridCacheContext<K,V> ctx) throws GridException
o - Object to prepare for marshalling.ctx - Context.GridException - If failed.protected final void prepareObjects(@Nullable Iterable<?> col, GridCacheContext<K,V> ctx) throws GridException
col - Collection of objects to prepare for marshalling.ctx - Cache context.GridException - If failed.public final void prepare(GridDeploymentInfo depInfo)
depInfo - Deployment to set.GridCacheDeployable.prepare(GridDeploymentInfo)public GridDeploymentInfo deployInfo()
GridCacheDeployable.deployInfo()public void prepareMarshal(GridCacheContext<K,V> ctx) throws GridException
ctx - Cache context.GridException - If failed.public void finishUnmarshal(GridCacheContext<K,V> ctx, ClassLoader ldr) throws GridException
prepareMarshal(GridCacheContext) method.ctx - Context.ldr - Class loader.GridException - If failed.protected final void marshalInfo(GridCacheEntryInfo<K,V> info, GridCacheContext<K,V> ctx) throws GridException
info - Entry to marshal.ctx - Context.GridException - If failed.protected final void unmarshalInfo(GridCacheEntryInfo<K,V> info, GridCacheContext<K,V> ctx, ClassLoader ldr) throws GridException
info - Entry to unmarshal.ctx - Context.ldr - Loader.GridException - If failed.protected final void marshalInfos(Iterable<? extends GridCacheEntryInfo<K,V>> infos, GridCacheContext<K,V> ctx) throws GridException
infos - Entries to marshal.ctx - Context.GridException - If failed.protected final void unmarshalInfos(Iterable<? extends GridCacheEntryInfo<K,V>> infos, GridCacheContext<K,V> ctx, ClassLoader ldr) throws GridException
infos - Entries to unmarshal.ctx - Context.ldr - Loader.GridException - If failed.protected final void marshalTx(Iterable<GridCacheTxEntry<K,V>> txEntries, GridCacheContext<K,V> ctx) throws GridException
txEntries - Entries to marshal.ctx - Context.GridException - If failed.protected final void unmarshalTx(Iterable<GridCacheTxEntry<K,V>> txEntries, GridCacheContext<K,V> ctx, ClassLoader ldr) throws GridException
txEntries - Entries to unmarshal.ctx - Context.ldr - Loader.GridException - If failed.@Nullable protected final <T> byte[][] marshalFilter(@Nullable GridPredicate<GridCacheEntry<K,V>>[] filter, GridCacheContext<K,V> ctx) throws GridException
filter - Collection to marshal.ctx - Context.GridException - If failed.@Nullable protected final <T> GridPredicate<GridCacheEntry<K,V>>[] unmarshalFilter(@Nullable byte[][] byteCol, GridCacheContext<K,V> ctx, ClassLoader ldr) throws GridException
byteCol - Collection to unmarshal.ctx - Context.ldr - Loader.GridException - If failed.@Nullable protected List<GridCacheValueBytes> marshalValuesCollection(@Nullable Collection<?> col, GridCacheContext<K,V> ctx) throws GridException
col - Values collection to marshal.ctx - Context.GridException - If failed.@Nullable protected <T> List<T> unmarshalValueBytesCollection(@Nullable Collection<GridCacheValueBytes> byteCol, GridCacheContext<K,V> ctx, ClassLoader ldr) throws GridException
byteCol - Collection to unmarshal.ctx - Context.ldr - Loader.GridException - If failed.@Nullable protected List<byte[]> marshalCollection(@Nullable Collection<?> col, GridCacheContext<K,V> ctx) throws GridException
col - Collection to marshal.ctx - Context.GridException - If failed.@Nullable protected <T> List<T> unmarshalCollection(@Nullable Collection<byte[]> byteCol, GridCacheContext<K,V> ctx, ClassLoader ldr) throws GridException
byteCol - Collection to unmarshal.ctx - Context.ldr - Loader.GridException - If failed.@Nullable protected final LinkedHashMap<byte[],Boolean> marshalBooleanLinkedMap(@Nullable LinkedHashMap<?,Boolean> map, GridCacheContext<K,V> ctx) throws GridException
map - Map to marshal.ctx - Context.GridException - If failed.@Nullable protected final <K1> LinkedHashMap<K1,Boolean> unmarshalBooleanLinkedMap(@Nullable Map<byte[],Boolean> byteMap, GridCacheContext<K,V> ctx, ClassLoader ldr) throws GridException
byteMap - Map to unmarshal.ctx - Context.ldr - Loader.GridException - If failed.protected void clone0(GridTcpCommunicationMessageAdapter _msg)
this.clone0 in class GridTcpCommunicationMessageAdapter_msg - Message to clone from.public boolean writeTo(ByteBuffer buf)
writeTo in class GridTcpCommunicationMessageAdapterbuf - Byte buffer.public boolean readFrom(ByteBuffer buf)
readFrom in class GridTcpCommunicationMessageAdapterbuf - Byte buffer.Copyright © 2014. All rights reserved.