From d43164830403245353080f5d6f838ed9f56d9a35 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Mon, 18 Nov 2013 09:48:03 +0100 Subject: 3.0-SNAPSHOT (Will be first open source version) New StateMachine desc IssueID #28 --- src/main/java/com/c2kernel/utils/LocalObjectLoader.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/main/java/com/c2kernel/utils/LocalObjectLoader.java') 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); + } } -- cgit v1.2.3