newResourceBundles)
+ {
+ logger.debug("Reloading message bundles ...");
+ String tenantDomain = getTenantDomain();
+ putResourceBundleBaseNames(tenantDomain, newResourceBundles);
+ clearLoadedResourceBundles(tenantDomain); // force re-load of message cache
+ }
+
/**
* Get the messages for a locale.
*
@@ -465,7 +473,7 @@ public class MessageServiceImpl implements MessageService
Set resBundleBaseNames = getResourceBundleBaseNames(tenantDomain, true, false);
int count = 0;
-
+
// load resource bundles for given locale (by tenant, if applicable)
for (String resBundlePath : resBundleBaseNames)
{
@@ -474,24 +482,25 @@ public class MessageServiceImpl implements MessageService
ResourceBundle resourcebundle = null;
int idx1 = resBundlePath.indexOf(StoreRef.URI_FILLER);
-
+
if (idx1 != -1)
{
// load from repository
- int idx2 = resBundlePath.indexOf("/", idx1+3);
+ int idx2 = resBundlePath.indexOf("/", idx1 + 3);
String store = resBundlePath.substring(0, idx2);
String path = resBundlePath.substring(idx2);
StoreRef storeRef = tenantService.getName(new StoreRef(store));
-
+
try
{
resourcebundle = getRepoResourceBundle(storeRef, path, locale);
}
catch (IOException ioe)
{
- throw new AlfrescoRuntimeException("Failed to read message resource bundle from repository " + resBundlePath + " : " + ioe);
+ throw new AlfrescoRuntimeException(
+ "Failed to read message resource bundle from repository " + resBundlePath + " : " + ioe);
}
}
else
@@ -508,13 +517,13 @@ public class MessageServiceImpl implements MessageService
String key = enumKeys.nextElement();
props.put(key, resourcebundle.getString(key));
}
-
+
loadedBundles.add(resBundlePath);
count++;
}
}
}
-
+
logger.info("Message bundles (x " + count + ") loaded for locale " + locale);
}
finally
diff --git a/repository/src/main/resources/alfresco/caches.properties b/repository/src/main/resources/alfresco/caches.properties
index 3d375e06ab..5b009d36b7 100644
--- a/repository/src/main/resources/alfresco/caches.properties
+++ b/repository/src/main/resources/alfresco/caches.properties
@@ -394,7 +394,7 @@ cache.loadedResourceBundlesSharedCache.tx.statsEnabled=${caches.tx.statsEnabled}
cache.loadedResourceBundlesSharedCache.maxItems=1000
cache.loadedResourceBundlesSharedCache.timeToLiveSeconds=0
cache.loadedResourceBundlesSharedCache.maxIdleSeconds=0
-cache.loadedResourceBundlesSharedCache.cluster.type=invalidating
+cache.loadedResourceBundlesSharedCache.cluster.type=local
cache.loadedResourceBundlesSharedCache.backup-count=1
cache.loadedResourceBundlesSharedCache.eviction-policy=LRU
cache.loadedResourceBundlesSharedCache.merge-policy=com.hazelcast.spi.merge.PutIfAbsentMergePolicy
@@ -405,7 +405,7 @@ cache.messagesSharedCache.tx.statsEnabled=${caches.tx.statsEnabled}
cache.messagesSharedCache.maxItems=1000
cache.messagesSharedCache.timeToLiveSeconds=0
cache.messagesSharedCache.maxIdleSeconds=0
-cache.messagesSharedCache.cluster.type=invalidating
+cache.messagesSharedCache.cluster.type=local
cache.messagesSharedCache.backup-count=1
cache.messagesSharedCache.eviction-policy=LRU
cache.messagesSharedCache.merge-policy=com.hazelcast.spi.merge.PutIfAbsentMergePolicy