org.apache.activemq.transport.udp
Class CommandDatagramChannel

java.lang.Object
  extended by org.apache.activemq.transport.udp.CommandChannelSupport
      extended by org.apache.activemq.transport.udp.CommandDatagramChannel
All Implemented Interfaces:
Service, Replayer, CommandChannel

public class CommandDatagramChannel
extends CommandChannelSupport

A strategy for reading datagrams and de-fragmenting them together.


Field Summary
 
Fields inherited from class org.apache.activemq.transport.udp.CommandChannelSupport
datagramSize, headerMarshaller, name, replayAddress, sequenceGenerator, targetAddress, wireFormat
 
Constructor Summary
CommandDatagramChannel(UdpTransport transport, OpenWireFormat wireFormat, int datagramSize, java.net.SocketAddress targetAddress, DatagramHeaderMarshaller headerMarshaller, java.nio.channels.DatagramChannel channel, ByteBufferPool bufferPool)
           
 
Method Summary
 ByteBufferPool getBufferPool()
           
 int getReceiveCounter()
           
 Command read()
           
 void sendBuffer(int commandId, java.lang.Object buffer)
          Sends the given buffer back to the transport if the buffer could be found - otherwise maybe send some kind of exception
protected  void sendWriteBuffer(int commandId, java.net.SocketAddress address, java.nio.ByteBuffer writeBuffer, boolean redelivery)
           
 void setBufferPool(ByteBufferPool bufferPool)
          Sets the implementation of the byte buffer pool to use
 void start()
           
 void stop()
           
 void write(Command command, java.net.SocketAddress address)
           
 
Methods inherited from class org.apache.activemq.transport.udp.CommandChannelSupport
getDatagramSize, getHeaderMarshaller, getReplayAddress, getReplayBuffer, getTargetAddress, setDatagramSize, setHeaderMarshaller, setReplayAddress, setReplayBuffer, setTargetAddress, toString, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CommandDatagramChannel

public CommandDatagramChannel(UdpTransport transport,
                              OpenWireFormat wireFormat,
                              int datagramSize,
                              java.net.SocketAddress targetAddress,
                              DatagramHeaderMarshaller headerMarshaller,
                              java.nio.channels.DatagramChannel channel,
                              ByteBufferPool bufferPool)
Method Detail

start

public void start()
           throws java.lang.Exception
Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
Throws:
java.lang.Exception

read

public Command read()
             throws java.io.IOException
Throws:
java.io.IOException

write

public void write(Command command,
                  java.net.SocketAddress address)
           throws java.io.IOException
Throws:
java.io.IOException

getBufferPool

public ByteBufferPool getBufferPool()

setBufferPool

public void setBufferPool(ByteBufferPool bufferPool)
Sets the implementation of the byte buffer pool to use


sendWriteBuffer

protected void sendWriteBuffer(int commandId,
                               java.net.SocketAddress address,
                               java.nio.ByteBuffer writeBuffer,
                               boolean redelivery)
                        throws java.io.IOException
Throws:
java.io.IOException

sendBuffer

public void sendBuffer(int commandId,
                       java.lang.Object buffer)
                throws java.io.IOException
Description copied from interface: Replayer
Sends the given buffer back to the transport if the buffer could be found - otherwise maybe send some kind of exception

Parameters:
commandId - the command ID
buffer - the buffer to be sent - or null if the buffer no longer exists in the buffer
Throws:
java.io.IOException

getReceiveCounter

public int getReceiveCounter()


Copyright © 2005-2011 FuseSource, Corp.. All Rights Reserved.