/** * Looks up the value(s) matching the given Destination key. For simple * destinations this is typically a List of one single value, for wildcards * or composite destinations this will typically be a List of matching * values. * * @param key the destination to lookup * @return a List of matching values or an empty list if there are no * matching values. */ @SuppressWarnings({"rawtypes", "unchecked"}) public Set get(ActiveMQDestination key) { synchronized (this) { return unsynchronizedGet(key); } }
/** * Provide an exact or wildcard lookup of destinations in the region * * @return a set of matching destination objects. */ @Override @SuppressWarnings("unchecked") public Set<Destination> getDestinations(ActiveMQDestination destination) { destinationsLock.readLock().lock(); try{ return destinationMap.unsynchronizedGet(destination); } finally { destinationsLock.readLock().unlock(); } }
@Override @SuppressWarnings("unchecked") public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { destinationsLock.readLock().lock(); try { for (Destination dest : (Set<Destination>) destinationMap.unsynchronizedGet(info.getDestination())) { dest.addProducer(context, info); } } finally { destinationsLock.readLock().unlock(); } }
/** * Removes a Producer. * * @param context * the environment the operation is being executed under. * @throws Exception * TODO */ @Override @SuppressWarnings("unchecked") public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception { destinationsLock.readLock().lock(); try { for (Destination dest : (Set<Destination>) destinationMap.unsynchronizedGet(info.getDestination())) { dest.removeProducer(context, info); } } finally { destinationsLock.readLock().unlock(); } }
@SuppressWarnings({"rawtypes", "unchecked"}) public Set unsynchronizedGet(ActiveMQDestination key) { if (key.isComposite()) { ActiveMQDestination[] destinations = key.getCompositeDestinations(); Set answer = new HashSet(destinations.length); for (int i = 0; i < destinations.length; i++) { ActiveMQDestination childDestination = destinations[i]; Object value = unsynchronizedGet(childDestination); if (value instanceof Set) { answer.addAll((Set) value); } else if (value != null) { answer.add(value); } } return answer; } return findWildcardMatches(key); }
@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()); } }
destinationsLock.readLock().lock(); try { for (Destination dest : (Set<Destination>) destinationMap.unsynchronizedGet(info.getDestination())) { addList.add(dest);
destinationMap.unsynchronizedGet(entry.getDestination()).size() : regionStatistics.getDestinations().getCount()); if (destinationSize >= entry.getMaxDestinations()) { if (entry.getDestination() != null) {
/** * Looks up the value(s) matching the given Destination key. For simple * destinations this is typically a List of one single value, for wildcards * or composite destinations this will typically be a List of matching * values. * * @param key the destination to lookup * @return a List of matching values or an empty list if there are no * matching values. */ @SuppressWarnings({"rawtypes", "unchecked"}) public Set get(ActiveMQDestination key) { synchronized (this) { return unsynchronizedGet(key); } }
/** * Looks up the value(s) matching the given Destination key. For simple * destinations this is typically a List of one single value, for wildcards * or composite destinations this will typically be a List of matching * values. * * @param key the destination to lookup * @return a List of matching values or an empty list if there are no * matching values. */ @SuppressWarnings({"rawtypes", "unchecked"}) public Set get(ActiveMQDestination key) { synchronized (this) { return unsynchronizedGet(key); } }
/** * Looks up the value(s) matching the given Destination key. For simple * destinations this is typically a List of one single value, for wildcards * or composite destinations this will typically be a List of matching * values. * * @param key the destination to lookup * @return a List of matching values or an empty list if there are no * matching values. */ @SuppressWarnings({"rawtypes", "unchecked"}) public Set get(ActiveMQDestination key) { synchronized (this) { return unsynchronizedGet(key); } }
/** * Provide an exact or wildcard lookup of destinations in the region * * @return a set of matching destination objects. */ @Override @SuppressWarnings("unchecked") public Set<Destination> getDestinations(ActiveMQDestination destination) { destinationsLock.readLock().lock(); try{ return destinationMap.unsynchronizedGet(destination); } finally { destinationsLock.readLock().unlock(); } }
/** * Provide an exact or wildcard lookup of destinations in the region * * @return a set of matching destination objects. */ @Override @SuppressWarnings("unchecked") public Set<Destination> getDestinations(ActiveMQDestination destination) { destinationsLock.readLock().lock(); try{ return destinationMap.unsynchronizedGet(destination); } finally { destinationsLock.readLock().unlock(); } }
/** * Provide an exact or wildcard lookup of destinations in the region * * @return a set of matching destination objects. */ @Override @SuppressWarnings("unchecked") public Set<Destination> getDestinations(ActiveMQDestination destination) { destinationsLock.readLock().lock(); try{ return destinationMap.unsynchronizedGet(destination); } finally { destinationsLock.readLock().unlock(); } }
@Override @SuppressWarnings("unchecked") public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { destinationsLock.readLock().lock(); try { for (Destination dest : (Set<Destination>) destinationMap.unsynchronizedGet(info.getDestination())) { dest.addProducer(context, info); } } finally { destinationsLock.readLock().unlock(); } }
@Override @SuppressWarnings("unchecked") public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { destinationsLock.readLock().lock(); try { for (Destination dest : (Set<Destination>) destinationMap.unsynchronizedGet(info.getDestination())) { dest.addProducer(context, info); } } finally { destinationsLock.readLock().unlock(); } }
@Override @SuppressWarnings("unchecked") public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { destinationsLock.readLock().lock(); try { for (Destination dest : (Set<Destination>) destinationMap.unsynchronizedGet(info.getDestination())) { dest.addProducer(context, info); } } finally { destinationsLock.readLock().unlock(); } }
/** * Removes a Producer. * * @param context * the environment the operation is being executed under. * @throws Exception * TODO */ @Override @SuppressWarnings("unchecked") public void removeProducer(ConnectionContext context, ProducerInfo info) throws Exception { destinationsLock.readLock().lock(); try { for (Destination dest : (Set<Destination>) destinationMap.unsynchronizedGet(info.getDestination())) { dest.removeProducer(context, info); } } finally { destinationsLock.readLock().unlock(); } }
@SuppressWarnings({"rawtypes", "unchecked"}) public Set unsynchronizedGet(ActiveMQDestination key) { if (key.isComposite()) { ActiveMQDestination[] destinations = key.getCompositeDestinations(); Set answer = new HashSet(destinations.length); for (int i = 0; i < destinations.length; i++) { ActiveMQDestination childDestination = destinations[i]; Object value = unsynchronizedGet(childDestination); if (value instanceof Set) { answer.addAll((Set) value); } else if (value != null) { answer.add(value); } } return answer; } return findWildcardMatches(key); }
@SuppressWarnings({"rawtypes", "unchecked"}) public Set unsynchronizedGet(ActiveMQDestination key) { if (key.isComposite()) { ActiveMQDestination[] destinations = key.getCompositeDestinations(); Set answer = new HashSet(destinations.length); for (int i = 0; i < destinations.length; i++) { ActiveMQDestination childDestination = destinations[i]; Object value = unsynchronizedGet(childDestination); if (value instanceof Set) { answer.addAll((Set) value); } else if (value != null) { answer.add(value); } } return answer; } return findWildcardMatches(key); }