Errai 3.0.1-SNAPSHOT

org.jboss.errai.bus.server.io
Class BufferDeliveryHandler

java.lang.Object
  extended by org.jboss.errai.bus.server.io.BufferDeliveryHandler
All Implemented Interfaces:
Buffered, Cleanable, MessageDeliveryHandler

public class BufferDeliveryHandler
extends Object
implements MessageDeliveryHandler, Buffered, Cleanable

This implementation of MessageDeliveryHandler facilitates the buffering of all inbound message traffic to a singular ring-buffer.

Author:
Mike Brock

Method Summary
 void clean(MessageQueue queue)
           
 boolean copyFromBuffer(MessageQueue queue, ByteWriteAdapter toAdapter)
           
 boolean copyFromBuffer(TimeUnit timeUnit, int timeout, MessageQueue queue, ByteWriteAdapter toAdapter)
           
 boolean deliver(MessageQueue queue, Message message)
          This method is responsible for delivering a message into the transport layer.
static BufferDeliveryHandler getInstance()
           
 void noop(MessageQueue queue)
          Sends a NOOP (No-Operation) to the remote connected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static BufferDeliveryHandler getInstance()

deliver

public boolean deliver(MessageQueue queue,
                       Message message)
                throws IOException
Description copied from interface: MessageDeliveryHandler
This method is responsible for delivering a message into the transport layer. The contract between the message bus and the transport layer is completely governed by the implementation of the method.

Specified by:
deliver in interface MessageDeliveryHandler
Parameters:
queue - the MessageQueue to deliver from.
message - the Message to deliver.
Returns:
true if the message was successfully accepted.
Throws:
IOException - an IOException may be thrown if there is a problem interacting with the underlying transport.

noop

public void noop(MessageQueue queue)
          throws IOException
Description copied from interface: MessageDeliveryHandler
Sends a NOOP (No-Operation) to the remote connected

Specified by:
noop in interface MessageDeliveryHandler
Throws:
IOException

clean

public void clean(MessageQueue queue)
Specified by:
clean in interface Cleanable

copyFromBuffer

public boolean copyFromBuffer(MessageQueue queue,
                              ByteWriteAdapter toAdapter)
                       throws IOException
Specified by:
copyFromBuffer in interface Buffered
Throws:
IOException

copyFromBuffer

public boolean copyFromBuffer(TimeUnit timeUnit,
                              int timeout,
                              MessageQueue queue,
                              ByteWriteAdapter toAdapter)
                       throws IOException
Specified by:
copyFromBuffer in interface Buffered
Throws:
IOException

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.