1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.context.notification; |
12 | |
|
13 | |
import org.mule.api.context.notification.ServerNotification; |
14 | |
import org.mule.routing.filters.WildcardFilter; |
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
class Sender |
22 | |
{ |
23 | |
|
24 | |
private ListenerSubscriptionPair pair; |
25 | |
private WildcardFilter subscriptionFilter; |
26 | |
|
27 | |
Sender(ListenerSubscriptionPair pair) |
28 | 66 | { |
29 | 66 | this.pair = pair; |
30 | 66 | subscriptionFilter = new WildcardFilter(pair.getSubscription()); |
31 | 66 | subscriptionFilter.setCaseSensitive(false); |
32 | 66 | } |
33 | |
|
34 | |
public void dispatch(ServerNotification notification) |
35 | |
{ |
36 | 144 | if (pair.isNullSubscription() || |
37 | |
(null != notification.getResourceIdentifier() && |
38 | |
subscriptionFilter.accept(notification.getResourceIdentifier()))) |
39 | |
{ |
40 | 124 | pair.getListener().onNotification(notification); |
41 | |
} |
42 | 144 | } |
43 | |
|
44 | |
} |
45 | |
|