1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.registry.impl; |
12 | |
|
13 | |
import org.mule.registry.Entry; |
14 | |
import org.mule.registry.Registry; |
15 | |
import org.mule.registry.RegistryException; |
16 | |
|
17 | |
import java.io.IOException; |
18 | |
import java.io.Serializable; |
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
public abstract class AbstractEntry implements Entry, Serializable |
24 | |
{ |
25 | |
|
26 | |
protected transient String currentState; |
27 | |
protected String name; |
28 | |
protected String installRoot; |
29 | |
protected String stateAtShutdown; |
30 | |
protected transient Registry registry; |
31 | |
|
32 | |
protected AbstractEntry(Registry registry) |
33 | 0 | { |
34 | 0 | this.currentState = UNKNOWN; |
35 | 0 | this.stateAtShutdown = UNKNOWN; |
36 | 0 | this.registry = registry; |
37 | 0 | } |
38 | |
|
39 | |
protected void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException |
40 | |
{ |
41 | 0 | in.defaultReadObject(); |
42 | 0 | this.currentState = UNKNOWN; |
43 | 0 | } |
44 | |
|
45 | |
|
46 | |
|
47 | |
|
48 | |
|
49 | |
|
50 | |
public String getName() |
51 | |
{ |
52 | 0 | return this.name; |
53 | |
} |
54 | |
|
55 | |
|
56 | |
|
57 | |
|
58 | |
|
59 | |
|
60 | |
public String getInstallRoot() |
61 | |
{ |
62 | 0 | return this.installRoot; |
63 | |
} |
64 | |
|
65 | |
|
66 | |
|
67 | |
|
68 | |
|
69 | |
|
70 | |
public synchronized String getCurrentState() |
71 | |
{ |
72 | 0 | return this.currentState; |
73 | |
} |
74 | |
|
75 | |
|
76 | |
|
77 | |
|
78 | |
|
79 | |
|
80 | |
public String getStateAtShutdown() |
81 | |
{ |
82 | 0 | return this.stateAtShutdown; |
83 | |
} |
84 | |
|
85 | |
public void setCurrentState(String currentState) throws RegistryException |
86 | |
{ |
87 | 0 | this.currentState = currentState; |
88 | 0 | getRegistry().save(); |
89 | 0 | } |
90 | |
|
91 | |
|
92 | |
|
93 | |
|
94 | |
|
95 | |
|
96 | |
public void setInstallRoot(String installRoot) |
97 | |
{ |
98 | 0 | this.installRoot = installRoot; |
99 | 0 | } |
100 | |
|
101 | |
public void setName(String name) |
102 | |
{ |
103 | 0 | this.name = name; |
104 | 0 | } |
105 | |
|
106 | |
public void setStateAtShutdown(String statusAtShutdown) |
107 | |
{ |
108 | 0 | this.stateAtShutdown = statusAtShutdown; |
109 | 0 | } |
110 | |
|
111 | |
public Registry getRegistry() |
112 | |
{ |
113 | 0 | return registry; |
114 | |
} |
115 | |
|
116 | |
public void setRegistry(Registry registry) |
117 | |
{ |
118 | 0 | this.registry = registry; |
119 | 0 | } |
120 | |
|
121 | |
protected void checkDescriptor() throws RegistryException |
122 | |
{ |
123 | |
|
124 | 0 | } |
125 | |
|
126 | |
} |