1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.config.spring; |
12 | |
|
13 | |
import org.mule.api.MuleContext; |
14 | |
import org.mule.api.context.MuleContextAware; |
15 | |
import org.mule.context.notification.ServerNotificationManager; |
16 | |
|
17 | |
import java.util.Collection; |
18 | |
import java.util.Map; |
19 | |
|
20 | |
import org.springframework.beans.factory.SmartFactoryBean; |
21 | |
|
22 | 0 | public class ServerNotificationManagerConfigurator implements MuleContextAware, SmartFactoryBean |
23 | |
{ |
24 | |
|
25 | |
private MuleContext muleContext; |
26 | |
|
27 | |
private Boolean dynamic; |
28 | |
private Map interfaceToEvents; |
29 | |
private Collection interfaces; |
30 | |
private Collection pairs; |
31 | |
|
32 | |
public void setMuleContext(MuleContext context) |
33 | |
{ |
34 | 0 | this.muleContext = context; |
35 | 0 | } |
36 | |
|
37 | |
public Object getObject() throws Exception |
38 | |
{ |
39 | 0 | ServerNotificationManager notificationManager = muleContext.getNotificationManager(); |
40 | 0 | if (dynamic != null) |
41 | |
{ |
42 | 0 | notificationManager.setNotificationDynamic(dynamic.booleanValue()); |
43 | |
} |
44 | 0 | if (interfaceToEvents != null) |
45 | |
{ |
46 | 0 | notificationManager.setInterfaceToTypes(interfaceToEvents); |
47 | |
} |
48 | 0 | if (interfaces != null) |
49 | |
{ |
50 | 0 | notificationManager.setDisabledInterfaces(interfaces); |
51 | |
} |
52 | 0 | if (pairs != null) |
53 | |
{ |
54 | 0 | notificationManager.setAllListenerSubscriptionPairs(pairs); |
55 | |
} |
56 | 0 | return notificationManager; |
57 | |
} |
58 | |
|
59 | |
public Class getObjectType() |
60 | |
{ |
61 | 0 | return ServerNotificationManager.class; |
62 | |
} |
63 | |
|
64 | |
public boolean isSingleton() |
65 | |
{ |
66 | 0 | return true; |
67 | |
} |
68 | |
|
69 | |
public void setNotificationDynamic(boolean dynamic) |
70 | |
{ |
71 | 0 | this.dynamic = new Boolean(dynamic); |
72 | 0 | } |
73 | |
|
74 | |
public void setInterfaceToTypes(Map interfaceToEvents) throws ClassNotFoundException |
75 | |
{ |
76 | 0 | this.interfaceToEvents = interfaceToEvents; |
77 | 0 | } |
78 | |
|
79 | |
public void setAllListenerSubscriptionPairs(Collection pairs) |
80 | |
{ |
81 | 0 | this.pairs = pairs; |
82 | 0 | } |
83 | |
|
84 | |
public void setDisabledInterfaces(Collection interfaces) throws ClassNotFoundException |
85 | |
{ |
86 | 0 | this.interfaces = interfaces; |
87 | 0 | } |
88 | |
|
89 | |
public boolean isEagerInit() |
90 | |
{ |
91 | 0 | return true; |
92 | |
} |
93 | |
|
94 | |
public boolean isPrototype() |
95 | |
{ |
96 | 0 | return false; |
97 | |
} |
98 | |
|
99 | |
} |