From 24314dc1699c7e73048fa24e33729f1aa1ec0e86 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Fri, 6 Jul 2012 11:00:24 +0200 Subject: Modules serialize with Castor. Just about to remove the parsing. CastorXMLUtility is now a static member of gateway. Domain specific instances can be used by domain applications, but the maps do not interfere with the kernel. --- src/main/java/com/c2kernel/entity/TraceableEntity.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/main/java/com/c2kernel/entity/TraceableEntity.java') diff --git a/src/main/java/com/c2kernel/entity/TraceableEntity.java b/src/main/java/com/c2kernel/entity/TraceableEntity.java index c7aff82..93f9407 100644 --- a/src/main/java/com/c2kernel/entity/TraceableEntity.java +++ b/src/main/java/com/c2kernel/entity/TraceableEntity.java @@ -30,7 +30,6 @@ import com.c2kernel.persistency.TransactionManager; import com.c2kernel.process.Gateway; import com.c2kernel.property.Property; import com.c2kernel.property.PropertyArrayList; -import com.c2kernel.utils.CastorXMLUtility; import com.c2kernel.utils.Logger; /************************************************************************** @@ -64,9 +63,9 @@ import com.c2kernel.utils.Logger; public class TraceableEntity extends ItemPOA { - private int mSystemKey; - private org.omg.PortableServer.POA mPoa; - private TransactionManager mStorage; + private final int mSystemKey; + private final org.omg.PortableServer.POA mPoa; + private final TransactionManager mStorage; /************************************************************************** @@ -135,7 +134,7 @@ public class TraceableEntity extends ItemPOA // create properties if (!propString.equals("")) { try { - props = (PropertyArrayList)CastorXMLUtility.unmarshall(propString); + props = (PropertyArrayList)Gateway.getMarshaller().unmarshall(propString); for (Object name : props.list) { Property thisProp = (Property)name; mStorage.put(mSystemKey, thisProp, props); @@ -153,7 +152,7 @@ public class TraceableEntity extends ItemPOA if (initWfString == null || initWfString.equals("")) lc = new Workflow(new CompositeActivity()); else - lc = new Workflow((CompositeActivity)CastorXMLUtility.unmarshall(initWfString)); + lc = new Workflow((CompositeActivity)Gateway.getMarshaller().unmarshall(initWfString)); lc.initialise(mSystemKey, agentPath); mStorage.put(mSystemKey, lc, null); } catch (Throwable ex) { @@ -254,7 +253,7 @@ public class TraceableEntity extends ItemPOA CompositeActivity domainWf = (CompositeActivity)wf.search("workflow/domain"); jobBag.list = filter?domainWf.calculateJobs(agent, true):domainWf.calculateAllJobs(agent, true); Logger.msg(1, "TraceableEntity::queryLifeCycle("+mSystemKey+") - Returning "+jobBag.list.size()+" jobs."); - return CastorXMLUtility.marshall( jobBag ); + return Gateway.getMarshaller().marshall( jobBag ); } catch( Throwable ex ) { @@ -309,7 +308,7 @@ public class TraceableEntity extends ItemPOA C2KLocalObject obj = mStorage.get( mSystemKey, path, null ); // marshall it, or in the case of an outcome get the data. - result = CastorXMLUtility.marshall(obj); + result = Gateway.getMarshaller().marshall(obj); } } catch (ObjectNotFoundException ex) { -- cgit v1.2.3