com.hazelcast.spi.impl.transceiver
Interface PacketTransceiver

All Known Implementing Classes:
PacketTransceiverImpl

public interface PacketTransceiver

The PacketTransceiver is responsible for receiving and transmitting Packet instances. When it receives a Packet (from the IO system) it dispatches to the appropriate service:

  1. OperationService
  2. EventService
  3. WanReplicationService
Sending is a bit simpler since the connection is looked up if needed and then send to the other side. The name transceiver comes from the radio and networking terminology and is a combination of transmitting and receiving.


Method Summary
 void receive(Packet packet)
          Lets the PacketTransceiver receive a packet.
 boolean transmit(Packet packet, Address target)
          Transmits a packet to a certain address.
 boolean transmit(Packet packet, Connection connection)
          Transmits a packet to a certain connection.
 

Method Detail

transmit

boolean transmit(Packet packet,
                 Connection connection)
Transmits a packet to a certain connection.

Parameters:
packet - The Packet to transmit.
connection - The connection to where the Packet should be transmitted.
Returns:
true if the transmit was a success, false if a failure. There is no guarantee that the packet is actually going to be received since the Packet perhaps is stuck in some buffer. It just means that it is buffered somewhere.

transmit

boolean transmit(Packet packet,
                 Address target)
Transmits a packet to a certain address.

Parameters:
packet - The Packet to transmit.
target - The address of the target machine where the Packet should be transmitted.
Returns:
true if the transmit was a success, false if a failure.
See Also:
transmit(com.hazelcast.nio.Packet, com.hazelcast.nio.Connection)

receive

void receive(Packet packet)
Lets the PacketTransceiver receive a packet. This method is likely going to be called from the IO system when it takes a Packet of the wire and offers it to be processed by the system. This is where the dispatching (demultiplexing) to the appropriate services takes place.

Parameters:
packet - the Packet to receive.


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