public abstract class DemandForwardingBridgeSupport extends Object implements NetworkBridge, BrokerServiceAware
| Constructor and Description |
|---|
DemandForwardingBridgeSupport(NetworkBridgeConfiguration configuration,
Transport localBroker,
Transport remoteBroker) |
protected static final String DURABLE_SUB_PREFIX
protected final Transport localBroker
protected final Transport remoteBroker
protected final IdGenerator idGenerator
protected final LongSequenceGenerator consumerIdGenerator
protected ConnectionInfo localConnectionInfo
protected ConnectionInfo remoteConnectionInfo
protected SessionInfo localSessionInfo
protected ProducerInfo producerInfo
protected String remoteBrokerName
protected String localClientId
protected ConsumerInfo demandConsumerInfo
protected int demandConsumerDispatched
protected final AtomicBoolean localBridgeStarted
protected final AtomicBoolean remoteBridgeStarted
protected AtomicBoolean disposed
protected BrokerId localBrokerId
protected ActiveMQDestination[] excludedDestinations
protected ActiveMQDestination[] dynamicallyIncludedDestinations
protected ActiveMQDestination[] staticallyIncludedDestinations
protected ActiveMQDestination[] durableDestinations
protected final ConcurrentHashMap<ConsumerId,DemandSubscription> subscriptionMapByLocalId
protected final ConcurrentHashMap<ConsumerId,DemandSubscription> subscriptionMapByRemoteId
protected final BrokerId[] localBrokerPath
protected CountDownLatch startedLatch
protected CountDownLatch localStartedLatch
protected final AtomicBoolean lastConnectSucceeded
protected NetworkBridgeConfiguration configuration
protected final NetworkBridgeFilterFactory defaultFilterFactory
protected final BrokerId[] remoteBrokerPath
protected Object brokerInfoMutex
protected BrokerId remoteBrokerId
public DemandForwardingBridgeSupport(NetworkBridgeConfiguration configuration, Transport localBroker, Transport remoteBroker)
public void duplexStart(TransportConnection connection, BrokerInfo localBrokerInfo, BrokerInfo remoteBrokerInfo) throws Exception
Exceptionprotected void triggerLocalStartBridge() throws IOException
IOExceptionprotected void triggerRemoteStartBridge() throws IOException
IOExceptionprotected void startRemoteBridge() throws Exception
Exceptionpublic void serviceRemoteException(Throwable error)
NetworkBridgeserviceRemoteException in interface NetworkBridgeprotected void serviceRemoteCommand(Command command)
public void serviceLocalException(Throwable error)
NetworkBridgeserviceLocalException in interface NetworkBridgeprotected Service getControllingService()
protected void addSubscription(DemandSubscription sub) throws IOException
IOExceptionprotected void removeSubscription(DemandSubscription sub) throws IOException
IOExceptionprotected Message configureMessage(MessageDispatch md)
protected void serviceLocalCommand(Command command)
public ActiveMQDestination[] getDynamicallyIncludedDestinations()
public void setDynamicallyIncludedDestinations(ActiveMQDestination[] dynamicallyIncludedDestinations)
dynamicallyIncludedDestinations - The
dynamicallyIncludedDestinations to set.public ActiveMQDestination[] getExcludedDestinations()
public void setExcludedDestinations(ActiveMQDestination[] excludedDestinations)
excludedDestinations - The excludedDestinations to set.public ActiveMQDestination[] getStaticallyIncludedDestinations()
public void setStaticallyIncludedDestinations(ActiveMQDestination[] staticallyIncludedDestinations)
staticallyIncludedDestinations - The staticallyIncludedDestinations
to set.public ActiveMQDestination[] getDurableDestinations()
public void setDurableDestinations(ActiveMQDestination[] durableDestinations)
durableDestinations - The durableDestinations to set.public Transport getLocalBroker()
public Transport getRemoteBroker()
public boolean isCreatedByDuplex()
public void setCreatedByDuplex(boolean createdByDuplex)
createdByDuplex - the createdByDuplex to setprotected BrokerId[] appendToBrokerPath(BrokerId[] brokerPath, BrokerId[] pathsToAppend)
protected BrokerId[] appendToBrokerPath(BrokerId[] brokerPath, BrokerId idToAppend)
protected boolean isPermissableDestination(ActiveMQDestination destination)
protected boolean isPermissableDestination(ActiveMQDestination destination, boolean allowTemporary)
protected void setupStaticDestinations()
protected boolean addConsumerInfo(ConsumerInfo consumerInfo) throws IOException
IOExceptionprotected DemandSubscription createDemandSubscription(ConsumerInfo info) throws IOException
IOExceptionprotected DemandSubscription doCreateDemandSubscription(ConsumerInfo info) throws IOException
IOExceptionprotected final DemandSubscription createDemandSubscription(ActiveMQDestination destination)
protected void configureDemandSubscription(ConsumerInfo info, DemandSubscription sub) throws IOException
IOExceptionprotected void removeDemandSubscription(ConsumerId id) throws IOException
IOExceptionprotected boolean removeDemandSubscriptionByLocalId(ConsumerId consumerId)
protected void waitStarted() throws InterruptedException
InterruptedExceptionprotected void clearDownSubscriptions()
protected NetworkBridgeFilter createNetworkBridgeFilter(ConsumerInfo info) throws IOException
IOExceptionprotected void serviceLocalBrokerInfo(Command command) throws InterruptedException
InterruptedExceptionprotected void addRemoteBrokerToBrokerPath(ConsumerInfo info) throws IOException
IOExceptionprotected void serviceRemoteBrokerInfo(Command command) throws IOException
IOExceptionprotected BrokerId[] getRemoteBrokerPath()
public void setNetworkBridgeListener(NetworkBridgeListener listener)
NetworkBridgesetNetworkBridgeListener in interface NetworkBridgepublic String getRemoteAddress()
getRemoteAddress in interface NetworkBridgepublic String getLocalAddress()
getLocalAddress in interface NetworkBridgepublic String getRemoteBrokerName()
getRemoteBrokerName in interface NetworkBridgepublic String getLocalBrokerName()
getLocalBrokerName in interface NetworkBridgepublic long getDequeueCounter()
getDequeueCounter in interface NetworkBridgepublic long getEnqueueCounter()
getEnqueueCounter in interface NetworkBridgeprotected boolean isDuplex()
public ConcurrentHashMap<ConsumerId,DemandSubscription> getLocalSubscriptionMap()
public void setBrokerService(BrokerService brokerService)
setBrokerService in interface BrokerServiceAwarepublic void setMbeanObjectName(ObjectName objectName)
setMbeanObjectName in interface NetworkBridgepublic ObjectName getMbeanObjectName()
getMbeanObjectName in interface NetworkBridgeCopyright © 2005–2017. All rights reserved.