summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/utils/LocalObjectLoader.java
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2013-11-18 09:48:03 +0100
committerAndrew Branson <andrew.branson@cern.ch>2013-11-18 17:25:00 +0100
commitd43164830403245353080f5d6f838ed9f56d9a35 (patch)
treed880c9103fb61f5ef39f1723c4dbd634d5d83b67 /src/main/java/com/c2kernel/utils/LocalObjectLoader.java
parent37a3c3867cb4c7705065ed1d079bdac4f3f52f50 (diff)
3.0-SNAPSHOT (Will be first open source version)
New StateMachine desc IssueID #28
Diffstat (limited to 'src/main/java/com/c2kernel/utils/LocalObjectLoader.java')
-rw-r--r--src/main/java/com/c2kernel/utils/LocalObjectLoader.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/com/c2kernel/utils/LocalObjectLoader.java b/src/main/java/com/c2kernel/utils/LocalObjectLoader.java
index 63bb3c2..aef7b96 100644
--- a/src/main/java/com/c2kernel/utils/LocalObjectLoader.java
+++ b/src/main/java/com/c2kernel/utils/LocalObjectLoader.java
@@ -4,6 +4,7 @@ import com.c2kernel.common.InvalidDataException;
import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.entity.proxy.ItemProxy;
import com.c2kernel.lifecycle.ActivityDef;
+import com.c2kernel.lifecycle.instance.stateMachine.StateMachine;
import com.c2kernel.lookup.DomainPath;
import com.c2kernel.persistency.ClusterStorage;
import com.c2kernel.persistency.ClusterStorageException;
@@ -13,6 +14,7 @@ import com.c2kernel.process.Gateway;
public class LocalObjectLoader {
private static ActDefCache actCache = new ActDefCache();
+ private static StateMachineCache smCache = new StateMachineCache();
static public ItemProxy loadLocalObjectDef(String root, String name)
throws ObjectNotFoundException
@@ -22,7 +24,7 @@ public class LocalObjectLoader {
return (ItemProxy)Gateway.getProxyManager().getProxy(defPath);
}
- static public String getScript(String scriptName, String scriptVersion) throws ObjectNotFoundException {
+ static public String getScript(String scriptName, int scriptVersion) throws ObjectNotFoundException {
Logger.msg(5, "Loading script "+scriptName+" v"+scriptVersion);
try {
ItemProxy script = loadLocalObjectDef("/desc/Script/", scriptName);
@@ -65,8 +67,13 @@ public class LocalObjectLoader {
* @return ActivityDef
* @throws ObjectNotFoundException - When activity or version does not exist
*/
- static public ActivityDef getActDef(String actName, String actVersion) throws ObjectNotFoundException, InvalidDataException {
+ static public ActivityDef getActDef(String actName, int actVersion) throws ObjectNotFoundException, InvalidDataException {
Logger.msg(5, "Loading activity def "+actName+" v"+actVersion);
return actCache.get(actName, actVersion);
}
+
+ static public StateMachine getStateMachine(String smName, int smVersion) throws ObjectNotFoundException, InvalidDataException {
+ Logger.msg(5, "Loading activity def "+smName+" v"+smVersion);
+ return smCache.get(smName, smVersion);
+ }
}