@Override public Destination intercept(Destination destination) { final ActiveMQDestination activeMQDestination = destination.getActiveMQDestination(); Set matchingDestinations = destinationMap.get(activeMQDestination); List<Destination> destinations = new ArrayList<Destination>(); for (Iterator iter = matchingDestinations.iterator(); iter.hasNext();) { VirtualDestination virtualDestination = (VirtualDestination) iter.next(); Destination newDestination = virtualDestination.intercept(destination); destinations.add(newDestination); } if (!destinations.isEmpty()) { if (destinations.size() == 1) { return destinations.get(0); } else { // should rarely be used but here just in case return createCompositeDestination(destination, destinations); } } // check if the destination instead matches any mapped destinations Set mappedDestinations = mappedDestinationMap.get(activeMQDestination); if (!mappedDestinations.isEmpty()) { // create a mapped destination interceptor VirtualDestination virtualDestination = (VirtualDestination) mappedDestinations.toArray(new VirtualDestination[mappedDestinations.size()])[0]; return virtualDestination.interceptMappedDestination(destination); } return destination; }
public synchronized Destination intercept(Destination destination) { Set virtualDestinations = destinationMap.get(destination.getActiveMQDestination()); List<Destination> destinations = new ArrayList<Destination>(); for (Iterator iter = virtualDestinations.iterator(); iter.hasNext();) { VirtualDestination virtualDestination = (VirtualDestination)iter.next(); Destination newDestination = virtualDestination.intercept(destination); destinations.add(newDestination); } if (!destinations.isEmpty()) { if (destinations.size() == 1) { return destinations.get(0); } else { // should rarely be used but here just in case return createCompositeDestination(destination, destinations); } } return destination; }
@Override public Destination intercept(Destination destination) { final ActiveMQDestination activeMQDestination = destination.getActiveMQDestination(); Set matchingDestinations = destinationMap.get(activeMQDestination); List<Destination> destinations = new ArrayList<Destination>(); for (Iterator iter = matchingDestinations.iterator(); iter.hasNext();) { VirtualDestination virtualDestination = (VirtualDestination) iter.next(); Destination newDestination = virtualDestination.intercept(destination); destinations.add(newDestination); } if (!destinations.isEmpty()) { if (destinations.size() == 1) { return destinations.get(0); } else { // should rarely be used but here just in case return createCompositeDestination(destination, destinations); } } // check if the destination instead matches any mapped destinations Set mappedDestinations = mappedDestinationMap.get(activeMQDestination); if (!mappedDestinations.isEmpty()) { // create a mapped destination interceptor VirtualDestination virtualDestination = (VirtualDestination) mappedDestinations.toArray(new VirtualDestination[mappedDestinations.size()])[0]; return virtualDestination.interceptMappedDestination(destination); } return destination; }
@Override public Destination intercept(Destination destination) { final ActiveMQDestination activeMQDestination = destination.getActiveMQDestination(); Set matchingDestinations = destinationMap.get(activeMQDestination); List<Destination> destinations = new ArrayList<Destination>(); for (Iterator iter = matchingDestinations.iterator(); iter.hasNext();) { VirtualDestination virtualDestination = (VirtualDestination) iter.next(); Destination newDestination = virtualDestination.intercept(destination); destinations.add(newDestination); } if (!destinations.isEmpty()) { if (destinations.size() == 1) { return destinations.get(0); } else { // should rarely be used but here just in case return createCompositeDestination(destination, destinations); } } // check if the destination instead matches any mapped destinations Set mappedDestinations = mappedDestinationMap.get(activeMQDestination); if (!mappedDestinations.isEmpty()) { // create a mapped destination interceptor VirtualDestination virtualDestination = (VirtualDestination) mappedDestinations.toArray(new VirtualDestination[mappedDestinations.size()])[0]; return virtualDestination.interceptMappedDestination(destination); } return destination; }
@Override public Destination intercept(Destination destination) { final ActiveMQDestination activeMQDestination = destination.getActiveMQDestination(); Set matchingDestinations = destinationMap.get(activeMQDestination); List<Destination> destinations = new ArrayList<Destination>(); for (Iterator iter = matchingDestinations.iterator(); iter.hasNext();) { VirtualDestination virtualDestination = (VirtualDestination) iter.next(); Destination newDestination = virtualDestination.intercept(destination); destinations.add(newDestination); } if (!destinations.isEmpty()) { if (destinations.size() == 1) { return destinations.get(0); } else { // should rarely be used but here just in case return createCompositeDestination(destination, destinations); } } // check if the destination instead matches any mapped destinations Set mappedDestinations = mappedDestinationMap.get(activeMQDestination); if (!mappedDestinations.isEmpty()) { // create a mapped destination interceptor VirtualDestination virtualDestination = (VirtualDestination) mappedDestinations.toArray(new VirtualDestination[mappedDestinations.size()])[0]; return virtualDestination.interceptMappedDestination(destination); } return destination; }