karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject svn commit: r1478387 - in /karaf/trunk/webconsole/instance/src/main: java/org/apache/karaf/webconsole/instance/InstancePlugin.java resources/OSGI-INF/blueprint/webconsole-instance.xml
Date Thu, 02 May 2013 14:32:28 GMT
Author: jbonofre
Date: Thu May  2 14:32:28 2013
New Revision: 1478387

URL: http://svn.apache.org/r1478387
Log:
[KARAF-2285] Fix Instance WebConsole plugin with Equinox

Modified:
    karaf/trunk/webconsole/instance/src/main/java/org/apache/karaf/webconsole/instance/InstancePlugin.java
    karaf/trunk/webconsole/instance/src/main/resources/OSGI-INF/blueprint/webconsole-instance.xml

Modified: karaf/trunk/webconsole/instance/src/main/java/org/apache/karaf/webconsole/instance/InstancePlugin.java
URL: http://svn.apache.org/viewvc/karaf/trunk/webconsole/instance/src/main/java/org/apache/karaf/webconsole/instance/InstancePlugin.java?rev=1478387&r1=1478386&r2=1478387&view=diff
==============================================================================
--- karaf/trunk/webconsole/instance/src/main/java/org/apache/karaf/webconsole/instance/InstancePlugin.java
(original)
+++ karaf/trunk/webconsole/instance/src/main/java/org/apache/karaf/webconsole/instance/InstancePlugin.java
Thu May  2 14:32:28 2013
@@ -40,7 +40,7 @@ import org.osgi.framework.BundleContext;
 import org.slf4j.LoggerFactory;
 
 /**
- * Felix Web Console plugin for interacting with the {@link InstanceService}
+ * WebConsole plugin for{@link InstanceService}.
  */
 public class InstancePlugin extends AbstractWebConsolePlugin {
 
@@ -52,17 +52,12 @@ public class InstancePlugin extends Abst
     private BundleContext bundleContext;
     private InstanceService instanceService;
     private ClassLoader classLoader;
-    
-    
 
     @Override
     protected boolean isHtmlRequest(HttpServletRequest request) {
         return false;
     }
 
-    /**
-     * Blueprint lifecycle callback methods
-     */
     public void start() {
         super.activate(bundleContext);
         this.classLoader = this.getClass().getClassLoader();
@@ -148,16 +143,13 @@ public class InstancePlugin extends Abst
         }
     }
 
-    /*
-     * Parse the String value, returning <code>null</code> if the String is empty

-     */
     private String parseString(String value) {
         if (value != null && value.trim().length() == 0) {
             value = null;
         }
         return value;
     }
-    
+
     private List<String> parseStringList(String value) {
         List<String> list = new ArrayList<String>();
         if (value != null) {
@@ -167,14 +159,11 @@ public class InstancePlugin extends Abst
                     continue;
                 }
                 list.add(trimmed);
-            }            
+            }
         }
         return list;
     }
 
-    /*
-     * Parse the port number for the String given, returning 0 if the String does not represent
an integer 
-     */
     private int parsePortNumber(String port) {
         try {
             return Integer.parseInt(port);
@@ -185,6 +174,9 @@ public class InstancePlugin extends Abst
 
     protected URL getResource(String path) {
         path = path.substring(NAME.length() + 1);
+        if (path == null || path.isEmpty()) {
+            return null;
+        }
         URL url = this.classLoader.getResource(path);
         if (url != null) {
             InputStream ins = null;
@@ -206,7 +198,7 @@ public class InstancePlugin extends Abst
                     }
                 }
             }
-        } 
+        }
         return url;
     }
 
@@ -228,9 +220,7 @@ public class InstancePlugin extends Abst
             jw.key("instances");
             jw.array();
             for (Instance i : instances) {
-//                if (!i.isRoot()) {
-                    instanceInfo(jw, i);
-//                }
+                instanceInfo(jw, i);
             }
             jw.endArray();
             jw.endObject();
@@ -372,16 +362,10 @@ public class InstancePlugin extends Abst
         return false;
     }
 
-    /**
-     * @param instanceService the instanceService to set
-     */
     public void setInstanceService(InstanceService instanceService) {
         this.instanceService = instanceService;
     }
 
-    /**
-     * @param bundleContext the bundleContext to set
-     */
     public void setBundleContext(BundleContext bundleContext) {
         this.bundleContext = bundleContext;
     }

Modified: karaf/trunk/webconsole/instance/src/main/resources/OSGI-INF/blueprint/webconsole-instance.xml
URL: http://svn.apache.org/viewvc/karaf/trunk/webconsole/instance/src/main/resources/OSGI-INF/blueprint/webconsole-instance.xml?rev=1478387&r1=1478386&r2=1478387&view=diff
==============================================================================
--- karaf/trunk/webconsole/instance/src/main/resources/OSGI-INF/blueprint/webconsole-instance.xml
(original)
+++ karaf/trunk/webconsole/instance/src/main/resources/OSGI-INF/blueprint/webconsole-instance.xml
Thu May  2 14:32:28 2013
@@ -25,7 +25,6 @@
         <property name="instanceService" ref="instanceService" />
         <property name="bundleContext" ref="blueprintBundleContext" />
     </bean>
-
     <service ref="instancePlugin" interface="javax.servlet.Servlet" >
         <service-properties>
             <entry key="felix.webconsole.label" value="instance"/>



Mime
View raw message