org.codehaus.activemq.transport.peer
Class PeerTransportChannel
java.lang.Object
org.codehaus.activemq.transport.TransportChannelSupport
org.codehaus.activemq.transport.vm.VmTransportChannel
org.codehaus.activemq.transport.peer.PeerTransportChannel
- All Implemented Interfaces:
- Runnable, Service, TransportChannel
- Direct Known Subclasses:
- RemoteTransportChannel
- 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.6 $
Methods inherited from class org.codehaus.activemq.transport.vm.VmTransportChannel |
asyncSend, canProcessWireFormatVersion, connect, createChannel, createPacketListenerSender, createServerSide, doClose, forceDisconnect, getCurrentWireFormatVersion, getNextThreadId, getReceiveCapacity, getReceiveChannel, getSendCapacity, getSendChannel, isAsyncSend, isMulticast, run, setAsyncSend, setPacketListener, setReceiveCapacity, setReceiveChannel, setSendCapacity, setSendChannel, start, stop, toString |
Methods inherited from class org.codehaus.activemq.transport.TransportChannelSupport |
addTransportStatusEventListener, asyncSendWithReceipt, doAsyncSend, doConsumePacket, doConsumePacket, doHandleReceipt, doHandleWireFormat, fireStatusEvent, fireStatusEvent, getClientID, getExceptionListener, getLastReceiptTimestamp, getPacketListener, getTransportChannelListener, isPendingStop, isServerSide, onAsyncException, removeTransportStatusEventListener, send, send, setClientID, setExceptionListener, setPendingStop, setServerSide, setTransportChannelListener, setTransportConnected, stopExecutor |
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
PeerTransportChannel
protected PeerTransportChannel(WireFormat wireFormat,
String serviceName)
throws JMSException
- Construct a PeerTransportChannel
- Parameters:
wireFormat
- serviceName
-
- Throws:
JMSException
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()
- Returns:
- Returns the wireFormat.
setWireFormat
public void setWireFormat(WireFormat wireFormat)
- 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.
Copyright © 2004-2005 Protique, Ltd.. All Rights Reserved.