org.apache.ignite.plugin.extensions.communication

## Class MessageAdapter

- java.lang.Object
- - org.apache.ignite.plugin.extensions.communication.MessageAdapter

All Implemented Interfaces:
  Serializable

Direct Known Subclasses:
  GridByteArrayList, GridCacheMessage, GridCacheValueBytes, GridCacheVersion, GridCheckpointRequest, GridClockDeltaSnapshotMessage, GridClockDeltaVersion, GridContinuousMessage, GridDataLoadRequest, GridDataLoadResponse, GridDeploymentInfoBean, GridDeploymentRequest, GridDeploymentResponse, GridDhtPartitionExchangeId, GridEventStorageMessage, GridIoMessage, GridIoUserMessage, GridJobCancelRequest, GridJobExecuteRequest, GridJobExecuteResponse, GridJobSiblingsRequest, GridJobSiblingsResponse, GridLongList, GridStreamerCancelRequest, GridStreamerExecutionRequest, GridStreamerResponse, GridTaskCancelRequest, GridTaskResultRequest, GridTaskResultResponse, GridTaskSessionRequest, IgfsBlockKey, IgfsCommunicationMessage, IgfsFileAffinityRange, JobStealingRequest, TcpCommunicationSpi.HandshakeMessage, TcpCommunicationSpi.NodeIdMessage, TcpCommunicationSpi.RecoveryLastReceivedMessage

    public abstract class MessageAdapter
    extends Object
    implements Serializable

Base class for all communication messages.

See Also:
  Serialized Form

### Nested Class Summary

Nested Classes
`static class` `MessageAdapter.Type` Enum representing possible types of collection items.

### Field Summary

Fields
`protected MessageReader` `reader` Message reader.
`protected int` `readState` Current read state.

### Constructor Summary

Constructors
Constructor and Description
`MessageAdapter()`

### Method Summary

Methods
`abstract byte` `directType()` Gets message type.
`abstract boolean` `readFrom(ByteBuffer buf)` Reads this message from provided byte buffer.
`void` `setReader(MessageReader reader)`
`boolean` `skipRecovery()` Defines whether recovery for this message should be skipped.
`abstract boolean` `writeTo(ByteBuffer buf, MessageWriter writer)` Writes this message to provided byte buffer.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### reader

    protected MessageReader reader

Message reader.

#### readState

    protected int readState

Current read state.

### Constructor Detail

#### MessageAdapter

    public MessageAdapter()

### Method Detail

#### setReader

    public final void setReader(MessageReader reader)

Parameters:
  `reader` - Message reader.

#### writeTo

    public abstract boolean writeTo(ByteBuffer buf,
                  MessageWriter writer)

Writes this message to provided byte buffer.

Parameters:
  `buf` - Byte buffer.
  `writer` - Writer.
Returns:
  Whether message was fully written.

#### readFrom

    public abstract boolean readFrom(ByteBuffer buf)

Reads this message from provided byte buffer.

Parameters:
  `buf` - Byte buffer.
Returns:
  Whether message was fully read.

#### directType

    public abstract byte directType()

Gets message type.

Returns:
  Message type.

#### skipRecovery

    public boolean skipRecovery()

Defines whether recovery for this message should be skipped.

Returns:
  Whether recovery for this message should be skipped.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015