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 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 final AtomicBoolean bridgeFailed
protected final AtomicBoolean disposed
protected BrokerId localBrokerId
protected ActiveMQDestination[] excludedDestinations
protected ActiveMQDestination[] dynamicallyIncludedDestinations
protected ActiveMQDestination[] staticallyIncludedDestinations
protected ActiveMQDestination[] durableDestinations
protected final ConcurrentMap<ConsumerId,DemandSubscription> subscriptionMapByLocalId
protected final ConcurrentMap<ConsumerId,DemandSubscription> subscriptionMapByRemoteId
protected final Set<ConsumerId> forcedDurableRemoteId
protected final BrokerId[] localBrokerPath
protected final CountDownLatch startedLatch
protected final CountDownLatch localStartedLatch
protected final CountDownLatch staticDestinationsLatch
protected final AtomicBoolean lastConnectSucceeded
protected NetworkBridgeConfiguration configuration
protected final NetworkBridgeFilterFactory defaultFilterFactory
protected final BrokerId[] remoteBrokerPath
protected BrokerId remoteBrokerId
protected final NetworkBridgeStatistics networkBridgeStatistics
protected BrokerService brokerService
public DemandForwardingBridgeSupport(NetworkBridgeConfiguration configuration, Transport localBroker, Transport remoteBroker)
public void duplexStart(TransportConnection connection, BrokerInfo localBrokerInfo, BrokerInfo remoteBrokerInfo) throws Exception
Exception
protected void triggerStartAsyncNetworkBridgeCreation() throws IOException
IOException
protected void startRemoteBridge() throws Exception
Exception
public void serviceRemoteException(Throwable error)
NetworkBridge
serviceRemoteException
in interface NetworkBridge
protected void serviceRemoteCommand(Command command)
public void serviceLocalException(Throwable error)
NetworkBridge
serviceLocalException
in interface NetworkBridge
public void serviceLocalException(MessageDispatch messageDispatch, Throwable error)
protected Service getControllingService()
protected void addSubscription(DemandSubscription sub) throws IOException
IOException
protected void removeSubscription(DemandSubscription sub) throws IOException
IOException
protected Message configureMessage(MessageDispatch md) throws IOException
IOException
protected void serviceLocalCommand(Command command)
protected 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 ActiveMQDestination findMatchingDestination(ActiveMQDestination[] dests, ActiveMQDestination destination)
protected void setupStaticDestinations()
protected void addConsumerInfo(ConsumerInfo consumerInfo) throws IOException
IOException
protected final Collection<Subscription> getRegionSubscriptions(ActiveMQDestination dest)
protected DemandSubscription createDemandSubscription(ConsumerInfo info) throws IOException
IOException
protected DemandSubscription doCreateDemandSubscription(ConsumerInfo info) throws IOException
IOException
protected final DemandSubscription createDemandSubscription(ActiveMQDestination destination, String subscriptionName)
protected void configureDemandSubscription(ConsumerInfo info, DemandSubscription sub) throws IOException
IOException
protected void removeDemandSubscription(ConsumerId id) throws IOException
IOException
protected boolean removeDemandSubscriptionByLocalId(ConsumerId consumerId)
protected boolean safeWaitUntilStarted() throws InterruptedException
InterruptedException
protected NetworkBridgeFilter createNetworkBridgeFilter(ConsumerInfo info) throws IOException
IOException
protected void addRemoteBrokerToBrokerPath(ConsumerInfo info) throws IOException
IOException
protected BrokerId[] getRemoteBrokerPath()
public void setNetworkBridgeListener(NetworkBridgeListener listener)
NetworkBridge
setNetworkBridgeListener
in interface NetworkBridge
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 setpublic String getRemoteAddress()
getRemoteAddress
in interface NetworkBridge
public String getLocalAddress()
getLocalAddress
in interface NetworkBridge
public String getRemoteBrokerName()
getRemoteBrokerName
in interface NetworkBridge
public String getRemoteBrokerId()
getRemoteBrokerId
in interface NetworkBridge
public String getLocalBrokerName()
getLocalBrokerName
in interface NetworkBridge
public long getDequeueCounter()
getDequeueCounter
in interface NetworkBridge
public long getEnqueueCounter()
getEnqueueCounter
in interface NetworkBridge
public NetworkBridgeStatistics getNetworkBridgeStatistics()
getNetworkBridgeStatistics
in interface NetworkBridge
protected boolean isDuplex()
public ConcurrentMap<ConsumerId,DemandSubscription> getLocalSubscriptionMap()
public void setBrokerService(BrokerService brokerService)
setBrokerService
in interface BrokerServiceAware
public void setMbeanObjectName(ObjectName objectName)
setMbeanObjectName
in interface NetworkBridge
objectName
- The ObjectName assigned to this bridge in the MBean server.public ObjectName getMbeanObjectName()
getMbeanObjectName
in interface NetworkBridge
public void resetStats()
resetStats
in interface NetworkBridge
protected void serviceOutbound(Message message)
protected void serviceInboundMessage(Message message)
protected boolean canDuplexDispatch(Message message)
protected long getStoredSequenceIdForMessage(MessageId messageId)
protected void configureConsumerPrefetch(ConsumerInfo consumerInfo)
Copyright © 2005–2016 The Apache Software Foundation. All rights reserved.