home *** CD-ROM | disk | FTP | other *** search
- package java.security;
-
- import java.io.IOException;
- import java.io.InputStream;
- import java.util.Collection;
- import java.util.Collections;
- import java.util.Map;
- import java.util.Properties;
- import java.util.Set;
-
- public abstract class Provider extends Properties {
- private String name;
- private String info;
- private double version;
- private transient Set entrySet;
- private transient int entrySetCallCount;
- static final long serialVersionUID = -4298000515446427739L;
-
- protected Provider(String var1, double var2, String var4) {
- this.entrySet = null;
- this.entrySetCallCount = 0;
- this.name = var1;
- this.version = var2;
- this.info = var4;
- }
-
- Provider(String var1) {
- this(var1, (double)1.0F, "no information available");
- }
-
- public String getName() {
- return this.name;
- }
-
- public double getVersion() {
- return this.version;
- }
-
- public String getInfo() {
- return this.info;
- }
-
- static Provider loadProvider(String var0) {
- try {
- ClassLoader var1 = ClassLoader.getSystemClassLoader();
- Class var2;
- if (var1 != null) {
- var2 = var1.loadClass(var0);
- } else {
- var2 = Class.forName(var0);
- }
-
- Object var3 = var2.newInstance();
- if (var3 instanceof Provider) {
- return (Provider)var3;
- }
-
- debug(var0 + " not a provider");
- } catch (Exception var4) {
- debug("error loading provider " + var0, var4);
- }
-
- return null;
- }
-
- public String toString() {
- return this.name + " version " + this.version;
- }
-
- public synchronized void clear() {
- check("clearProviderProperties." + this.name);
- super.clear();
- }
-
- public synchronized void load(InputStream var1) throws IOException {
- check("loadProviderProperties." + this.name);
- super.load(var1);
- }
-
- public synchronized void putAll(Map var1) {
- check("putAllProviderProperties." + this.name);
- super.putAll(var1);
- }
-
- public synchronized Set entrySet() {
- if (this.entrySet == null) {
- if (this.entrySetCallCount++ != 0) {
- return super.entrySet();
- }
-
- this.entrySet = Collections.unmodifiableMap(this).entrySet();
- }
-
- if (this.entrySetCallCount != 2) {
- throw new RuntimeException("Internal error.");
- } else {
- return this.entrySet;
- }
- }
-
- public Set keySet() {
- return Collections.unmodifiableSet(super.keySet());
- }
-
- public Collection values() {
- return Collections.unmodifiableCollection(super.values());
- }
-
- public synchronized Object put(Object var1, Object var2) {
- check("putProviderProperty." + this.name);
- return super.put(var1, var2);
- }
-
- public synchronized Object remove(Object var1) {
- check("removeProviderProperty." + this.name);
- return super.remove(var1);
- }
-
- private static void check(String var0) {
- SecurityManager var1 = System.getSecurityManager();
- if (var1 != null) {
- var1.checkSecurityAccess(var0);
- }
-
- }
-
- private static void debug(String var0) {
- Security.debug(var0);
- }
-
- private static void debug(String var0, Throwable var1) {
- Security.debug(var0, var1);
- }
- }
-