summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/process/Gateway.java
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/process/Gateway.java
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/process/Gateway.java')
-rw-r--r--src/main/java/com/c2kernel/process/Gateway.java29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/main/java/com/c2kernel/process/Gateway.java b/src/main/java/com/c2kernel/process/Gateway.java
index e0decc4..4cba4ba 100644
--- a/src/main/java/com/c2kernel/process/Gateway.java
+++ b/src/main/java/com/c2kernel/process/Gateway.java
@@ -58,6 +58,7 @@ public class Gateway
static private EntityProxyManager mProxyManager;
static private CorbaServer mCorbaServer;
static private SimpleTCPIPServer mHTTPServer;
+ static private CastorXMLUtility mMarshaller;
@@ -73,15 +74,18 @@ public class Gateway
*/
static public void init(Properties props, boolean isServer) throws InvalidDataException {
- // if supplied props are null, use system props
- if (props == null) props = System.getProperties();
-
// Init properties
mC2KProps = new Properties();
- mC2KProps.putAll(props);
// report version info
Logger.msg("Kernel version: "+Resource.getKernelVersion());
+
+ // load kernel mapfiles
+ try {
+ mMarshaller = new CastorXMLUtility(Resource.getKernelResourceURL("mapFiles/"));
+ } catch (MalformedURLException e1) {
+ throw new InvalidDataException("Invalid Resource Location", "");
+ }
// init module manager
try {
@@ -99,21 +103,11 @@ public class Gateway
}
// Overwrite with argument props
- for (Enumeration<?> e = props.propertyNames(); e.hasMoreElements();) {
- String propName = (String)e.nextElement();
- mC2KProps.put(propName, props.get(propName));
- }
+ if (props != null) mC2KProps.putAll(props);
// dump properties
dumpC2KProps(7);
- // load kernel mapfiles
- try {
- CastorXMLUtility.loadMapsFrom(Resource.getKernelResourceURL("mapFiles/"));
- } catch (MalformedURLException e1) {
- throw new InvalidDataException("Invalid Resource Location", "");
- }
-
//Initialise language file
String languageFile = getProperty("language.file");
if (languageFile != null && languageFile.length() > 0) {
@@ -383,6 +377,11 @@ public class Gateway
{
return mStorage;
}
+
+ static public CastorXMLUtility getMarshaller()
+ {
+ return mMarshaller;
+ }
static public EntityProxyManager getProxyManager()
{