org.apache.activemq.network
Class DemandForwardingBridgeSupport
java.lang.Object
org.apache.activemq.network.DemandForwardingBridgeSupport
- All Implemented Interfaces:
- BrokerServiceAware, NetworkBridge, Service
- Direct Known Subclasses:
- CompositeDemandForwardingBridge, DemandForwardingBridge
public abstract class DemandForwardingBridgeSupport
- extends Object
- implements NetworkBridge, BrokerServiceAware
A useful base class for implementing demand forwarding bridges.
- Version:
- $Revision: 835920 $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
localBroker
protected final Transport localBroker
remoteBroker
protected final Transport remoteBroker
idGenerator
protected final IdGenerator idGenerator
consumerIdGenerator
protected final LongSequenceGenerator consumerIdGenerator
localConnectionInfo
protected ConnectionInfo localConnectionInfo
remoteConnectionInfo
protected ConnectionInfo remoteConnectionInfo
localSessionInfo
protected SessionInfo localSessionInfo
producerInfo
protected ProducerInfo producerInfo
remoteBrokerName
protected String remoteBrokerName
localClientId
protected String localClientId
demandConsumerInfo
protected ConsumerInfo demandConsumerInfo
demandConsumerDispatched
protected int demandConsumerDispatched
localBridgeStarted
protected final AtomicBoolean localBridgeStarted
remoteBridgeStarted
protected final AtomicBoolean remoteBridgeStarted
disposed
protected AtomicBoolean disposed
localBrokerId
protected BrokerId localBrokerId
excludedDestinations
protected ActiveMQDestination[] excludedDestinations
dynamicallyIncludedDestinations
protected ActiveMQDestination[] dynamicallyIncludedDestinations
staticallyIncludedDestinations
protected ActiveMQDestination[] staticallyIncludedDestinations
durableDestinations
protected ActiveMQDestination[] durableDestinations
subscriptionMapByLocalId
protected final ConcurrentHashMap<ConsumerId,DemandSubscription> subscriptionMapByLocalId
subscriptionMapByRemoteId
protected final ConcurrentHashMap<ConsumerId,DemandSubscription> subscriptionMapByRemoteId
localBrokerPath
protected final BrokerId[] localBrokerPath
startedLatch
protected CountDownLatch startedLatch
localStartedLatch
protected CountDownLatch localStartedLatch
remoteBrokerNameKnownLatch
protected CountDownLatch remoteBrokerNameKnownLatch
localBrokerIdKnownLatch
protected CountDownLatch localBrokerIdKnownLatch
remoteInterupted
protected final AtomicBoolean remoteInterupted
lastConnectSucceeded
protected final AtomicBoolean lastConnectSucceeded
configuration
protected NetworkBridgeConfiguration configuration
DemandForwardingBridgeSupport
public DemandForwardingBridgeSupport(NetworkBridgeConfiguration configuration,
Transport localBroker,
Transport remoteBroker)
duplexStart
public void duplexStart(TransportConnection connection,
BrokerInfo localBrokerInfo,
BrokerInfo remoteBrokerInfo)
throws Exception
- Throws:
Exception
start
public void start()
throws Exception
- Specified by:
start
in interface Service
- Throws:
Exception
triggerLocalStartBridge
protected void triggerLocalStartBridge()
throws IOException
- Throws:
IOException
triggerRemoteStartBridge
protected void triggerRemoteStartBridge()
throws IOException
- Throws:
IOException
startLocalBridge
protected void startLocalBridge()
throws Exception
- Throws:
Exception
startRemoteBridge
protected void startRemoteBridge()
throws Exception
- Throws:
Exception
stop
public void stop()
throws Exception
- Specified by:
stop
in interface Service
- Throws:
Exception
serviceRemoteException
public void serviceRemoteException(Throwable error)
- Description copied from interface:
NetworkBridge
- Service an exception
- Specified by:
serviceRemoteException
in interface NetworkBridge
serviceRemoteCommand
protected void serviceRemoteCommand(Command command)
serviceLocalException
public void serviceLocalException(Throwable error)
- Description copied from interface:
NetworkBridge
- servicee an exception
- Specified by:
serviceLocalException
in interface NetworkBridge
getControllingService
protected Service getControllingService()
addSubscription
protected void addSubscription(DemandSubscription sub)
throws IOException
- Throws:
IOException
removeSubscription
protected void removeSubscription(DemandSubscription sub)
throws IOException
- Throws:
IOException
configureMessage
protected Message configureMessage(MessageDispatch md)
serviceLocalCommand
protected void serviceLocalCommand(Command command)
getDynamicallyIncludedDestinations
public ActiveMQDestination[] getDynamicallyIncludedDestinations()
- Returns:
- Returns the dynamicallyIncludedDestinations.
setDynamicallyIncludedDestinations
public void setDynamicallyIncludedDestinations(ActiveMQDestination[] dynamicallyIncludedDestinations)
- Parameters:
dynamicallyIncludedDestinations
- The
dynamicallyIncludedDestinations to set.
getExcludedDestinations
public ActiveMQDestination[] getExcludedDestinations()
- Returns:
- Returns the excludedDestinations.
setExcludedDestinations
public void setExcludedDestinations(ActiveMQDestination[] excludedDestinations)
- Parameters:
excludedDestinations
- The excludedDestinations to set.
getStaticallyIncludedDestinations
public ActiveMQDestination[] getStaticallyIncludedDestinations()
- Returns:
- Returns the staticallyIncludedDestinations.
setStaticallyIncludedDestinations
public void setStaticallyIncludedDestinations(ActiveMQDestination[] staticallyIncludedDestinations)
- Parameters:
staticallyIncludedDestinations
- The staticallyIncludedDestinations
to set.
getDurableDestinations
public ActiveMQDestination[] getDurableDestinations()
- Returns:
- Returns the durableDestinations.
setDurableDestinations
public void setDurableDestinations(ActiveMQDestination[] durableDestinations)
- Parameters:
durableDestinations
- The durableDestinations to set.
getLocalBroker
public Transport getLocalBroker()
- Returns:
- Returns the localBroker.
getRemoteBroker
public Transport getRemoteBroker()
- Returns:
- Returns the remoteBroker.
isCreatedByDuplex
public boolean isCreatedByDuplex()
- Returns:
- the createdByDuplex
setCreatedByDuplex
public void setCreatedByDuplex(boolean createdByDuplex)
- Parameters:
createdByDuplex
- the createdByDuplex to set
contains
public static boolean contains(BrokerId[] brokerPath,
BrokerId brokerId)
appendToBrokerPath
protected BrokerId[] appendToBrokerPath(BrokerId[] brokerPath,
BrokerId[] pathsToAppend)
appendToBrokerPath
protected BrokerId[] appendToBrokerPath(BrokerId[] brokerPath,
BrokerId idToAppend)
isPermissableDestination
protected boolean isPermissableDestination(ActiveMQDestination destination)
isPermissableDestination
protected boolean isPermissableDestination(ActiveMQDestination destination,
boolean allowTemporary)
setupStaticDestinations
protected void setupStaticDestinations()
- Subscriptions for these destinations are always created
addConsumerInfo
protected boolean addConsumerInfo(ConsumerInfo consumerInfo)
throws IOException
- Throws:
IOException
createDemandSubscription
protected DemandSubscription createDemandSubscription(ConsumerInfo info)
throws IOException
- Throws:
IOException
doCreateDemandSubscription
protected DemandSubscription doCreateDemandSubscription(ConsumerInfo info)
throws IOException
- Throws:
IOException
createDemandSubscription
protected final DemandSubscription createDemandSubscription(ActiveMQDestination destination)
configureDemandSubscription
protected void configureDemandSubscription(ConsumerInfo info,
DemandSubscription sub)
throws IOException
- Throws:
IOException
removeDemandSubscription
protected void removeDemandSubscription(ConsumerId id)
throws IOException
- Throws:
IOException
removeDemandSubscriptionByLocalId
protected boolean removeDemandSubscriptionByLocalId(ConsumerId consumerId)
waitStarted
protected void waitStarted()
throws InterruptedException
- Throws:
InterruptedException
clearDownSubscriptions
protected void clearDownSubscriptions()
createNetworkBridgeFilter
protected abstract NetworkBridgeFilter createNetworkBridgeFilter(ConsumerInfo info)
throws IOException
- Throws:
IOException
serviceLocalBrokerInfo
protected abstract void serviceLocalBrokerInfo(Command command)
throws InterruptedException
- Throws:
InterruptedException
addRemoteBrokerToBrokerPath
protected abstract void addRemoteBrokerToBrokerPath(ConsumerInfo info)
throws IOException
- Throws:
IOException
serviceRemoteBrokerInfo
protected abstract void serviceRemoteBrokerInfo(Command command)
throws IOException
- Throws:
IOException
getRemoteBrokerPath
protected abstract BrokerId[] getRemoteBrokerPath()
setNetworkBridgeListener
public void setNetworkBridgeListener(NetworkBridgeListener listener)
- Description copied from interface:
NetworkBridge
- Set the NetworkBridgeFailedListener
- Specified by:
setNetworkBridgeListener
in interface NetworkBridge
getRemoteAddress
public String getRemoteAddress()
- Specified by:
getRemoteAddress
in interface NetworkBridge
getLocalAddress
public String getLocalAddress()
- Specified by:
getLocalAddress
in interface NetworkBridge
getRemoteBrokerName
public String getRemoteBrokerName()
- Specified by:
getRemoteBrokerName
in interface NetworkBridge
getLocalBrokerName
public String getLocalBrokerName()
- Specified by:
getLocalBrokerName
in interface NetworkBridge
getDequeueCounter
public long getDequeueCounter()
- Specified by:
getDequeueCounter
in interface NetworkBridge
getEnqueueCounter
public long getEnqueueCounter()
- Specified by:
getEnqueueCounter
in interface NetworkBridge
isDuplex
protected boolean isDuplex()
setBrokerService
public void setBrokerService(BrokerService brokerService)
- Specified by:
setBrokerService
in interface BrokerServiceAware
Copyright © 2005-2011 Apache Software Foundation. All Rights Reserved.