From e5118d5e313c3194c286946cc09e7b8aea099565 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Fri, 20 Sep 2013 14:54:39 +0200 Subject: Pass c2kprops in as argument for ORB, so they can be overridden --- src/main/java/com/c2kernel/process/Gateway.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/c2kernel/process/Gateway.java b/src/main/java/com/c2kernel/process/Gateway.java index 8182bf8..53fa36f 100644 --- a/src/main/java/com/c2kernel/process/Gateway.java +++ b/src/main/java/com/c2kernel/process/Gateway.java @@ -135,19 +135,18 @@ public class Gateway // start entity proxy server EntityProxyManager.initServer(); - // Init ORB - set various config to sys properties - java.util.Properties sysProps = System.getProperties(); + // Init ORB - set various config String serverName = getProperty("ItemServer.name"); if (serverName != null) - sysProps.put("com.sun.CORBA.ORBServerHost", serverName); + mC2KProps.put("com.sun.CORBA.ORBServerHost", serverName); String serverPort = getProperty("ItemServer.iiop", "1500"); - sysProps.put("com.sun.CORBA.ORBServerPort", serverPort); + mC2KProps.put("com.sun.CORBA.ORBServerPort", serverPort); //TODO: externalize this (or replace corba completely) - sysProps.put("com.sun.CORBA.POA.ORBServerId", "1"); - sysProps.put("com.sun.CORBA.POA.ORBPersistentServerPort", serverPort); + mC2KProps.put("com.sun.CORBA.POA.ORBServerId", "1"); + mC2KProps.put("com.sun.CORBA.POA.ORBPersistentServerPort", serverPort); //Standard initialisation of the ORB - mORB = org.omg.CORBA.ORB.init(new String[0], sysProps); + mORB = org.omg.CORBA.ORB.init(new String[0], mC2KProps); Logger.msg("Gateway.init() - ORB initialised. ORB is " + mORB.getClass().getName() ); @@ -359,7 +358,7 @@ public class Gateway { if (orbDestroyed) throw new RuntimeException("Gateway has been closed. ORB is destroyed."); if (mORB == null) - mORB = org.omg.CORBA.ORB.init(new String[0], null); + mORB = org.omg.CORBA.ORB.init(new String[0], mC2KProps); return mORB; } -- cgit v1.2.3