org.apache.activemq.network
Class DemandForwardingBridgeSupport
java.lang.Object
org.apache.activemq.network.DemandForwardingBridgeSupport
- All Implemented Interfaces:
- Bridge, Service
- Direct Known Subclasses:
- CompositeDemandForwardingBridge, DemandForwardingBridge
public abstract class DemandForwardingBridgeSupport
- extends java.lang.Object
- implements Bridge
A useful base class for implementing demand forwarding bridges.
- Version:
- $Revision: 511085 $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected static final org.apache.commons.logging.Log log
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
localBrokerName
protected java.lang.String localBrokerName
remoteBrokerName
protected java.lang.String remoteBrokerName
localClientId
protected java.lang.String localClientId
userName
protected java.lang.String userName
password
protected java.lang.String password
prefetchSize
protected int prefetchSize
dispatchAsync
protected boolean dispatchAsync
destinationFilter
protected java.lang.String destinationFilter
bridgeTempDestinations
protected boolean bridgeTempDestinations
name
protected java.lang.String name
demandConsumerInfo
protected ConsumerInfo demandConsumerInfo
demandConsumerDispatched
protected int demandConsumerDispatched
localBridgeStarted
protected final edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean localBridgeStarted
remoteBridgeStarted
protected final edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean remoteBridgeStarted
disposed
protected boolean disposed
localBrokerId
protected BrokerId localBrokerId
excludedDestinations
protected ActiveMQDestination[] excludedDestinations
dynamicallyIncludedDestinations
protected ActiveMQDestination[] dynamicallyIncludedDestinations
staticallyIncludedDestinations
protected ActiveMQDestination[] staticallyIncludedDestinations
durableDestinations
protected ActiveMQDestination[] durableDestinations
subscriptionMapByLocalId
protected final edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap subscriptionMapByLocalId
subscriptionMapByRemoteId
protected final edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap subscriptionMapByRemoteId
localBrokerPath
protected final BrokerId[] localBrokerPath
startedLatch
protected edu.emory.mathcs.backport.java.util.concurrent.CountDownLatch startedLatch
remoteBrokerNameKnownLatch
protected edu.emory.mathcs.backport.java.util.concurrent.CountDownLatch remoteBrokerNameKnownLatch
decreaseNetworkConsumerPriority
protected boolean decreaseNetworkConsumerPriority
networkTTL
protected int networkTTL
remoteInterupted
protected final edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean remoteInterupted
lastConnectSucceeded
protected final edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean lastConnectSucceeded
DemandForwardingBridgeSupport
public DemandForwardingBridgeSupport(Transport localBroker,
Transport remoteBroker)
start
public void start()
throws java.lang.Exception
- Specified by:
start
in interface Service
- Throws:
java.lang.Exception
triggerLocalStartBridge
protected void triggerLocalStartBridge()
throws java.io.IOException
- Throws:
java.io.IOException
triggerRemoteStartBridge
protected void triggerRemoteStartBridge()
throws java.io.IOException
- Throws:
java.io.IOException
startLocalBridge
protected void startLocalBridge()
throws java.lang.Exception
- Throws:
java.lang.Exception
startRemoteBridge
protected void startRemoteBridge()
throws java.lang.Exception
- Throws:
java.lang.Exception
stop
public void stop()
throws java.lang.Exception
- Specified by:
stop
in interface Service
- Throws:
java.lang.Exception
serviceRemoteException
protected void serviceRemoteException(java.lang.Throwable error)
serviceRemoteCommand
protected void serviceRemoteCommand(Command command)
serviceLocalException
protected void serviceLocalException(java.lang.Throwable error)
addSubscription
protected void addSubscription(DemandSubscription sub)
throws java.io.IOException
- Throws:
java.io.IOException
removeSubscription
protected void removeSubscription(DemandSubscription sub)
throws java.io.IOException
- Throws:
java.io.IOException
getDemandSubscription
protected DemandSubscription getDemandSubscription(MessageDispatch md)
configureMessage
protected Message configureMessage(MessageDispatch md)
serviceLocalCommand
protected void serviceLocalCommand(Command command)
getPrefetchSize
public int getPrefetchSize()
- Returns:
- prefetch size
setPrefetchSize
public void setPrefetchSize(int prefetchSize)
- Parameters:
prefetchSize
-
isDispatchAsync
public boolean isDispatchAsync()
- Returns:
- true if dispatch async
setDispatchAsync
public void setDispatchAsync(boolean dispatchAsync)
- Parameters:
dispatchAsync
-
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.
getLocalBrokerName
public java.lang.String getLocalBrokerName()
- Returns:
- Returns the localBrokerName.
setLocalBrokerName
public void setLocalBrokerName(java.lang.String localBrokerName)
- Parameters:
localBrokerName
- The localBrokerName to set.
getLocalBroker
public Transport getLocalBroker()
- Returns:
- Returns the localBroker.
getRemoteBroker
public Transport getRemoteBroker()
- Returns:
- Returns the remoteBroker.
getName
public java.lang.String getName()
- Returns:
- Returns the name.
setName
public void setName(java.lang.String name)
- Parameters:
name
- The name to set.
isDecreaseNetworkConsumerPriority
public boolean isDecreaseNetworkConsumerPriority()
- Returns:
- Returns the decreaseNetworkConsumerPriority.
setDecreaseNetworkConsumerPriority
public void setDecreaseNetworkConsumerPriority(boolean decreaseNetworkConsumerPriority)
- Parameters:
decreaseNetworkConsumerPriority
- The decreaseNetworkConsumerPriority to set.
getNetworkTTL
public int getNetworkTTL()
- Returns:
- Returns the networkTTL.
setNetworkTTL
public void setNetworkTTL(int networkTTL)
- Parameters:
networkTTL
- The networkTTL 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)
setupStaticDestinations
protected void setupStaticDestinations()
- Subscriptions for these desitnations are always created
createDemandSubscription
protected DemandSubscription createDemandSubscription(ConsumerInfo info)
throws java.io.IOException
- Throws:
java.io.IOException
doCreateDemandSubscription
protected DemandSubscription doCreateDemandSubscription(ConsumerInfo info)
throws java.io.IOException
- Throws:
java.io.IOException
createDemandSubscription
protected DemandSubscription createDemandSubscription(ActiveMQDestination destination)
configureDemandSubscription
protected void configureDemandSubscription(ConsumerInfo info,
DemandSubscription sub)
throws java.io.IOException
- Throws:
java.io.IOException
removeDemandSubscription
protected void removeDemandSubscription(ConsumerId id)
throws java.io.IOException
- Throws:
java.io.IOException
waitStarted
protected void waitStarted()
throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
clearDownSubscriptions
protected void clearDownSubscriptions()
createNetworkBridgeFilter
protected abstract NetworkBridgeFilter createNetworkBridgeFilter(ConsumerInfo info)
throws java.io.IOException
- Throws:
java.io.IOException
serviceLocalBrokerInfo
protected abstract void serviceLocalBrokerInfo(Command command)
throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
addRemoteBrokerToBrokerPath
protected abstract void addRemoteBrokerToBrokerPath(ConsumerInfo info)
throws java.io.IOException
- Throws:
java.io.IOException
serviceRemoteBrokerInfo
protected abstract void serviceRemoteBrokerInfo(Command command)
throws java.io.IOException
- Throws:
java.io.IOException
getRemoteBrokerPath
protected abstract BrokerId[] getRemoteBrokerPath()
getPassword
public java.lang.String getPassword()
setPassword
public void setPassword(java.lang.String password)
getUserName
public java.lang.String getUserName()
setUserName
public void setUserName(java.lang.String userName)
isBridgeTempDestinations
public boolean isBridgeTempDestinations()
setBridgeTempDestinations
public void setBridgeTempDestinations(boolean bridgeTempDestinations)
Copyright © 2009 Apache Software Foundation. All Rights Reserved.