1 package com.sslexplorer.setup; 2 3 import java.util.ArrayList ; 4 import java.util.HashMap ; 5 import java.util.List ; 6 7 public class SystemInformationRegistry { 8 9 private static SystemInformationRegistry instance; 10 private HashMap providers = new HashMap (); 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 getProviders() { 26 return new ArrayList (providers.values()); 27 } 28 29 30 31 } 32 | Popular Tags |