public List<InternalEndpoint> getMatchingSubscriptionEndpoints(MessageExchangeImpl exchange) {
List<InternalEndpoint> result = null;
for (Iterator iter = subscriptions.entrySet().iterator(); iter.hasNext();) {
Map.Entry entry = (Map.Entry) iter.next();
SubscriptionSpec subscription = (SubscriptionSpec) entry.getKey();
if (subscription.matches(registry, exchange)) {
if (result == null) {
result = new ArrayList<InternalEndpoint>();
}
InternalEndpoint endpoint = (InternalEndpoint) entry.getValue();
result.add(endpoint);