home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / java / security / Provider.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  3.1 KB  |  135 lines

  1. package java.security;
  2.  
  3. import java.io.IOException;
  4. import java.io.InputStream;
  5. import java.util.Collection;
  6. import java.util.Collections;
  7. import java.util.Map;
  8. import java.util.Properties;
  9. import java.util.Set;
  10.  
  11. public abstract class Provider extends Properties {
  12.    private String name;
  13.    private String info;
  14.    private double version;
  15.    private transient Set entrySet;
  16.    private transient int entrySetCallCount;
  17.    static final long serialVersionUID = -4298000515446427739L;
  18.  
  19.    protected Provider(String var1, double var2, String var4) {
  20.       this.entrySet = null;
  21.       this.entrySetCallCount = 0;
  22.       this.name = var1;
  23.       this.version = var2;
  24.       this.info = var4;
  25.    }
  26.  
  27.    Provider(String var1) {
  28.       this(var1, (double)1.0F, "no information available");
  29.    }
  30.  
  31.    public String getName() {
  32.       return this.name;
  33.    }
  34.  
  35.    public double getVersion() {
  36.       return this.version;
  37.    }
  38.  
  39.    public String getInfo() {
  40.       return this.info;
  41.    }
  42.  
  43.    static Provider loadProvider(String var0) {
  44.       try {
  45.          ClassLoader var1 = ClassLoader.getSystemClassLoader();
  46.          Class var2;
  47.          if (var1 != null) {
  48.             var2 = var1.loadClass(var0);
  49.          } else {
  50.             var2 = Class.forName(var0);
  51.          }
  52.  
  53.          Object var3 = var2.newInstance();
  54.          if (var3 instanceof Provider) {
  55.             return (Provider)var3;
  56.          }
  57.  
  58.          debug(var0 + " not a provider");
  59.       } catch (Exception var4) {
  60.          debug("error loading provider " + var0, var4);
  61.       }
  62.  
  63.       return null;
  64.    }
  65.  
  66.    public String toString() {
  67.       return this.name + " version " + this.version;
  68.    }
  69.  
  70.    public synchronized void clear() {
  71.       check("clearProviderProperties." + this.name);
  72.       super.clear();
  73.    }
  74.  
  75.    public synchronized void load(InputStream var1) throws IOException {
  76.       check("loadProviderProperties." + this.name);
  77.       super.load(var1);
  78.    }
  79.  
  80.    public synchronized void putAll(Map var1) {
  81.       check("putAllProviderProperties." + this.name);
  82.       super.putAll(var1);
  83.    }
  84.  
  85.    public synchronized Set entrySet() {
  86.       if (this.entrySet == null) {
  87.          if (this.entrySetCallCount++ != 0) {
  88.             return super.entrySet();
  89.          }
  90.  
  91.          this.entrySet = Collections.unmodifiableMap(this).entrySet();
  92.       }
  93.  
  94.       if (this.entrySetCallCount != 2) {
  95.          throw new RuntimeException("Internal error.");
  96.       } else {
  97.          return this.entrySet;
  98.       }
  99.    }
  100.  
  101.    public Set keySet() {
  102.       return Collections.unmodifiableSet(super.keySet());
  103.    }
  104.  
  105.    public Collection values() {
  106.       return Collections.unmodifiableCollection(super.values());
  107.    }
  108.  
  109.    public synchronized Object put(Object var1, Object var2) {
  110.       check("putProviderProperty." + this.name);
  111.       return super.put(var1, var2);
  112.    }
  113.  
  114.    public synchronized Object remove(Object var1) {
  115.       check("removeProviderProperty." + this.name);
  116.       return super.remove(var1);
  117.    }
  118.  
  119.    private static void check(String var0) {
  120.       SecurityManager var1 = System.getSecurityManager();
  121.       if (var1 != null) {
  122.          var1.checkSecurityAccess(var0);
  123.       }
  124.  
  125.    }
  126.  
  127.    private static void debug(String var0) {
  128.       Security.debug(var0);
  129.    }
  130.  
  131.    private static void debug(String var0, Throwable var1) {
  132.       Security.debug(var0, var1);
  133.    }
  134. }
  135.