Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.activemq.transport.udp
Class UdpTransportChannel  view UdpTransportChannel download UdpTransportChannel.java

java.lang.Object
  extended byorg.activemq.transport.TransportChannelSupport
      extended byorg.activemq.transport.udp.UdpTransportChannel
All Implemented Interfaces:
java.lang.Runnable, org.activemq.service.Service, org.activemq.transport.TransportChannel

public class UdpTransportChannel
extends org.activemq.transport.TransportChannelSupport
implements java.lang.Runnable

A UDP implementation of a TransportChannel

Version:
$Revision: 1.1.1.1 $

Field Summary
private  SynchronizedBoolean closed
           
protected  java.net.InetAddress inetAddress
           
private static org.apache.commons.logging.Log log
           
protected  int port
           
private static int SO_TIMEOUT
           
protected  java.net.DatagramSocket socket
           
private static int SOCKET_BUFFER_SIZE
           
private  SynchronizedBoolean started
           
private  java.lang.Thread thread
           
private  org.activemq.io.WireFormat wireFormat
           
 
Fields inherited from class org.activemq.transport.TransportChannelSupport
cachingEnabled, currentWireFormat, noDelay, pendingStop, transportConnected, usedInternally
 
Constructor Summary
protected UdpTransportChannel(org.activemq.io.WireFormat wireFormat)
          Construct basic helpers
  UdpTransportChannel(org.activemq.io.WireFormat wireFormat, java.net.DatagramSocket socket)
           
  UdpTransportChannel(org.activemq.io.WireFormat wireFormat, java.net.DatagramSocket socket, int port)
           
  UdpTransportChannel(org.activemq.io.WireFormat wireFormat, java.net.URI remoteLocation)
           
  UdpTransportChannel(org.activemq.io.WireFormat wireFormat, java.net.URI remoteLocation, int port)
           
 
Method Summary
 void asyncSend(org.activemq.message.Packet packet)
          Asynchronously send a Packet
 boolean canProcessWireFormatVersion(int version)
          Can this wireformat process packets of this version
protected  void connect()
           
protected  java.net.DatagramPacket createDatagramPacket()
           
protected  java.net.DatagramPacket createDatagramPacket(org.activemq.message.Packet packet)
           
protected  java.net.DatagramSocket createSocket(int port)
           
private  void doClose(java.lang.Exception ex)
           
 void forceDisconnect()
          Forces an immediate transport-level disconnect which will be asynchronously reported as an exception to the exceptionListener.
 int getCurrentWireFormatVersion()
           
 boolean isMulticast()
           
 void run()
          reads packets from a Socket
 void start()
          start listeneing for events
 void stop()
          close the channel
 java.lang.String toString()
          pretty print for object
 
Methods inherited from class org.activemq.transport.TransportChannelSupport
addTransportStatusEventListener, asyncSendWithReceipt, doAsyncSend, doConsumePacket, doConsumePacket, doesSupportMessageCompression, doesSupportMessageFragmentation, doesSupportWireFormatVersioning, doHandleReceipt, doHandleWireFormat, fireStatusEvent, fireStatusEvent, getClientID, getEmbeddedBrokerConnector, getExceptionListener, getLastReceiptTimestamp, getPacketListener, getTransportChannelListener, getWireFormat, isCachingEnabled, isNoDelay, isPendingStop, isServerSide, isTransportConnected, isUsedInternally, onAsyncException, removeTransportStatusEventListener, requiresEmbeddedBroker, send, send, setCachingEnabled, setClientID, setExceptionListener, setNoDelay, setPacketListener, setPendingStop, setServerSide, setTransportChannelListener, setTransportConnected, setUsedInternally, setWireFormat, stopExecutor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SOCKET_BUFFER_SIZE

private static final int SOCKET_BUFFER_SIZE
See Also:
Constant Field Values

SO_TIMEOUT

private static final int SO_TIMEOUT
See Also:
Constant Field Values

log

private static final org.apache.commons.logging.Log log

socket

protected java.net.DatagramSocket socket

port

protected int port

inetAddress

protected java.net.InetAddress inetAddress

wireFormat

private org.activemq.io.WireFormat wireFormat

closed

private SynchronizedBoolean closed

started

private SynchronizedBoolean started

thread

private java.lang.Thread thread
Constructor Detail

UdpTransportChannel

protected UdpTransportChannel(org.activemq.io.WireFormat wireFormat)
Construct basic helpers


UdpTransportChannel

public UdpTransportChannel(org.activemq.io.WireFormat wireFormat,
                           java.net.URI remoteLocation)
                    throws javax.jms.JMSException

UdpTransportChannel

public UdpTransportChannel(org.activemq.io.WireFormat wireFormat,
                           java.net.URI remoteLocation,
                           int port)
                    throws javax.jms.JMSException

UdpTransportChannel

public UdpTransportChannel(org.activemq.io.WireFormat wireFormat,
                           java.net.DatagramSocket socket)
                    throws javax.jms.JMSException

UdpTransportChannel

public UdpTransportChannel(org.activemq.io.WireFormat wireFormat,
                           java.net.DatagramSocket socket,
                           int port)
                    throws javax.jms.JMSException
Method Detail

stop

public void stop()
close the channel

Specified by:
stop in interface org.activemq.transport.TransportChannel

forceDisconnect

public void forceDisconnect()
Description copied from interface: org.activemq.transport.TransportChannel
Forces an immediate transport-level disconnect which will be asynchronously reported as an exception to the exceptionListener. If the channel isn't connected, the call will be ignored.

Specified by:
forceDisconnect in interface org.activemq.transport.TransportChannel

start

public void start()
           throws javax.jms.JMSException
start listeneing for events

Specified by:
start in interface org.activemq.transport.TransportChannel

asyncSend

public void asyncSend(org.activemq.message.Packet packet)
               throws javax.jms.JMSException
Asynchronously send a Packet

Specified by:
asyncSend in interface org.activemq.transport.TransportChannel

isMulticast

public boolean isMulticast()
Specified by:
isMulticast in interface org.activemq.transport.TransportChannel

run

public void run()
reads packets from a Socket

Specified by:
run in interface java.lang.Runnable

canProcessWireFormatVersion

public boolean canProcessWireFormatVersion(int version)
Can this wireformat process packets of this version

Specified by:
canProcessWireFormatVersion in interface org.activemq.transport.TransportChannel

getCurrentWireFormatVersion

public int getCurrentWireFormatVersion()
Specified by:
getCurrentWireFormatVersion in interface org.activemq.transport.TransportChannel

createDatagramPacket

protected java.net.DatagramPacket createDatagramPacket()

createDatagramPacket

protected java.net.DatagramPacket createDatagramPacket(org.activemq.message.Packet packet)
                                                throws java.io.IOException,
                                                       javax.jms.JMSException

doClose

private void doClose(java.lang.Exception ex)

connect

protected void connect()
                throws java.io.IOException

createSocket

protected java.net.DatagramSocket createSocket(int port)
                                        throws java.io.IOException

toString

public java.lang.String toString()
pretty print for object