1
2
3
4
5 package org.apache.maven.plugin.registry;
6
7
8
9
10
11 import java.util.Date;
12
13
14
15
16
17
18 public class PluginRegistry extends TrackableBase
19 implements java.io.Serializable
20 {
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 private String updateInterval = "never";
41
42
43
44
45
46 private String autoUpdate;
47
48
49
50
51 private String checkLatest;
52
53
54
55
56 private java.util.List plugins;
57
58
59
60
61
62
63
64
65
66
67
68 public void addPlugin( Plugin plugin )
69 {
70 if ( !(plugin instanceof Plugin) )
71 {
72 throw new ClassCastException( "PluginRegistry.addPlugins(plugin) parameter must be instanceof " + Plugin.class.getName() );
73 }
74 getPlugins().add( plugin );
75 }
76
77
78
79
80
81
82
83 public String getAutoUpdate()
84 {
85 return this.autoUpdate;
86 }
87
88
89
90
91
92
93
94 public String getCheckLatest()
95 {
96 return this.checkLatest;
97 }
98
99
100
101
102
103
104 public java.util.List getPlugins()
105 {
106 if ( this.plugins == null )
107 {
108 this.plugins = new java.util.ArrayList();
109 }
110
111 return this.plugins;
112 }
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129 public String getUpdateInterval()
130 {
131 return this.updateInterval;
132 }
133
134
135
136
137
138
139 public void removePlugin( Plugin plugin )
140 {
141 if ( !(plugin instanceof Plugin) )
142 {
143 throw new ClassCastException( "PluginRegistry.removePlugins(plugin) parameter must be instanceof " + Plugin.class.getName() );
144 }
145 getPlugins().remove( plugin );
146 }
147
148
149
150
151
152
153
154 public void setAutoUpdate( String autoUpdate )
155 {
156 this.autoUpdate = autoUpdate;
157 }
158
159
160
161
162
163
164
165 public void setCheckLatest( String checkLatest )
166 {
167 this.checkLatest = checkLatest;
168 }
169
170
171
172
173
174
175 public void setPlugins( java.util.List plugins )
176 {
177 this.plugins = plugins;
178 }
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195 public void setUpdateInterval( String updateInterval )
196 {
197 this.updateInterval = updateInterval;
198 }
199
200
201 private java.util.Map pluginsByKey;
202
203 public java.util.Map getPluginsByKey()
204 {
205 if ( pluginsByKey == null )
206 {
207 pluginsByKey = new java.util.HashMap();
208
209 for ( java.util.Iterator it = getPlugins().iterator(); it.hasNext(); )
210 {
211 Plugin plugin = (Plugin) it.next();
212
213 pluginsByKey.put( plugin.getKey(), plugin );
214 }
215 }
216
217 return pluginsByKey;
218 }
219
220 public void flushPluginsByKey()
221 {
222 this.pluginsByKey = null;
223 }
224
225 private RuntimeInfo runtimeInfo;
226
227 public void setRuntimeInfo( RuntimeInfo runtimeInfo )
228 {
229 this.runtimeInfo = runtimeInfo;
230 }
231
232 public RuntimeInfo getRuntimeInfo()
233 {
234 return runtimeInfo;
235 }
236
237 private String modelEncoding = "UTF-8";
238
239
240
241
242
243
244 public void setModelEncoding( String modelEncoding )
245 {
246 this.modelEncoding = modelEncoding;
247 }
248
249
250
251
252 public String getModelEncoding()
253 {
254 return modelEncoding;
255 }
256 }