diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2012-07-06 11:00:24 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2012-07-06 11:00:24 +0200 |
| commit | 24314dc1699c7e73048fa24e33729f1aa1ec0e86 (patch) | |
| tree | c97af82997783b860c36f4410973b23caff0d42e /src/main/java/com/c2kernel/entity/transfer | |
| parent | cc79e98c4763affba4fa2e17dfe5a412f9de66c3 (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/entity/transfer')
| -rw-r--r-- | src/main/java/com/c2kernel/entity/transfer/TransferItem.java | 7 | ||||
| -rw-r--r-- | src/main/java/com/c2kernel/entity/transfer/TransferSet.java | 3 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/main/java/com/c2kernel/entity/transfer/TransferItem.java b/src/main/java/com/c2kernel/entity/transfer/TransferItem.java index 0e3b764..520063a 100644 --- a/src/main/java/com/c2kernel/entity/transfer/TransferItem.java +++ b/src/main/java/com/c2kernel/entity/transfer/TransferItem.java @@ -16,7 +16,6 @@ import com.c2kernel.persistency.outcome.Outcome; import com.c2kernel.process.Gateway;
import com.c2kernel.property.Property;
import com.c2kernel.property.PropertyArrayList;
-import com.c2kernel.utils.CastorXMLUtility;
import com.c2kernel.utils.FileStringUtility;
import com.c2kernel.utils.Logger;
@@ -58,7 +57,7 @@ public class TransferItem { C2KLocalObject obj = Gateway.getStorage().get(sysKey, path, null);
Logger.msg("Dumping object " + path + " in " + sysKey);
File dumpPath = new File(dir.getCanonicalPath() + ".xml");
- FileStringUtility.string2File(dumpPath, CastorXMLUtility.marshall(obj));
+ FileStringUtility.string2File(dumpPath, Gateway.getMarshaller().marshall(obj));
return;
} catch (ObjectNotFoundException ex) {
} // not an object
@@ -84,7 +83,7 @@ public class TransferItem { if (choppedPath.startsWith(ClusterStorage.OUTCOME))
newObj = new Outcome(choppedPath, xmlFile);
else
- newObj = (C2KLocalObject)CastorXMLUtility.unmarshall(xmlFile);
+ newObj = (C2KLocalObject)Gateway.getMarshaller().unmarshall(xmlFile);
objects.add(newObj);
}
@@ -108,7 +107,7 @@ public class TransferItem { throw new Exception("No workflow found in import for "+sysKey);
// init item
- newItem.initialise(importAgentId, CastorXMLUtility.marshall(props), CastorXMLUtility.marshall(wf.search("workflow/domain")));
+ newItem.initialise(importAgentId, Gateway.getMarshaller().marshall(props), Gateway.getMarshaller().marshall(wf.search("workflow/domain")));
// store objects
importByType(ClusterStorage.COLLECTION, objects);
diff --git a/src/main/java/com/c2kernel/entity/transfer/TransferSet.java b/src/main/java/com/c2kernel/entity/transfer/TransferSet.java index 71a593a..7a3ba2e 100644 --- a/src/main/java/com/c2kernel/entity/transfer/TransferSet.java +++ b/src/main/java/com/c2kernel/entity/transfer/TransferSet.java @@ -6,7 +6,6 @@ import java.util.ArrayList; import com.c2kernel.lookup.EntityPath;
import com.c2kernel.lookup.NextKeyManager;
import com.c2kernel.process.Gateway;
-import com.c2kernel.utils.CastorXMLUtility;
import com.c2kernel.utils.FileStringUtility;
import com.c2kernel.utils.Logger;
@@ -52,7 +51,7 @@ public class TransferSet { }
try {
- String self = CastorXMLUtility.marshall(this);
+ String self = Gateway.getMarshaller().marshall(this);
FileStringUtility.string2File(new File(dir, "transferSet.xml"), self);
} catch (Exception ex) {
Logger.error("Error writing header file");
|
