@Override public synchronized void addBroker(Connection connection, BrokerInfo info) { BrokerInfo existing = brokerInfos.get(info.getBrokerId()); if (existing == null) { existing = info.copy(); existing.setPeerBrokerInfos(null); brokerInfos.put(info.getBrokerId(), existing); } existing.incrementRefCount(); LOG.debug("{} addBroker: {} brokerInfo size: {}", new Object[]{ getBrokerName(), info.getBrokerName(), brokerInfos.size() }); addBrokerInClusterUpdate(info); }
@Override public synchronized void removeBroker(Connection connection, BrokerInfo info) { if (info != null) { BrokerInfo existing = brokerInfos.get(info.getBrokerId()); if (existing != null && existing.decrementRefCount() == 0) { brokerInfos.remove(info.getBrokerId()); } LOG.debug("{} removeBroker: {} brokerInfo size: {}", new Object[]{ getBrokerName(), info.getBrokerName(), brokerInfos.size()}); // When stopping don't send cluster updates since we are the one's tearing down // our own bridges. if (!brokerService.isStopping()) { removeBrokerInClusterUpdate(info); } } }
@Override @SuppressWarnings("unchecked") public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { LOG.debug("{} removing consumer: {} for destination: {}", new Object[]{ broker.getBrokerName(), info.getConsumerId(), info.getDestination() }); Subscription sub = subscriptions.remove(info.getConsumerId()); // The sub could be removed elsewhere - see ConnectionSplitBroker if (sub != null) { // remove the subscription from all the matching queues. List<Destination> removeList = new ArrayList<Destination>(); destinationsLock.readLock().lock(); try { for (Destination dest : (Set<Destination>) destinationMap.unsynchronizedGet(info.getDestination())) { removeList.add(dest); } } finally { destinationsLock.readLock().unlock(); } for (Destination dest : removeList) { dest.removeSubscription(context, sub, info.getLastDeliveredSequenceId()); } destroySubscription(sub); } synchronized (consumerChangeMutexMap) { consumerChangeMutexMap.remove(info.getConsumerId()); } }
LOG.debug("{} removing destination: {}", broker.getBrokerName(), destination);
LOG.debug("{} adding destination: {}", broker.getBrokerName(), destination); dest = createDestination(context, destination);
@Override @SuppressWarnings("unchecked") public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { LOG.debug("{} adding consumer: {} for destination: {}", new Object[]{ broker.getBrokerName(), info.getConsumerId(), info.getDestination() }); ActiveMQDestination destination = info.getDestination(); if (destination != null && !destination.isPattern() && !destination.isComposite()) {
clientIdSet.put(clientId, context); } else { throw new InvalidClientIDException("Broker: " + getBrokerName() + " - Client: " + clientId + " already connected from " + oldContext.getConnection().getRemoteAddress());
if (stats != null) { ActiveMQMapMessage statsMessage = new ActiveMQMapMessage(); statsMessage.setString("brokerName", regionBroker.getBrokerName()); statsMessage.setString("brokerId", regionBroker.getBrokerId().toString()); statsMessage.setString("destinationName", dest.getActiveMQDestination().toString()); SystemUsage systemUsage = brokerService.getSystemUsage(); DestinationStatistics stats = regionBroker.getDestinationStatistics(); statsMessage.setString("brokerName", regionBroker.getBrokerName()); statsMessage.setString("brokerId", regionBroker.getBrokerId().toString()); statsMessage.setLong("size", stats.getMessages().getCount());
@Override public synchronized void removeBroker(Connection connection, BrokerInfo info) { if (info != null) { BrokerInfo existing = brokerInfos.get(info.getBrokerId()); if (existing != null && existing.decrementRefCount() == 0) { brokerInfos.remove(info.getBrokerId()); } LOG.debug(getBrokerName() + " removeBroker:" + info.getBrokerName() + " brokerInfo size : " + brokerInfos.size()); removeBrokerInClusterUpdate(); } }
@Override public synchronized void addBroker(Connection connection, BrokerInfo info) { BrokerInfo existing = brokerInfos.get(info.getBrokerId()); if (existing == null) { existing = info.copy(); existing.setPeerBrokerInfos(null); brokerInfos.put(info.getBrokerId(), existing); } existing.incrementRefCount(); LOG.debug("{} addBroker: {} brokerInfo size: {}", new Object[]{ getBrokerName(), info.getBrokerName(), brokerInfos.size() }); addBrokerInClusterUpdate(info); }
@Override public synchronized void addBroker(Connection connection, BrokerInfo info) { BrokerInfo existing = brokerInfos.get(info.getBrokerId()); if (existing == null) { existing = info.copy(); existing.setPeerBrokerInfos(null); brokerInfos.put(info.getBrokerId(), existing); } existing.incrementRefCount(); LOG.debug("{} addBroker: {} brokerInfo size: {}", new Object[]{ getBrokerName(), info.getBrokerName(), brokerInfos.size() }); addBrokerInClusterUpdate(info); }
@Override public synchronized void addBroker(Connection connection, BrokerInfo info) { BrokerInfo existing = brokerInfos.get(info.getBrokerId()); if (existing == null) { existing = info.copy(); existing.setPeerBrokerInfos(null); brokerInfos.put(info.getBrokerId(), existing); } existing.incrementRefCount(); LOG.debug("{} addBroker: {} brokerInfo size: {}", new Object[]{ getBrokerName(), info.getBrokerName(), brokerInfos.size() }); addBrokerInClusterUpdate(info); }
@Override public synchronized void removeBroker(Connection connection, BrokerInfo info) { if (info != null) { BrokerInfo existing = brokerInfos.get(info.getBrokerId()); if (existing != null && existing.decrementRefCount() == 0) { brokerInfos.remove(info.getBrokerId()); } LOG.debug("{} removeBroker: {} brokerInfo size: {}", new Object[]{ getBrokerName(), info.getBrokerName(), brokerInfos.size()}); // When stopping don't send cluster updates since we are the one's tearing down // our own bridges. if (!brokerService.isStopping()) { removeBrokerInClusterUpdate(info); } } }
@Override public synchronized void removeBroker(Connection connection, BrokerInfo info) { if (info != null) { BrokerInfo existing = brokerInfos.get(info.getBrokerId()); if (existing != null && existing.decrementRefCount() == 0) { brokerInfos.remove(info.getBrokerId()); } LOG.debug("{} removeBroker: {} brokerInfo size: {}", new Object[]{ getBrokerName(), info.getBrokerName(), brokerInfos.size()}); // When stopping don't send cluster updates since we are the one's tearing down // our own bridges. if (!brokerService.isStopping()) { removeBrokerInClusterUpdate(info); } } }
@Override public synchronized void addBroker(Connection connection, BrokerInfo info) { BrokerInfo existing = brokerInfos.get(info.getBrokerId()); if (existing == null) { existing = info.copy(); existing.setPeerBrokerInfos(null); brokerInfos.put(info.getBrokerId(), existing); } existing.incrementRefCount(); LOG.debug(getBrokerName() + " addBroker:" + info.getBrokerName() + " brokerInfo size : " + brokerInfos.size()); addBrokerInClusterUpdate(); }
@Override public synchronized void removeBroker(Connection connection, BrokerInfo info) { if (info != null) { BrokerInfo existing = brokerInfos.get(info.getBrokerId()); if (existing != null && existing.decrementRefCount() == 0) { brokerInfos.remove(info.getBrokerId()); } LOG.debug("{} removeBroker: {} brokerInfo size: {}", new Object[]{ getBrokerName(), info.getBrokerName(), brokerInfos.size()}); // When stopping don't send cluster updates since we are the one's tearing down // our own bridges. if (!brokerService.isStopping()) { removeBrokerInClusterUpdate(info); } } }
@Override @SuppressWarnings("unchecked") public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { LOG.debug("{} removing consumer: {} for destination: {}", new Object[]{ broker.getBrokerName(), info.getConsumerId(), info.getDestination() }); Subscription sub = subscriptions.remove(info.getConsumerId()); // The sub could be removed elsewhere - see ConnectionSplitBroker if (sub != null) { // remove the subscription from all the matching queues. List<Destination> removeList = new ArrayList<Destination>(); destinationsLock.readLock().lock(); try { for (Destination dest : (Set<Destination>) destinationMap.unsynchronizedGet(info.getDestination())) { removeList.add(dest); } } finally { destinationsLock.readLock().unlock(); } for (Destination dest : removeList) { dest.removeSubscription(context, sub, info.getLastDeliveredSequenceId()); } destroySubscription(sub); } synchronized (consumerChangeMutexMap) { consumerChangeMutexMap.remove(info.getConsumerId()); } }
@Override @SuppressWarnings("unchecked") public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { LOG.debug("{} removing consumer: {} for destination: {}", new Object[]{ broker.getBrokerName(), info.getConsumerId(), info.getDestination() }); Subscription sub = subscriptions.remove(info.getConsumerId()); // The sub could be removed elsewhere - see ConnectionSplitBroker if (sub != null) { // remove the subscription from all the matching queues. List<Destination> removeList = new ArrayList<Destination>(); destinationsLock.readLock().lock(); try { for (Destination dest : (Set<Destination>) destinationMap.unsynchronizedGet(info.getDestination())) { removeList.add(dest); } } finally { destinationsLock.readLock().unlock(); } for (Destination dest : removeList) { dest.removeSubscription(context, sub, info.getLastDeliveredSequenceId()); } destroySubscription(sub); } synchronized (consumerChangeMutexMap) { consumerChangeMutexMap.remove(info.getConsumerId()); } }
@Override @SuppressWarnings("unchecked") public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { LOG.debug("{} removing consumer: {} for destination: {}", new Object[]{ broker.getBrokerName(), info.getConsumerId(), info.getDestination() }); Subscription sub = subscriptions.remove(info.getConsumerId()); // The sub could be removed elsewhere - see ConnectionSplitBroker if (sub != null) { // remove the subscription from all the matching queues. List<Destination> removeList = new ArrayList<Destination>(); destinationsLock.readLock().lock(); try { for (Destination dest : (Set<Destination>) destinationMap.unsynchronizedGet(info.getDestination())) { removeList.add(dest); } } finally { destinationsLock.readLock().unlock(); } for (Destination dest : removeList) { dest.removeSubscription(context, sub, info.getLastDeliveredSequenceId()); } destroySubscription(sub); } synchronized (consumerChangeMutexMap) { consumerChangeMutexMap.remove(info.getConsumerId()); } }
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { LOG.debug(broker.getBrokerName() + " removing consumer: " + info.getConsumerId() + " for destination: " + info.getDestination()); Subscription sub = subscriptions.remove(info.getConsumerId()); // The sub could be removed elsewhere - see ConnectionSplitBroker if (sub != null) { // remove the subscription from all the matching queues. List<Destination> removeList = new ArrayList<Destination>(); synchronized (destinationsMutex) { for (Iterator iter = destinationMap.get(info.getDestination()).iterator(); iter.hasNext();) { Destination dest = (Destination) iter.next(); removeList.add(dest); } } for (Destination dest : removeList) { dest.removeSubscription(context, sub, info.getLastDeliveredSequenceId()); } destroySubscription(sub); } synchronized (consumerChangeMutexMap) { consumerChangeMutexMap.remove(info.getConsumerId()); } }