1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
package org.mule.lifecycle; |
11 | |
|
12 | |
import org.mule.api.MuleContext; |
13 | |
import org.mule.api.context.notification.ServerNotification; |
14 | |
import org.mule.util.ClassUtils; |
15 | |
|
16 | |
public class LifecycleObject |
17 | |
{ |
18 | |
|
19 | |
private Class type; |
20 | |
private ServerNotification preNotification; |
21 | |
private ServerNotification postNotification; |
22 | |
|
23 | |
public LifecycleObject(Class type) |
24 | 26700 | { |
25 | 26700 | this.type = type; |
26 | 26700 | } |
27 | |
|
28 | |
public ServerNotification getPostNotification() |
29 | |
{ |
30 | 0 | return postNotification; |
31 | |
} |
32 | |
|
33 | |
public void setPostNotification(ServerNotification postNotification) |
34 | |
{ |
35 | 92 | this.postNotification = postNotification; |
36 | 92 | } |
37 | |
|
38 | |
public ServerNotification getPreNotification() |
39 | |
{ |
40 | 0 | return preNotification; |
41 | |
} |
42 | |
|
43 | |
public void setPreNotification(ServerNotification preNotification) |
44 | |
{ |
45 | 92 | this.preNotification = preNotification; |
46 | 92 | } |
47 | |
|
48 | |
public Class getType() |
49 | |
{ |
50 | 15294 | return type; |
51 | |
} |
52 | |
|
53 | |
public void setType(Class type) |
54 | |
{ |
55 | 0 | this.type = type; |
56 | 0 | } |
57 | |
|
58 | |
public void firePreNotification(MuleContext context) |
59 | |
{ |
60 | 1256 | if(preNotification!=null) |
61 | |
{ |
62 | 92 | context.fireNotification(preNotification); |
63 | |
} |
64 | 1256 | } |
65 | |
|
66 | |
public void firePostNotification(MuleContext context) |
67 | |
{ |
68 | 1256 | if(postNotification!=null) |
69 | |
{ |
70 | 92 | context.fireNotification(postNotification); |
71 | |
} |
72 | 1256 | } |
73 | |
|
74 | |
|
75 | |
public String toString() |
76 | |
{ |
77 | 0 | return super.toString() + " (" + ClassUtils.getSimpleName(type) + ")"; |
78 | |
} |
79 | |
|
80 | |
} |