1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 package org.jomc.ri.model;
37
38 import java.lang.ref.Reference;
39 import java.util.HashMap;
40 import java.util.Map;
41 import org.jomc.model.Argument;
42 import org.jomc.model.Arguments;
43 import org.jomc.model.Author;
44 import org.jomc.model.Authors;
45 import org.jomc.model.Dependencies;
46 import org.jomc.model.Dependency;
47 import org.jomc.model.Implementation;
48 import org.jomc.model.ImplementationReference;
49 import org.jomc.model.Implementations;
50 import org.jomc.model.Instance;
51 import org.jomc.model.Instances;
52 import org.jomc.model.Message;
53 import org.jomc.model.MessageReference;
54 import org.jomc.model.Messages;
55 import org.jomc.model.Module;
56 import org.jomc.model.Person;
57 import org.jomc.model.Persons;
58 import org.jomc.model.Properties;
59 import org.jomc.model.Property;
60 import org.jomc.model.PropertyReference;
61 import org.jomc.model.Specification;
62 import org.jomc.model.SpecificationReference;
63 import org.jomc.model.Specifications;
64 import org.jomc.model.Text;
65 import org.jomc.model.Texts;
66 import org.jomc.util.WeakIdentityHashMap;
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88 @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.2.2", comments = "See http://jomc.sourceforge.net/jomc/1.2/jomc-tools-1.2.2" )
89
90
91 public class RuntimeModelObjects
92 {
93
94
95
96 static final Map<ClassLoader, Map<String, Reference<Class<?>>>> classesByClassLoaderAndNameCache =
97 new WeakIdentityHashMap<ClassLoader, Map<String, Reference<Class<?>>>>();
98
99
100 private static final RuntimeModelObjects instance = new RuntimeModelObjects();
101
102
103 static final ClassLoader BOOTSTRAP_CLASSLOADER_KEY = new ClassLoader()
104 {
105 };
106
107
108
109
110
111
112 public static RuntimeModelObjects getInstance()
113 {
114 return instance;
115 }
116
117
118
119
120
121
122
123
124 public PropertyReference copyOf( final PropertyReference o )
125 {
126 return new RuntimePropertyReference( o );
127 }
128
129
130
131
132
133
134
135
136 public ImplementationReference copyOf( final ImplementationReference o )
137 {
138 return new RuntimeImplementationReference( o );
139 }
140
141
142
143
144
145
146
147
148 public Dependencies copyOf( final Dependencies o )
149 {
150 return new RuntimeDependencies( o );
151 }
152
153
154
155
156
157
158
159
160 public Instances copyOf( final Instances o )
161 {
162 return new RuntimeInstances( o );
163 }
164
165
166
167
168
169
170
171
172 public Authors copyOf( final Authors o )
173 {
174 return new RuntimeAuthors( o );
175 }
176
177
178
179
180
181
182
183
184 public Specification copyOf( final Specification o )
185 {
186 return new RuntimeSpecification( o );
187 }
188
189
190
191
192
193
194
195
196 public Message copyOf( final Message o )
197 {
198 return new RuntimeMessage( o );
199 }
200
201
202
203
204
205
206
207
208 public Instance copyOf( final Instance o )
209 {
210 return new RuntimeInstance( o );
211 }
212
213
214
215
216
217
218
219
220 public Implementations copyOf( final Implementations o )
221 {
222 return new RuntimeImplementations( o );
223 }
224
225
226
227
228
229
230
231
232 public Texts copyOf( final Texts o )
233 {
234 return new RuntimeTexts( o );
235 }
236
237
238
239
240
241
242
243
244 public Implementation copyOf( final Implementation o )
245 {
246 return new RuntimeImplementation( o );
247 }
248
249
250
251
252
253
254
255
256 public Module copyOf( final Module o )
257 {
258 return new RuntimeModule( o );
259 }
260
261
262
263
264
265
266
267
268 public Argument copyOf( final Argument o )
269 {
270 return new RuntimeArgument( o );
271 }
272
273
274
275
276
277
278
279
280 public Text copyOf( final Text o )
281 {
282 return new RuntimeText( o );
283 }
284
285
286
287
288
289
290
291
292 public Properties copyOf( final Properties o )
293 {
294 return new RuntimeProperties( o );
295 }
296
297
298
299
300
301
302
303
304 public Person copyOf( final Person o )
305 {
306 return new RuntimePerson( o );
307 }
308
309
310
311
312
313
314
315
316 public SpecificationReference copyOf( final SpecificationReference o )
317 {
318 return new RuntimeSpecificationReference( o );
319 }
320
321
322
323
324
325
326
327
328 public Author copyOf( final Author o )
329 {
330 return new RuntimeAuthor( o );
331 }
332
333
334
335
336
337
338
339
340 public Property copyOf( final Property o )
341 {
342 return new RuntimeProperty( o );
343 }
344
345
346
347
348
349
350
351
352 public Arguments copyOf( final Arguments o )
353 {
354 return new RuntimeArguments( o );
355 }
356
357
358
359
360
361
362
363
364 public Dependency copyOf( final Dependency o )
365 {
366 return new RuntimeDependency( o );
367 }
368
369
370
371
372
373
374
375
376 public Specifications copyOf( final Specifications o )
377 {
378 return new RuntimeSpecifications( o );
379 }
380
381
382
383
384
385
386
387
388 public Messages copyOf( final Messages o )
389 {
390 return new RuntimeMessages( o );
391 }
392
393
394
395
396
397
398
399
400 public Persons copyOf( final Persons o )
401 {
402 return new RuntimePersons( o );
403 }
404
405
406
407
408
409
410
411
412 public MessageReference copyOf( final MessageReference o )
413 {
414 return new RuntimeMessageReference( o );
415 }
416
417
418 public void gc()
419 {
420 synchronized ( classesByClassLoaderAndNameCache )
421 {
422 classesByClassLoaderAndNameCache.size();
423 }
424 synchronized ( RuntimeInstance.assignableFlagsByClassLoaderAndInstanceCache )
425 {
426 RuntimeInstance.assignableFlagsByClassLoaderAndInstanceCache.size();
427 }
428 synchronized ( RuntimeInstance.classesByClassLoaderAndInstanceCache )
429 {
430 RuntimeInstance.classesByClassLoaderAndInstanceCache.size();
431 }
432 synchronized ( RuntimeInstance.constructorsByClassLoaderAndInstanceCache )
433 {
434 RuntimeInstance.constructorsByClassLoaderAndInstanceCache.size();
435 }
436 synchronized ( RuntimeInstance.methodsByClassLoaderAndInstanceCache )
437 {
438 RuntimeInstance.methodsByClassLoaderAndInstanceCache.size();
439 }
440 synchronized ( RuntimeInstance.proxyClassesByClassLoaderAndInstanceCache )
441 {
442 RuntimeInstance.proxyClassesByClassLoaderAndInstanceCache.size();
443 }
444 }
445
446
447 public void clear()
448 {
449 synchronized ( classesByClassLoaderAndNameCache )
450 {
451 classesByClassLoaderAndNameCache.clear();
452 }
453 synchronized ( RuntimeInstance.assignableFlagsByClassLoaderAndInstanceCache )
454 {
455 RuntimeInstance.assignableFlagsByClassLoaderAndInstanceCache.clear();
456 }
457 synchronized ( RuntimeInstance.classesByClassLoaderAndInstanceCache )
458 {
459 RuntimeInstance.classesByClassLoaderAndInstanceCache.clear();
460 }
461 synchronized ( RuntimeInstance.constructorsByClassLoaderAndInstanceCache )
462 {
463 RuntimeInstance.constructorsByClassLoaderAndInstanceCache.clear();
464 }
465 synchronized ( RuntimeInstance.methodsByClassLoaderAndInstanceCache )
466 {
467 RuntimeInstance.methodsByClassLoaderAndInstanceCache.clear();
468 }
469 synchronized ( RuntimeInstance.proxyClassesByClassLoaderAndInstanceCache )
470 {
471 RuntimeInstance.proxyClassesByClassLoaderAndInstanceCache.clear();
472 }
473 }
474
475
476
477
478
479
480
481
482
483 static <K, V> Map<K, V> createMap()
484 {
485 return new HashMap<K, V>( 128 );
486 }
487
488
489
490
491
492 @javax.annotation.Generated( value = "org.jomc.tools.SourceFileProcessor 1.2.2", comments = "See http://jomc.sourceforge.net/jomc/1.2/jomc-tools-1.2.2" )
493 public RuntimeModelObjects()
494 {
495
496 super();
497
498 }
499
500
501
502
503
504
505
506
507 }