Fixes #4 - update ReloadingVFSContextClassLoaderFactory for upstream interface changes (#5)

* Fixes #4 - update ReloadingVFSContextClassLoaderFactory for upstream interface changes
diff --git a/modules/vfs-class-loader/src/main/java/org/apache/accumulo/classloader/vfs/context/ReloadingVFSContextClassLoaderFactory.java b/modules/vfs-class-loader/src/main/java/org/apache/accumulo/classloader/vfs/context/ReloadingVFSContextClassLoaderFactory.java
index 9f73078..f5bebcc 100644
--- a/modules/vfs-class-loader/src/main/java/org/apache/accumulo/classloader/vfs/context/ReloadingVFSContextClassLoaderFactory.java
+++ b/modules/vfs-class-loader/src/main/java/org/apache/accumulo/classloader/vfs/context/ReloadingVFSContextClassLoaderFactory.java
@@ -19,7 +19,9 @@
 package org.apache.accumulo.classloader.vfs.context;
 
 import java.io.File;
+import java.io.IOException;
 import java.net.URI;
+import java.net.URISyntaxException;
 import java.nio.file.Files;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
@@ -28,7 +30,6 @@
 import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.accumulo.classloader.vfs.AccumuloVFSClassLoader;
-import org.apache.accumulo.core.client.PluginEnvironment.Configuration;
 import org.apache.accumulo.core.spi.common.ContextClassLoaderFactory;
 import org.apache.commons.io.FileUtils;
 import org.slf4j.Logger;
@@ -245,6 +246,14 @@
   private static final Map<String,AccumuloVFSClassLoader> CONTEXTS = new ConcurrentHashMap<>();
   private Contexts contextDefinitions = null;
 
+  public ReloadingVFSContextClassLoaderFactory() {
+    try {
+      initializeContexts();
+    } catch (URISyntaxException | IOException e) {
+      throw new RuntimeException("Error initializing contexts", e);
+    }
+  }
+
   protected String getConfigFileLocation() {
     String loc = System.getProperty(CONFIG_LOCATION);
     if (null == loc || loc.isBlank()) {
@@ -254,8 +263,10 @@
     return loc;
   }
 
-  @Override
-  public void initialize(Configuration contextProperties) throws Exception {
+  private void initializeContexts() throws URISyntaxException, IOException {
+    if (!CONTEXTS.isEmpty()) {
+      LOG.debug("Contexts already initialized, skipping...");
+    }
     // Properties
     String conf = getConfigFileLocation();
     File f = new File(new URI(conf));
diff --git a/modules/vfs-class-loader/src/test/java/org/apache/accumulo/classloader/vfs/context/ReloadingVFSContextClassLoaderFactoryTest.java b/modules/vfs-class-loader/src/test/java/org/apache/accumulo/classloader/vfs/context/ReloadingVFSContextClassLoaderFactoryTest.java
index 302b9b6..034cf8b 100644
--- a/modules/vfs-class-loader/src/test/java/org/apache/accumulo/classloader/vfs/context/ReloadingVFSContextClassLoaderFactoryTest.java
+++ b/modules/vfs-class-loader/src/test/java/org/apache/accumulo/classloader/vfs/context/ReloadingVFSContextClassLoaderFactoryTest.java
@@ -176,7 +176,6 @@
         return f.toURI().toString();
       }
     };
-    cl.initialize(null);
     try {
       cl.getClassLoader("c1");
       fail("Expected illegal argument exception");
@@ -213,7 +212,6 @@
             return f.toURI().toString();
           }
         };
-    factory.initialize(null);
 
     ClassLoader cl1 = factory.getClassLoader("cx1");
     Class<?> clazz1 = cl1.loadClass("test.HelloWorld");