org.codehaus.activemq.transport.jgroups
Class JGroupsTransportChannel

java.lang.Object
  extended byorg.codehaus.activemq.transport.TransportChannelSupport
      extended byorg.codehaus.activemq.transport.jgroups.JGroupsTransportChannel
All Implemented Interfaces:
Runnable, Service, TransportChannel

public class JGroupsTransportChannel
extends TransportChannelSupport
implements Runnable

A JGroups implementation of a TransportChannel

Version:
$Revision: 1.9 $

Field Summary
 
Fields inherited from class org.codehaus.activemq.transport.TransportChannelSupport
pendingStop, transportConnected
 
Constructor Summary
JGroupsTransportChannel(WireFormat wireFormat, org.jgroups.Channel channel, Executor executor)
           
 
Method Summary
 void asyncSend(Packet packet)
          Asynchronously send a Packet
 boolean canProcessWireFormatVersion(int version)
          Can this wireformat process packets of this version
 int getCurrentWireFormatVersion()
           
 boolean isMulticast()
           
 void run()
          reads packets from a Socket
 void start()
          start listeneing for events
 void stop()
          close the channel
 String toString()
           
protected  void writePacket(Packet packet)
          writes the packet to the channel
 
Methods inherited from class org.codehaus.activemq.transport.TransportChannelSupport
addTransportStatusEventListener, doAsyncSend, doConsumePacket, doConsumePacket, doHandleReceipt, doHandleWireFormat, fireStatusEvent, fireStatusEvent, getClientID, getExceptionListener, getPacketListener, getTransportChannelListener, isPendingStop, isServerSide, isTransportConnected, onAsyncException, removeTransportStatusEventListener, send, send, setClientID, setExceptionListener, setPacketListener, setPendingStop, setServerSide, setTransportChannelListener, setTransportConnected, stopExecutor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JGroupsTransportChannel

public JGroupsTransportChannel(WireFormat wireFormat,
                               org.jgroups.Channel channel,
                               Executor executor)
Method Detail

toString

public String toString()

stop

public void stop()
close the channel

Specified by:
stop in interface TransportChannel
Overrides:
stop in class TransportChannelSupport

start

public void start()
           throws JMSException
start listeneing for events

Specified by:
start in interface TransportChannel
Throws:
JMSException - if an error occurs

asyncSend

public void asyncSend(Packet packet)
               throws JMSException
Asynchronously send a Packet

Specified by:
asyncSend in interface TransportChannel
Parameters:
packet -
Throws:
JMSException

isMulticast

public boolean isMulticast()
Specified by:
isMulticast in interface TransportChannel
Returns:
true if this transport is multicast based (i.e. broadcasts to multiple nodes)

canProcessWireFormatVersion

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

Specified by:
canProcessWireFormatVersion in interface TransportChannel
Parameters:
version - the version number to test
Returns:
true if can accept the version

getCurrentWireFormatVersion

public int getCurrentWireFormatVersion()
Specified by:
getCurrentWireFormatVersion in interface TransportChannel
Returns:
the current version of this wire format

run

public void run()
reads packets from a Socket

Specified by:
run in interface Runnable

writePacket

protected void writePacket(Packet packet)
                    throws JMSException
writes the packet to the channel

Throws:
JMSException


Copyright © 2004 Protique, Ltd.. All Rights Reserved.