1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package fulmine.context;
17
18 import fulmine.IDomain;
19 import fulmine.IType;
20 import fulmine.event.listener.IEventListener;
21 import fulmine.event.subscription.SubscriptionParameters;
22
23
24
25
26
27
28
29
30
31 public class FTDistributionManager extends DistributionManager
32 {
33
34
35 private final FTContext ftContext;
36
37 public FTDistributionManager(IFrameworkContext context, FTContext ftContext)
38 {
39 super(context);
40 this.ftContext = ftContext;
41 }
42
43 @Override
44 public boolean subscribe(String contextIdentity, String identityRegex,
45 IType type, IDomain domain, IEventListener listener)
46 {
47 if (this.ftContext.isFTContextActive())
48 {
49 return super.subscribe(contextIdentity, identityRegex, type,
50 domain, listener);
51 }
52 return super.doRemoteSubscribe(contextIdentity,
53 new SubscriptionParameters(identityRegex, type, domain), listener);
54 }
55
56 @Override
57 public boolean unsubscribe(String contextIdentity, String identityRegex,
58 IType type, IDomain domain, IEventListener listener)
59 {
60 if (this.ftContext.isFTContextActive())
61 {
62 return super.unsubscribe(contextIdentity, identityRegex, type,
63 domain, listener);
64 }
65 return super.doRemoteUnsubscribe(contextIdentity,
66 new SubscriptionParameters(identityRegex, type, domain), listener);
67 }
68
69 }