Class CommandDatagramChannel
- java.lang.Object
-
- org.apache.activemq.transport.udp.CommandChannelSupport
-
- 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
Constructors Constructor Description CommandDatagramChannel(UdpTransport transport, OpenWireFormat wireFormat, int datagramSize, SocketAddress targetAddress, DatagramHeaderMarshaller headerMarshaller, DatagramChannel channel, ByteBufferPool bufferPool)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteBufferPoolgetBufferPool()intgetReceiveCounter()Commandread()voidsendBuffer(int commandId, Object buffer)Sends the given buffer back to the transport if the buffer could be found - otherwise maybe send some kind of exceptionprotected voidsendWriteBuffer(int commandId, SocketAddress address, ByteBuffer writeBuffer, boolean redelivery)voidsetBufferPool(ByteBufferPool bufferPool)Sets the implementation of the byte buffer pool to usevoidstart()voidstop()voidwrite(Command command, SocketAddress address)-
Methods inherited from class org.apache.activemq.transport.udp.CommandChannelSupport
getDatagramSize, getHeaderMarshaller, getReplayAddress, getReplayBuffer, getTargetAddress, setDatagramSize, setHeaderMarshaller, setReplayAddress, setReplayBuffer, setTargetAddress, toString, write
-
-
-
-
Constructor Detail
-
CommandDatagramChannel
public CommandDatagramChannel(UdpTransport transport, OpenWireFormat wireFormat, int datagramSize, SocketAddress targetAddress, DatagramHeaderMarshaller headerMarshaller, DatagramChannel channel, ByteBufferPool bufferPool)
-
-
Method Detail
-
read
public Command read() throws IOException
- Throws:
IOException
-
write
public void write(Command command, SocketAddress address) throws IOException
- Throws:
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, SocketAddress address, ByteBuffer writeBuffer, boolean redelivery) throws IOException- Throws:
IOException
-
sendBuffer
public void sendBuffer(int commandId, Object buffer) throws IOExceptionDescription copied from interface:ReplayerSends the given buffer back to the transport if the buffer could be found - otherwise maybe send some kind of exception- Parameters:
commandId- the command IDbuffer- the buffer to be sent - or null if the buffer no longer exists in the buffer- Throws:
IOException
-
getReceiveCounter
public int getReceiveCounter()
-
-