summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/property
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2012-07-06 11:00:24 +0200
committerAndrew Branson <andrew.branson@cern.ch>2012-07-06 11:00:24 +0200
commit24314dc1699c7e73048fa24e33729f1aa1ec0e86 (patch)
treec97af82997783b860c36f4410973b23caff0d42e /src/main/java/com/c2kernel/property
parentcc79e98c4763affba4fa2e17dfe5a412f9de66c3 (diff)
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.
Diffstat (limited to 'src/main/java/com/c2kernel/property')
-rw-r--r--src/main/java/com/c2kernel/property/PropertyArrayList.java17
-rw-r--r--src/main/java/com/c2kernel/property/PropertyUtility.java3
2 files changed, 16 insertions, 4 deletions
diff --git a/src/main/java/com/c2kernel/property/PropertyArrayList.java b/src/main/java/com/c2kernel/property/PropertyArrayList.java
index f59b2d5..5401f22 100644
--- a/src/main/java/com/c2kernel/property/PropertyArrayList.java
+++ b/src/main/java/com/c2kernel/property/PropertyArrayList.java
@@ -22,8 +22,21 @@ public class PropertyArrayList extends CastorArrayList<Property>
public PropertyArrayList(ArrayList<Property> aList)
{
- super(aList);
+ super();
+ // put all properties in order, so later ones with the same name overwrite earlier ones
+ for (Property property : aList) {
+ put(property);
+ }
}
-
+ /** Overwrite */
+ public void put(Property p) {
+ for (Property thisProp : list) {
+ if (thisProp.getName().equals(p.getName())) {
+ list.remove(thisProp);
+ break;
+ }
+ }
+ list.add(p);
+ }
}
diff --git a/src/main/java/com/c2kernel/property/PropertyUtility.java b/src/main/java/com/c2kernel/property/PropertyUtility.java
index 497e5d3..968ff13 100644
--- a/src/main/java/com/c2kernel/property/PropertyUtility.java
+++ b/src/main/java/com/c2kernel/property/PropertyUtility.java
@@ -17,7 +17,6 @@ import com.c2kernel.persistency.ClusterStorage;
import com.c2kernel.persistency.outcome.Outcome;
import com.c2kernel.process.Gateway;
import com.c2kernel.utils.CastorHashMap;
-import com.c2kernel.utils.CastorXMLUtility;
import com.c2kernel.utils.Logger;
@@ -60,7 +59,7 @@ public class PropertyUtility
try
{
Outcome outc = (Outcome) Gateway.getStorage().get(entityKey, ClusterStorage.VIEWPOINT+"/PropertyDescription/last/data", null);
- return (PropertyDescriptionList)CastorXMLUtility.unmarshall(outc.getData());
+ return (PropertyDescriptionList)Gateway.getMarshaller().unmarshall(outc.getData());
}
catch (Exception ex)
{