summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/com/c2kernel/persistency/ClusterStorageManager.java19
-rw-r--r--source/com/c2kernel/persistency/TransactionManager.java6
2 files changed, 21 insertions, 4 deletions
diff --git a/source/com/c2kernel/persistency/ClusterStorageManager.java b/source/com/c2kernel/persistency/ClusterStorageManager.java
index b4515e0..756ac4d 100644
--- a/source/com/c2kernel/persistency/ClusterStorageManager.java
+++ b/source/com/c2kernel/persistency/ClusterStorageManager.java
@@ -8,8 +8,10 @@ import java.util.StringTokenizer;
import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.entity.C2KLocalObject;
+import com.c2kernel.entity.agent.JobList;
import com.c2kernel.entity.proxy.EntityProxyManager;
import com.c2kernel.entity.proxy.ProxyMessage;
+import com.c2kernel.events.History;
import com.c2kernel.persistency.outcome.Outcome;
import com.c2kernel.persistency.outcome.Viewpoint;
import com.c2kernel.process.Gateway;
@@ -163,7 +165,7 @@ public class ClusterStorageManager {
/** Internal get method. Retrieves clusters from ClusterStorages & maintains the memory cache */
public C2KLocalObject get(Integer sysKeyIntObj, String path) throws ClusterStorageException, ObjectNotFoundException {
- C2KLocalObject result;
+ C2KLocalObject result = null;
// check cache first
SoftCache<String, C2KLocalObject> sysKeyMemCache = null;
if (memoryCache.containsKey(sysKeyIntObj)) {
@@ -189,6 +191,21 @@ public class ClusterStorageManager {
return data;
}
}
+
+ // deal out top level remote maps
+ if (path.indexOf('/') == -1) {
+ if (path.equals(ClusterStorage.HISTORY))
+ result = new History(sysKeyIntObj, null);
+ if (path.equals(ClusterStorage.JOB))
+ result = new JobList(sysKeyIntObj, null);
+ if (result!=null) {
+ synchronized(sysKeyMemCache) {
+ sysKeyMemCache.put(path, result);
+ }
+ return result;
+ }
+
+ }
// else try each reader in turn until we find it
ArrayList<ClusterStorage> readers = findStorages(ClusterStorage.getClusterType(path), false);
diff --git a/source/com/c2kernel/persistency/TransactionManager.java b/source/com/c2kernel/persistency/TransactionManager.java
index 6f930b7..d2679a8 100644
--- a/source/com/c2kernel/persistency/TransactionManager.java
+++ b/source/com/c2kernel/persistency/TransactionManager.java
@@ -53,11 +53,11 @@ public class TransactionManager {
ObjectNotFoundException {
if (path.startsWith("/") && path.length() > 1) path = path.substring(1);
- // deal out top level remote maps
+ // deal out top level remote maps, if transactions aren't needed
if (path.indexOf('/') == -1) {
- if (path.equals(ClusterStorage.HISTORY))
+ if (path.equals(ClusterStorage.HISTORY) && locker != null)
return new History(sysKey, locker);
- if (path.equals(ClusterStorage.JOB))
+ if (path.equals(ClusterStorage.JOB) && locker != null)
return new JobList(sysKey, locker);
}