org.apache.activemq.transport.udp
Class CommandDatagramSocket
java.lang.Object
org.apache.activemq.transport.udp.CommandChannelSupport
org.apache.activemq.transport.udp.CommandDatagramSocket
- All Implemented Interfaces:
- Service, Replayer, CommandChannel
public class CommandDatagramSocket
- extends CommandChannelSupport
A strategy for reading datagrams and de-fragmenting them together.
- Version:
- $Revision: 439111 $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
CommandDatagramSocket
public CommandDatagramSocket(UdpTransport transport,
OpenWireFormat wireFormat,
int datagramSize,
java.net.SocketAddress targetAddress,
DatagramHeaderMarshaller headerMarshaller,
java.net.DatagramSocket channel)
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
getDatagramSize
public int getDatagramSize()
- Specified by:
getDatagramSize
in interface CommandChannel
- Overrides:
getDatagramSize
in class CommandChannelSupport
setDatagramSize
public void setDatagramSize(int datagramSize)
- Description copied from class:
CommandChannelSupport
- Sets the default size of a datagram on the network.
- Specified by:
setDatagramSize
in interface CommandChannel
- Overrides:
setDatagramSize
in class CommandChannelSupport
sendWriteBuffer
protected void sendWriteBuffer(java.net.SocketAddress address,
ByteArrayOutputStream writeBuffer,
int commandId)
throws java.io.IOException
- Throws:
java.io.IOException
sendWriteBuffer
protected void sendWriteBuffer(int commandId,
java.net.SocketAddress address,
byte[] data,
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 IDbuffer
- the buffer to be sent - or null if the buffer no longer exists in the buffer
- Throws:
java.io.IOException
createDatagramPacket
protected java.net.DatagramPacket createDatagramPacket()
remaining
protected int remaining(ByteArrayOutputStream buffer)
createByteArrayOutputStream
protected ByteArrayOutputStream createByteArrayOutputStream()
Copyright © 2010 Apache Software Foundation. All Rights Reserved.