Added re-caching VC at closing-index service, resolved #44

Change-Id: I72bc0980da63f64f50b9bf92787550a9401fd1c3
diff --git a/core/Changes b/core/Changes
index 52ad813..62aa351 100644
--- a/core/Changes
+++ b/core/Changes
@@ -6,7 +6,9 @@
 25/04/2019
    - Updated Jetty version due to vulnerabilities (margaretha)
 27/06/2019
-   - Updated Jetty version, fixed server hanging problem (margaretha)  
+   - Updated Jetty version, fixed server hanging problem (margaretha)
+03/07/2019
+   - Added VCLoader interface (margaretha)
 
 # version 0.61.6
 06/02/2019
diff --git a/core/src/main/java/de/ids_mannheim/de/init/VCLoader.java b/core/src/main/java/de/ids_mannheim/de/init/VCLoader.java
new file mode 100644
index 0000000..5c19d97
--- /dev/null
+++ b/core/src/main/java/de/ids_mannheim/de/init/VCLoader.java
@@ -0,0 +1,6 @@
+package de.ids_mannheim.de.init;
+
+public interface VCLoader {
+
+    void recachePredefinedVC();
+}
diff --git a/core/src/main/java/de/ids_mannheim/korap/service/SearchService.java b/core/src/main/java/de/ids_mannheim/korap/service/SearchService.java
index 9d2ef02..5d3953f 100644
--- a/core/src/main/java/de/ids_mannheim/korap/service/SearchService.java
+++ b/core/src/main/java/de/ids_mannheim/korap/service/SearchService.java
@@ -18,6 +18,7 @@
 
 import com.sun.jersey.core.util.MultivaluedMapImpl;
 
+import de.ids_mannheim.de.init.VCLoader;
 import de.ids_mannheim.korap.authentication.AuthenticationManager;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
@@ -39,7 +40,8 @@
 
     @Autowired
     private KustvaktConfiguration config;
-
+    @Autowired
+    private VCLoader vcLoader;
     @Autowired
     private AuthenticationManager authenticationManager;
 
@@ -291,6 +293,7 @@
         if (token != null && !token.isEmpty()
                 && token.equals(context.getInitParameter("adminToken"))) {
             searchKrill.closeIndexReader();
+            vcLoader.recachePredefinedVC();
         }
         else {
             throw new KustvaktException(StatusCodes.INCORRECT_ADMIN_TOKEN,