Commits

Sebastian Sdorra committed 2bc9a61

improve SCMContextProvider

  • Participants
  • Parent commits 80915d2

Comments (0)

Files changed (3)

File scm-core/src/main/java/sonia/scm/BasicContextProvider.java

 //~--- JDK imports ------------------------------------------------------------
 
 import java.io.File;
+import java.io.IOException;
 
 import java.util.HashMap;
 import java.util.List;
   /**
    * Method description
    *
+   *
+   * @throws IOException
    */
+  @Override
+  public void close() throws IOException
+  {
+    for (GroupManager manager : groupManagerMap.values())
+    {
+      manager.close();
+    }
+
+    for (RepositoryManager manager : repositoryManagerMap.values())
+    {
+      manager.close();
+    }
+  }
+
+  /**
+   * Method description
+   *
+   */
+  @Override
   public void init()
   {
     loadGroupManagers();

File scm-core/src/main/java/sonia/scm/SCMContext.java

           {
             provider = new BasicContextProvider();
           }
+
+          provider.init();
         }
       }
     }

File scm-core/src/main/java/sonia/scm/SCMContextProvider.java

 
 //~--- JDK imports ------------------------------------------------------------
 
+import java.io.Closeable;
 import java.io.File;
 
 /**
  *
  * @author Sebastian Sdorra
  */
-public interface SCMContextProvider
+public interface SCMContextProvider extends Closeable
 {
 
   /**
    * Method description
    *
+   */
+  public void init();
+
+  //~--- get methods ----------------------------------------------------------
+
+  /**
+   * Method description
+   *
    *
    * @return
    */