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