From 755bb76c94953b62a08e9fecf523bc5c42ec79ac Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Wed, 26 Feb 2014 10:29:36 +0100 Subject: Properties extended as ObjectProperties, which can return any Object, and wrap int and boolean parsing. Gateway.getProperties() returns the new ObjectProperty instance. Old Gateway property methods still present but deprecated. Refs #149 --- src/main/java/com/c2kernel/process/Gateway.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/main/java/com/c2kernel/process/Gateway.java') diff --git a/src/main/java/com/c2kernel/process/Gateway.java b/src/main/java/com/c2kernel/process/Gateway.java index b57e91b..0d9dbe6 100644 --- a/src/main/java/com/c2kernel/process/Gateway.java +++ b/src/main/java/com/c2kernel/process/Gateway.java @@ -26,6 +26,7 @@ import com.c2kernel.utils.CastorXMLUtility; import com.c2kernel.utils.FileStringUtility; import com.c2kernel.utils.Language; import com.c2kernel.utils.Logger; +import com.c2kernel.utils.ObjectProperties; /************************************************************************** @@ -50,7 +51,7 @@ import com.c2kernel.utils.Logger; public class Gateway { - static private Properties mC2KProps; + static private ObjectProperties mC2KProps; static private ModuleManager mModules; static private org.omg.CORBA.ORB mORB; static private boolean orbDestroyed = false; @@ -60,7 +61,7 @@ public class Gateway static private CorbaServer mCorbaServer; static private CastorXMLUtility mMarshaller; static private AgentProxy mCurrentUser = null; - static private ResourceLoader mResource; + static private ResourceLoader mResource; @@ -91,7 +92,7 @@ public class Gateway static public void init(Properties props, ResourceLoader res) throws InvalidDataException { // Init properties & resources - mC2KProps = new Properties(); + mC2KProps = new ObjectProperties(); mResource = res; if (mResource == null) mResource = new Resource(); @@ -413,15 +414,18 @@ public class Gateway return getProperty("LocalCentre"); } + @Deprecated static public String getProperty(String propName) { return getProperty(propName, null); } + @Deprecated static public String getProperty(String propName, String defaultValue) { if (mC2KProps == null) return defaultValue; return mC2KProps.getProperty(propName, defaultValue); } + @Deprecated static public void setProperty(String propName, String propValue) { if (mC2KProps == null) return; mC2KProps.put(propName, propValue); @@ -440,6 +444,9 @@ public class Gateway } } + static public ObjectProperties getProperties() { + return mC2KProps; + } static public String getKernelVersion() { try { -- cgit v1.2.3