servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r644207 - in /servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal: CommandProxy.java FeaturesServiceImpl.java RepositoryImpl.java
Date Thu, 03 Apr 2008 08:04:08 GMT
Author: gnodet
Date: Thu Apr  3 01:04:06 2008
New Revision: 644207

URL: http://svn.apache.org/viewvc?rev=644207&view=rev
Log:
Fix empty features caused by dependencies, disable proxy commands

Modified:
    servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/CommandProxy.java
    servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/FeaturesServiceImpl.java
    servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/RepositoryImpl.java

Modified: servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/CommandProxy.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/CommandProxy.java?rev=644207&r1=644206&r2=644207&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/CommandProxy.java
(original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/CommandProxy.java
Thu Apr  3 01:04:06 2008
@@ -88,14 +88,4 @@
         }
     }
 
-    private String readLine(Reader in) throws IOException {
-        StringBuffer buf = new StringBuffer();
-        while (true) {
-            int i = in.read();
-            if ((i == -1) || (i == '\n') || (i == '\r')) {
-                return buf.toString();
-            }
-            buf.append((char) i);
-        }
-    }
 }

Modified: servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/FeaturesServiceImpl.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/FeaturesServiceImpl.java?rev=644207&r1=644206&r2=644207&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/FeaturesServiceImpl.java
(original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/FeaturesServiceImpl.java
Thu Apr  3 01:04:06 2008
@@ -114,10 +114,12 @@
         repositories.put(url, repo);
         features = null;
         repo.load();
+        /*
         Feature[] features = repo.getFeatures();
         for (int i = 0; i < features.length; i++) {
             CommandProxy cmd = new CommandProxy(features[i], bundleContext);
         }
+        */
     }
 
     public void removeRepository(URL url) {

Modified: servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/RepositoryImpl.java?rev=644207&r1=644206&r2=644207&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/RepositoryImpl.java
(original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/internal/RepositoryImpl.java
Thu Apr  3 01:04:06 2008
@@ -31,6 +31,7 @@
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
+import org.w3c.dom.Node;
 
 import org.apache.servicemix.gshell.features.Feature;
 import org.apache.servicemix.gshell.features.Repository;
@@ -61,8 +62,12 @@
             features = new ArrayList<Feature>();
             DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
             Document doc = factory.newDocumentBuilder().parse(url.openStream());
-            NodeList nodes = doc.getDocumentElement().getElementsByTagName("feature");
+            NodeList nodes = doc.getDocumentElement().getChildNodes();
             for (int i = 0; i < nodes.getLength(); i++) {
+                Node node = nodes.item(i);
+                if (!(node instanceof Element) || !"feature".equals(node.getNodeName()))
{
+                    continue;
+                }
                 Element e = (Element) nodes.item(i);
                 String name = e.getAttribute("name");
                 FeatureImpl f = new FeatureImpl(name);



Mime
View raw message