Revision 45321
Added by Claudio Atzori over 7 years ago
ExistTriggerRegistry.java | ||
---|---|---|
7 | 7 |
|
8 | 8 |
/** |
9 | 9 |
* eXist triggers are instantiated directly by the exist database via reflection. |
10 |
*
|
|
10 |
* |
|
11 | 11 |
* we need a way to manage trigger objects from outside, in order to manage them manage them from the IoC container. |
12 |
*
|
|
12 |
* |
|
13 | 13 |
* @author marko |
14 | 14 |
* |
15 | 15 |
*/ |
16 | 16 |
public final class ExistTriggerRegistry { |
17 |
|
|
17 |
|
|
18 | 18 |
/** |
19 | 19 |
* singleton object. |
20 | 20 |
*/ |
21 | 21 |
private static ExistTriggerRegistry singleton = new ExistTriggerRegistry(); |
22 |
|
|
22 |
|
|
23 | 23 |
/** |
24 | 24 |
* get the singleton instance. |
25 |
*
|
|
25 |
* |
|
26 | 26 |
* @return singleton object |
27 | 27 |
*/ |
28 | 28 |
public static ExistTriggerRegistry defaultInstance() { |
29 | 29 |
return singleton; |
30 | 30 |
} |
31 |
|
|
31 |
|
|
32 | 32 |
/** |
33 | 33 |
* forbids instantiation. |
34 | 34 |
*/ |
... | ... | |
39 | 39 |
* maps trigger names to trigger instances. |
40 | 40 |
*/ |
41 | 41 |
private Map<String, Trigger> triggerRegistry = new HashMap<String, Trigger>(); |
42 |
|
|
42 |
|
|
43 | 43 |
/** |
44 | 44 |
* get a trigger for a given id. |
45 |
*
|
|
45 |
* |
|
46 | 46 |
* @param triggerId trigger identifier |
47 | 47 |
* @return trigger instance |
48 | 48 |
*/ |
... | ... | |
52 | 52 |
|
53 | 53 |
/** |
54 | 54 |
* associate a new trigger. |
55 |
*
|
|
55 |
* |
|
56 | 56 |
* @param name trigger name |
57 | 57 |
* @param trigger trigger instance |
58 | 58 |
*/ |
... | ... | |
67 | 67 |
void setTriggerRegistry(final Map<String, Trigger> triggerRegistry) { |
68 | 68 |
this.triggerRegistry = triggerRegistry; |
69 | 69 |
} |
70 |
|
|
71 |
|
|
70 |
|
|
71 |
|
|
72 | 72 |
} |
Also available in: Unified diff
migrated to dnet45