Package org.jgroups.blocks.cs
Class ReceiverAdapter
- java.lang.Object
-
- org.jgroups.blocks.cs.ReceiverAdapter
-
- All Implemented Interfaces:
Receiver
- Direct Known Subclasses:
DiagnosticsHandler
,GossipRouter
,PubClient
,PubServer
,RouterStub
public class ReceiverAdapter extends java.lang.Object implements Receiver
An impl ofReceiver
. Will get removed with the switch to Java 8; instead we'll use a default impl in Receiver- Since:
- 3.6.5
- Author:
- Bela Ban
-
-
Constructor Summary
Constructors Constructor Description ReceiverAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
receive(Address sender, byte[] buf, int offset, int length)
Delivers a message from a given sender to the applicationvoid
receive(Address sender, java.io.DataInput in)
void
receive(Address sender, java.nio.ByteBuffer buf)
The default implementation assumes thatByteBuffer.flip()
orByteBuffer.rewind()
was called on buf before invoking this callback
-
-
-
Method Detail
-
receive
public void receive(Address sender, byte[] buf, int offset, int length)
Description copied from interface:Receiver
Delivers a message from a given sender to the application- Specified by:
receive
in interfaceReceiver
- Parameters:
sender
- The sender of the messagebuf
- The buffer. An application typically de-serializes data from the buffer into objects used by the application. Note that when receive() returns, it is not safe to use the buffer any longer; if an application needs to use a buffer after this callback returns, it must make a copy.offset
- The offset at which the received data startslength
- The length of the received data
-
receive
public void receive(Address sender, java.nio.ByteBuffer buf)
The default implementation assumes thatByteBuffer.flip()
orByteBuffer.rewind()
was called on buf before invoking this callback
-
-