com.hazelcast.nio.serialization
Class DataAdapter

java.lang.Object
  extended by com.hazelcast.nio.serialization.DataAdapter
All Implemented Interfaces:
SocketReadable, SocketWritable
Direct Known Subclasses:
Packet

public class DataAdapter
extends Object
implements SocketWritable, SocketReadable


Field Summary
protected  PortableContext context
           
protected  Data data
           
 
Constructor Summary
DataAdapter(Data data, PortableContext context)
           
DataAdapter(PortableContext context)
           
 
Method Summary
 boolean done()
           
 Data getData()
           
static int getDataSize(Data data, PortableContext context)
           
protected  boolean isStatusSet(int bit)
           
 boolean isUrgent()
          Checks if this SocketWritable is urgent.
 boolean readFrom(ByteBuffer source)
           
 void reset()
           
 void setData(Data data)
           
protected  void setStatus(int bit)
           
 boolean writeTo(ByteBuffer destination)
          Asks the SocketWritable to write its content to the destination ByteBuffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

protected Data data

context

protected PortableContext context
Constructor Detail

DataAdapter

public DataAdapter(PortableContext context)

DataAdapter

public DataAdapter(Data data,
                   PortableContext context)
Method Detail

isUrgent

public boolean isUrgent()
Description copied from interface: SocketWritable
Checks if this SocketWritable is urgent. SocketWritable that are urgent, have priority above regular SocketWritable. This is useful to implement System Operations so that they can be send faster than regular operations; especially when the system is under load you want these operations have precedence.

Specified by:
isUrgent in interface SocketWritable
Returns:
true if urgent, false otherwise.

writeTo

public boolean writeTo(ByteBuffer destination)
Description copied from interface: SocketWritable
Asks the SocketWritable to write its content to the destination ByteBuffer.

Specified by:
writeTo in interface SocketWritable
Parameters:
destination - the ByteBuffer to write to.
Returns:
todo: unclear what return value means.

readFrom

public boolean readFrom(ByteBuffer source)
Specified by:
readFrom in interface SocketReadable

setStatus

protected final void setStatus(int bit)

isStatusSet

protected final boolean isStatusSet(int bit)

getData

public final Data getData()

setData

public final void setData(Data data)

done

public boolean done()

reset

public void reset()

getDataSize

public static int getDataSize(Data data,
                              PortableContext context)


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.