From d9722227d4b17704dcdf02b30121321bac533efe Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Sat, 20 Jul 2013 11:56:13 +0200 Subject: Refactor ActDefCache into DescriptionObjectCache. Create ActivityDef and StateMachine caches. Add StateMachine loading to LocalObjectLoader --- src/main/java/com/c2kernel/utils/LocalObjectLoader.java | 7 +++++++ 1 file changed, 7 insertions(+) (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..f139b84 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 @@ -69,4 +71,9 @@ public class LocalObjectLoader { Logger.msg(5, "Loading activity def "+actName+" v"+actVersion); return actCache.get(actName, actVersion); } + + static public StateMachine getStateMachine(String smName, String smVersion) throws ObjectNotFoundException, InvalidDataException { + Logger.msg(5, "Loading activity def "+smName+" v"+smVersion); + return smCache.get(smName, smVersion); + } } -- cgit v1.2.3