KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > setup > SystemInformationRegistry


1 package com.sslexplorer.setup;
2
3 import java.util.ArrayList JavaDoc;
4 import java.util.HashMap JavaDoc;
5 import java.util.List JavaDoc;
6
7 public class SystemInformationRegistry {
8
9     private static SystemInformationRegistry instance;
10     private HashMap JavaDoc providers = new HashMap JavaDoc();
11     
12     public static SystemInformationRegistry getInstance() {
13         return instance == null ? instance = new SystemInformationRegistry() : instance;
14     }
15     
16     
17     public synchronized void registerProvider(SystemInformationProvider provider) {
18         providers.put(provider.getName(), provider);
19     }
20     
21     public synchronized void unregisterProvider(SystemInformationProvider provider) {
22         providers.remove(provider.getName());
23     }
24     
25     public List JavaDoc getProviders() {
26         return new ArrayList JavaDoc(providers.values());
27     }
28     
29     
30     
31 }
32
Popular Tags