1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule; |
8 | |
|
9 | |
import org.mule.api.MuleContext; |
10 | |
import org.mule.api.MuleException; |
11 | |
import org.mule.api.agent.Agent; |
12 | |
import org.mule.api.context.MuleContextAware; |
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
public abstract class AbstractAgent implements Agent, MuleContextAware |
19 | |
{ |
20 | |
|
21 | |
protected MuleContext muleContext; |
22 | |
|
23 | |
protected String name; |
24 | |
|
25 | |
protected AbstractAgent(String name) |
26 | 0 | { |
27 | 0 | this.name = name; |
28 | 0 | } |
29 | |
|
30 | |
public final String getName() |
31 | |
{ |
32 | 0 | return name; |
33 | |
} |
34 | |
|
35 | |
public final void setName(String name) |
36 | |
{ |
37 | 0 | this.name = name; |
38 | 0 | } |
39 | |
|
40 | |
public String getDescription() |
41 | |
{ |
42 | 0 | return name; |
43 | |
} |
44 | |
|
45 | |
public void setMuleContext(MuleContext context) |
46 | |
{ |
47 | 0 | this.muleContext = context; |
48 | 0 | } |
49 | |
|
50 | |
|
51 | |
|
52 | |
|
53 | |
protected void unregisterMeQuietly() |
54 | |
{ |
55 | |
try |
56 | |
{ |
57 | |
|
58 | 0 | muleContext.getRegistry().unregisterAgent(this.getName()); |
59 | |
} |
60 | 0 | catch (MuleException e) |
61 | |
{ |
62 | |
|
63 | 0 | } |
64 | 0 | } |
65 | |
} |