You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2012/02/20 19:28:26 UTC

svn commit: r1291398 - in /karaf/trunk: instance/core/src/main/java/org/apache/karaf/instance/internal/InstanceImpl.java pom.xml

Author: jbonofre
Date: Mon Feb 20 18:28:26 2012
New Revision: 1291398

URL: http://svn.apache.org/viewvc?rev=1291398&view=rev
Log:
[KARAF-468] InstanceImpl now use the Properties.getProperty() from Felix Utils

Modified:
    karaf/trunk/instance/core/src/main/java/org/apache/karaf/instance/internal/InstanceImpl.java
    karaf/trunk/pom.xml

Modified: karaf/trunk/instance/core/src/main/java/org/apache/karaf/instance/internal/InstanceImpl.java
URL: http://svn.apache.org/viewvc/karaf/trunk/instance/core/src/main/java/org/apache/karaf/instance/internal/InstanceImpl.java?rev=1291398&r1=1291397&r2=1291398&view=diff
==============================================================================
--- karaf/trunk/instance/core/src/main/java/org/apache/karaf/instance/internal/InstanceImpl.java (original)
+++ karaf/trunk/instance/core/src/main/java/org/apache/karaf/instance/internal/InstanceImpl.java Mon Feb 20 18:28:26 2012
@@ -194,7 +194,7 @@ public class InstanceImpl implements Ins
      */
     private String getConfiguration(File configurationFile, String propertyName) throws Exception {
         Properties props = loadPropertiesFile(configurationFile.toURI().toURL());
-        return (String) props.get(propertyName);
+        return props.getProperty(propertyName);
     }
 
     public String getJavaOpts() {
@@ -311,13 +311,9 @@ public class InstanceImpl implements Ins
             URL configPropURL = file.toURI().toURL();
             Properties props = loadPropertiesFile(configPropURL);
 
-            String host = "localhost";
-            if (props.get(KARAF_SHUTDOWN_HOST) != null)
-                host = (String) props.get(KARAF_SHUTDOWN_HOST);
+            String host = props.getProperty(KARAF_SHUTDOWN_HOST, "localhost");
             
-            String shutdown = DEFAULT_SHUTDOWN_COMMAND;
-            if (props.get(KARAF_SHUTDOWN_COMMAND) != null)
-                shutdown = (String) props.get(KARAF_SHUTDOWN_COMMAND);
+            String shutdown = props.getProperty(KARAF_SHUTDOWN_COMMAND, DEFAULT_SHUTDOWN_COMMAND);
             
             int port = getShutDownPort(props);
 
@@ -344,11 +340,11 @@ public class InstanceImpl implements Ins
 
 	private int getShutDownPort(Properties props) throws FileNotFoundException,
 			IOException {
-		int port = 0;
-		if (props.get(KARAF_SHUTDOWN_PORT) != null)
-		    port = Integer.parseInt((String) props.get(KARAF_SHUTDOWN_PORT));
+        
+        int port = Integer.parseInt(props.getProperty(KARAF_SHUTDOWN_PORT, "0"));
+
 		// Try to get port from port file
-		String portFile = (String) props.get(KARAF_SHUTDOWN_PORT_FILE);
+		String portFile = props.getProperty(KARAF_SHUTDOWN_PORT_FILE);
 		if (port == 0 && portFile != null) {
 		    BufferedReader r = new BufferedReader(new InputStreamReader(new FileInputStream(portFile)));
 		    String portStr = r.readLine();

Modified: karaf/trunk/pom.xml
URL: http://svn.apache.org/viewvc/karaf/trunk/pom.xml?rev=1291398&r1=1291397&r2=1291398&view=diff
==============================================================================
--- karaf/trunk/pom.xml (original)
+++ karaf/trunk/pom.xml Mon Feb 20 18:28:26 2012
@@ -146,7 +146,7 @@
         <felix.framework.version>4.0.2</felix.framework.version>
         <felix.gogo.version>0.10.0</felix.gogo.version>
         <felix.plugin.version>2.3.6</felix.plugin.version>
-        <felix.utils.version>1.1.0</felix.utils.version>
+        <felix.utils.version>1.1.2</felix.utils.version>
         <felix.webconsole.version>3.1.8</felix.webconsole.version>
         <felix.metatype.version>1.0.4</felix.metatype.version>
         <felix.eventadmin.version>1.2.14</felix.eventadmin.version>