[Yanel-commits] rev 55905 - public/yanel/trunk/src/core/java/org/wyona/yanel/core/map

michi at wyona.com michi at wyona.com
Sun Jan 9 16:19:32 CET 2011


Author: michi
Date: 2011-01-09 16:19:32 +0100 (Sun, 09 Jan 2011)
New Revision: 55905

Modified:
   public/yanel/trunk/src/core/java/org/wyona/yanel/core/map/RealmDefaultImpl.java
Log:
add prefix to extra repositories

Modified: public/yanel/trunk/src/core/java/org/wyona/yanel/core/map/RealmDefaultImpl.java
===================================================================
--- public/yanel/trunk/src/core/java/org/wyona/yanel/core/map/RealmDefaultImpl.java	2011-01-09 15:05:06 UTC (rev 55904)
+++ public/yanel/trunk/src/core/java/org/wyona/yanel/core/map/RealmDefaultImpl.java	2011-01-09 15:19:32 UTC (rev 55905)
@@ -218,8 +218,8 @@
                 String id = repoElements[i].getAttribute("id");
                 String repoConfigPath = repoElements[i].getAttribute("config");
                 repoConfig = FileUtil.resolve(getConfigFile(), new File(repoConfigPath));
-                if (!extraRepoFactory.exists(id)) {
-                    extraRepoFactory.newRepository(id, repoConfig);
+                if (!extraRepoFactory.exists(getID() + "_" + id)) {
+                    extraRepoFactory.newRepository(getID() + "_" + id, repoConfig);
                 } else {
                     log.error("Extra repository with ID '" + id + "' already exists (Realm ID: '" + getID() + "')!");
                 }
@@ -492,8 +492,8 @@
         } else {
             Yanel yanel = Yanel.getInstance();
             RepositoryFactory extraRepoFactory = yanel.getRepositoryFactory(EXTRA_REPOSITORY_FACTORY_BEAN_ID);
-            if (extraRepoFactory.exists(id)) {
-                return extraRepoFactory.newRepository(id);
+            if (extraRepoFactory.exists(getID() + "_" + id)) {
+                return extraRepoFactory.newRepository(getID() + "_" + id);
             } else {
                 log.warn("No such extra repository: " + id + " (Realm: " + getID() + ")");
             } 
@@ -514,11 +514,14 @@
      * Destroy/shutdown realm
      */
     public void destroy() throws Exception {
-        log.warn("Shutdown realm: " + getName());
+        log.warn("Shutdown realm (and its repositories): " + getName());
+
         repository.close();
         rtiRepository.close();
         identitiesRepository.close();
         policiesRepository.close();
+
+        // TODO: Close extra repositories
     }
 
     /**



More information about the Yanel-commits mailing list