org.activemq.transport.peer
Class PeerTransportChannel

java.lang.Object
  extended byorg.activemq.transport.TransportChannelSupport
      extended byorg.activemq.transport.vm.VmTransportChannel
          extended byorg.activemq.transport.peer.PeerTransportChannel
All Implemented Interfaces:
Runnable, Service, TransportChannel

public class PeerTransportChannel
extends VmTransportChannel

A PeerTransportChannel creates an embedded broker and networks peers together to form a P-2-P network.

By default, PeerTransportChannel uses discovery to locate other peers, and uses a well known service name on the discovery

An example of the expected format is: peer://development.net where development.net is the service name used in discovery

Version:
$Revision: 1.1.1.1 $

Field Summary
protected  BrokerConnector brokerConnector
           
protected  String brokerConnectorURI
           
protected  String brokerName
           
protected  TransportChannel channel
           
protected static String DEFAULT_BROKER_CONNECTOR_URI
           
protected  String discoveryURI
           
protected  boolean doDiscovery
           
protected  String peerURIs
           
protected  boolean persistent
           
protected  boolean remote
           
protected  String remotePassword
           
protected  String remoteUserName
           
protected  String serviceName
           
protected  WireFormat wireFormat
           
 
Fields inherited from class org.activemq.transport.TransportChannelSupport
cachingEnabled, currentWireFormat, noDelay, pendingStop, transportConnected, usedInternally
 
Constructor Summary
protected PeerTransportChannel(WireFormat wireFormat, String serviceName)
          Construct a PeerTransportChannel
 
Method Summary
protected  NetworkConnector createNetworkConnector(BrokerContainer container)
          Create a NetworkConnector
 String getBrokerConnectorURI()
           
 String getBrokerName()
           
 String getDiscoveryURI()
           
 BrokerConnector getEmbeddedBrokerConnector()
          Some transports that rely on an embedded broker need to create the connector used by the broker
 String getPeerURIs()
           
 String getRemotePassword()
           
 String getRemoteUserName()
           
 String getServiceName()
           
 WireFormat getWireFormat()
          Get the current wireformat used by this channel
 boolean isDoDiscovery()
           
 boolean isPersistent()
           
 boolean isRemote()
           
 boolean isTransportConnected()
           
 boolean requiresEmbeddedBroker()
          Some transports rely on an embedded broker (beer based protocols)
 void setBrokerConnectorURI(String brokerConnectorURI)
           
 void setBrokerName(String brokerName)
           
 void setDiscoveryURI(String discoveryURI)
           
 void setDoDiscovery(boolean doDiscovery)
           
 void setPeerURIs(String peerURIs)
           
 void setPersistent(boolean persistent)
           
 void setRemote(boolean remote)
           
 void setRemotePassword(String remotePassword)
           
 void setRemoteUserName(String remoteUserName)
           
 void setServiceName(String serviceName)
           
 void setWireFormat(WireFormat wireFormat)
          set the wire format to be used by this channel
 
Methods inherited from class org.activemq.transport.vm.VmTransportChannel
asyncSend, canProcessWireFormatVersion, connect, createChannel, createPacketListenerSender, createServerSide, doClose, doesSupportMessageCompression, doesSupportMessageFragmentation, doesSupportWireFormatVersioning, forceDisconnect, getCurrentWireFormatVersion, getNextThreadId, getReceiveCapacity, getReceiveChannel, getSendCapacity, getSendChannel, getSendListener, isAsyncSend, isMulticast, run, setAsyncSend, setPacketListener, setReceiveCapacity, setReceiveChannel, setSendCapacity, setSendChannel, setSendListener, start, stop, toString
 
Methods inherited from class org.activemq.transport.TransportChannelSupport
addTransportStatusEventListener, asyncSendWithReceipt, doAsyncSend, doConsumePacket, doConsumePacket, doHandleReceipt, doHandleWireFormat, fireStatusEvent, fireStatusEvent, getClientID, getExceptionListener, getLastReceiptTimestamp, getPacketListener, getTransportChannelListener, isCachingEnabled, isNoDelay, isPendingStop, isServerSide, isUsedInternally, onAsyncException, removeTransportStatusEventListener, send, send, setCachingEnabled, setClientID, setExceptionListener, setNoDelay, setPendingStop, setServerSide, setTransportChannelListener, setTransportConnected, setUsedInternally, stopExecutor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_BROKER_CONNECTOR_URI

protected static final String DEFAULT_BROKER_CONNECTOR_URI
See Also:
Constant Field Values

wireFormat

protected WireFormat wireFormat

channel

protected TransportChannel channel

discoveryURI

protected String discoveryURI

remoteUserName

protected String remoteUserName

remotePassword

protected String remotePassword

brokerName

protected String brokerName

doDiscovery

protected boolean doDiscovery

peerURIs

protected String peerURIs

brokerConnectorURI

protected String brokerConnectorURI

serviceName

protected String serviceName

brokerConnector

protected BrokerConnector brokerConnector

remote

protected boolean remote

persistent

protected boolean persistent
Constructor Detail

PeerTransportChannel

protected PeerTransportChannel(WireFormat wireFormat,
                               String serviceName)
                        throws JMSException
Construct a PeerTransportChannel

Parameters:
wireFormat -
serviceName -
Throws:
JMSException
Method Detail

isTransportConnected

public boolean isTransportConnected()
Specified by:
isTransportConnected in interface TransportChannel
Overrides:
isTransportConnected in class TransportChannelSupport
Returns:
true if the transport channel is active, this value will be false through reconnecting

requiresEmbeddedBroker

public boolean requiresEmbeddedBroker()
Some transports rely on an embedded broker (beer based protocols)

Specified by:
requiresEmbeddedBroker in interface TransportChannel
Overrides:
requiresEmbeddedBroker in class TransportChannelSupport
Returns:
true if an embedded broker required

getEmbeddedBrokerConnector

public BrokerConnector getEmbeddedBrokerConnector()
                                           throws JMSException
Some transports that rely on an embedded broker need to create the connector used by the broker

Specified by:
getEmbeddedBrokerConnector in interface TransportChannel
Overrides:
getEmbeddedBrokerConnector in class TransportChannelSupport
Returns:
the BrokerConnector or null if not applicable
Throws:
JMSException

createNetworkConnector

protected NetworkConnector createNetworkConnector(BrokerContainer container)
Create a NetworkConnector

Parameters:
container -
Returns:
the NetworkConnector

getDiscoveryURI

public String getDiscoveryURI()
Returns:
Returns the brokerDiscoveryURI.

setDiscoveryURI

public void setDiscoveryURI(String discoveryURI)
Parameters:
discoveryURI - The brokerDiscoveryURI to set.

getBrokerName

public String getBrokerName()
Returns:
Returns the brokerName.

setBrokerName

public void setBrokerName(String brokerName)
Parameters:
brokerName - The brokerName to set.

isDoDiscovery

public boolean isDoDiscovery()
Returns:
Returns the doDiscovery.

setDoDiscovery

public void setDoDiscovery(boolean doDiscovery)
Parameters:
doDiscovery - The doDiscovery to set.

getWireFormat

public WireFormat getWireFormat()
Description copied from class: TransportChannelSupport
Get the current wireformat used by this channel

Specified by:
getWireFormat in interface TransportChannel
Overrides:
getWireFormat in class TransportChannelSupport
Returns:
Returns the wireFormat.

setWireFormat

public void setWireFormat(WireFormat wireFormat)
Description copied from class: TransportChannelSupport
set the wire format to be used by this channel

Specified by:
setWireFormat in interface TransportChannel
Overrides:
setWireFormat in class TransportChannelSupport
Parameters:
wireFormat - The wireFormat to set.

getRemotePassword

public String getRemotePassword()
Returns:
Returns the remotePassword.

setRemotePassword

public void setRemotePassword(String remotePassword)
Parameters:
remotePassword - The remotePassword to set.

getRemoteUserName

public String getRemoteUserName()
Returns:
Returns the remoteUserName.

setRemoteUserName

public void setRemoteUserName(String remoteUserName)
Parameters:
remoteUserName - The remoteUserName to set.

getBrokerConnectorURI

public String getBrokerConnectorURI()
Returns:
Returns the brokerConnectorURI.

setBrokerConnectorURI

public void setBrokerConnectorURI(String brokerConnectorURI)
Parameters:
brokerConnectorURI - The brokerConnectorURI to set.

getPeerURIs

public String getPeerURIs()
Returns:
Returns the peerURIs.

setPeerURIs

public void setPeerURIs(String peerURIs)
Parameters:
peerURIs - The peerURIs to set.

getServiceName

public String getServiceName()
Returns:
Returns the serviceName.

setServiceName

public void setServiceName(String serviceName)
Parameters:
serviceName - The serviceName to set.

isRemote

public boolean isRemote()
Returns:
Returns the remote.

setRemote

public void setRemote(boolean remote)
Parameters:
remote - The remote to set.

isPersistent

public boolean isPersistent()
Returns:
Returns the persistent.

setPersistent

public void setPersistent(boolean persistent)
Parameters:
persistent - The persistent to set.


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