Factory method to create (if necessary) and return our Registry instance. @param key Unused @param guard Prevent access to the registry by untrusted components @return the registry @since 1.1
(Object key, Object guard)
| 114 | * @since 1.1 |
| 115 | */ |
| 116 | public static synchronized Registry getRegistry(Object key, Object guard) { |
| 117 | if (registry == null) { |
| 118 | registry = new Registry(); |
| 119 | registry.guard = guard; |
| 120 | } |
| 121 | if (registry.guard != null && registry.guard != guard) { |
| 122 | return null; |
| 123 | } |
| 124 | return registry; |
| 125 | } |
| 126 | |
| 127 | |
| 128 | /** |