karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject svn commit: r1478370 - in /karaf/trunk/webconsole/features/src/main: java/org/apache/karaf/webconsole/features/ExtendedFeature.java java/org/apache/karaf/webconsole/features/FeaturesPlugin.java resources/OSGI-INF/blueprint/webconsole-features.xml
Date Thu, 02 May 2013 13:42:45 GMT
Author: jbonofre
Date: Thu May  2 13:42:45 2013
New Revision: 1478370

URL: http://svn.apache.org/r1478370
Log:
[KARAF-2285] Fix features webconsole plugin for Equinox

Modified:
    karaf/trunk/webconsole/features/src/main/java/org/apache/karaf/webconsole/features/ExtendedFeature.java
    karaf/trunk/webconsole/features/src/main/java/org/apache/karaf/webconsole/features/FeaturesPlugin.java
    karaf/trunk/webconsole/features/src/main/resources/OSGI-INF/blueprint/webconsole-features.xml

Modified: karaf/trunk/webconsole/features/src/main/java/org/apache/karaf/webconsole/features/ExtendedFeature.java
URL: http://svn.apache.org/viewvc/karaf/trunk/webconsole/features/src/main/java/org/apache/karaf/webconsole/features/ExtendedFeature.java?rev=1478370&r1=1478369&r2=1478370&view=diff
==============================================================================
--- karaf/trunk/webconsole/features/src/main/java/org/apache/karaf/webconsole/features/ExtendedFeature.java
(original)
+++ karaf/trunk/webconsole/features/src/main/java/org/apache/karaf/webconsole/features/ExtendedFeature.java
Thu May  2 13:42:45 2013
@@ -16,7 +16,6 @@
  */
 package org.apache.karaf.webconsole.features;
 
-
 import java.util.List;
 import java.util.Map;
 
@@ -26,23 +25,16 @@ import org.apache.karaf.features.ConfigF
 import org.apache.karaf.features.Dependency;
 import org.apache.karaf.features.Feature;
 
+public class ExtendedFeature implements Feature {
 
-/**
- * 
- */
-public class ExtendedFeature implements Feature
-{
-
-    public enum State
-    {
+    public enum State {
         INSTALLED, UNINSTALLED;
 
         @Override
-        public String toString()
-        {
+        public String toString() {
             //only capitalize the first letter
             String s = super.toString();
-            return s.substring( 0, 1 ) + s.substring( 1 ).toLowerCase();
+            return s.substring(0, 1) + s.substring(1).toLowerCase();
         }
     }
 
@@ -50,90 +42,72 @@ public class ExtendedFeature implements 
     protected final String repository;
     protected final Feature feature;
 
-
-    //
-    // Constructors
-    //
-
-    public ExtendedFeature( State state, String repository, Feature feature )
-    {
+    public ExtendedFeature(State state, String repository, Feature feature) {
         this.state = state;
         this.repository = repository;
         this.feature = feature;
     }
 
-
-    //
-    // Feature interface
-    //
-
-
-    public List<BundleInfo> getBundles()
-    {
+    @Override
+    public List<BundleInfo> getBundles() {
         return this.feature.getBundles();
     }
 
-
-    public Map<String, Map<String, String>> getConfigurations()
-    {
+    @Override
+    public Map<String, Map<String, String>> getConfigurations() {
         return this.feature.getConfigurations();
     }
 
+    @Override
     public List<ConfigFileInfo> getConfigurationFiles() {
-		return this.feature.getConfigurationFiles();
-	}
+        return this.feature.getConfigurationFiles();
+    }
 
     @Override
     public List<? extends Conditional> getConditional() {
         return this.feature.getConditional();
     }
 
-    public List<Dependency> getDependencies()
-    {
+    @Override
+    public List<Dependency> getDependencies() {
         return this.feature.getDependencies();
     }
 
-
-    public String getId()
-    {
+    @Override
+    public String getId() {
         return this.feature.getId();
     }
 
-
-    public String getName()
-    {
+    @Override
+    public String getName() {
         return this.feature.getName();
     }
 
-
-    public String getVersion()
-    {
+    @Override
+    public String getVersion() {
         return this.feature.getVersion();
     }
 
-    public String getResolver()
-    {
+    @Override
+    public String getResolver() {
         return this.feature.getResolver();
     }
 
+    @Override
     public String getDescription() {
         return this.feature.getDescription();
     }
 
+    @Override
     public String getDetails() {
         return this.feature.getDetails();
     }
 
-
-    //
-    // Additional methods
-    //
-
-
     public String getRepository() {
         return this.repository;
     }
 
+    @Override
     public String getInstall() {
         return feature.getInstall();
     }
@@ -141,20 +115,20 @@ public class ExtendedFeature implements 
     public State getState() {
         return this.state;
     }
-    
+
+    @Override
     public int getStartLevel() {
         return 0;
     }
 
+    @Override
     public boolean hasVersion() {
         return this.feature.hasVersion();
     }
 
-
     @Override
     public String getRegion() {
         return feature.getRegion();
     }
 
-    
 }

Modified: karaf/trunk/webconsole/features/src/main/java/org/apache/karaf/webconsole/features/FeaturesPlugin.java
URL: http://svn.apache.org/viewvc/karaf/trunk/webconsole/features/src/main/java/org/apache/karaf/webconsole/features/FeaturesPlugin.java?rev=1478370&r1=1478369&r2=1478370&view=diff
==============================================================================
--- karaf/trunk/webconsole/features/src/main/java/org/apache/karaf/webconsole/features/FeaturesPlugin.java
(original)
+++ karaf/trunk/webconsole/features/src/main/java/org/apache/karaf/webconsole/features/FeaturesPlugin.java
Thu May  2 13:42:45 2013
@@ -42,166 +42,116 @@ import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
 /**
- * The <code>FeaturesPlugin</code>
+ * WebConsole plugin to use {@link FeaturesService}.
  */
-public class FeaturesPlugin extends AbstractWebConsolePlugin
-{
-
-    /** Pseudo class version ID to keep the IDE quite. */
-    private static final long serialVersionUID = 1L;
+public class FeaturesPlugin extends AbstractWebConsolePlugin {
 
     private final Logger log = LoggerFactory.getLogger(FeaturesPlugin.class);
 
     public static final String NAME = "features";
-
     public static final String LABEL = "Features";
-
     private ClassLoader classLoader;
-
     private String featuresJs = "/features/res/ui/features.js";
-
     private FeaturesService featuresService;
-    
     private BundleContext bundleContext;
 
-
-    //
-    // Blueprint lifecycle callback methods
-    //
-    
     @Override
     protected boolean isHtmlRequest(HttpServletRequest request) {
         return false;
     }
 
-
-    public void start()
-    {
-        super.activate( bundleContext );
-
+    public void start() {
+        super.activate(bundleContext);
         this.classLoader = this.getClass().getClassLoader();
-
-        this.log.info( LABEL + " plugin activated" );
+        this.log.info(LABEL + " plugin activated");
     }
 
-
-    public void stop()
-    {
-        this.log.info( LABEL + " plugin deactivated" );
+    public void stop() {
+        this.log.info(LABEL + " plugin deactivated");
         super.deactivate();
     }
 
-
-    //
-    // AbstractWebConsolePlugin interface
-    //
-
-    public String getLabel()
-    {
+    @Override
+    public String getLabel() {
         return NAME;
     }
 
-
-    public String getTitle()
-    {
+    @Override
+    public String getTitle() {
         return LABEL;
     }
 
-
-    protected void doPost( HttpServletRequest req, HttpServletResponse resp ) throws ServletException,
IOException
-    {
+    @Override
+    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException,
IOException {
         boolean success = false;
 
-        final String action = req.getParameter( "action" );
-        final String feature = req.getParameter( "feature" );
-        final String version = req.getParameter( "version" );
-        final String url = req.getParameter( "url" );
+        final String action = req.getParameter("action");
+        final String feature = req.getParameter("feature");
+        final String version = req.getParameter("version");
+        final String url = req.getParameter("url");
 
-        if ( action == null )
-        {
+        if (action == null) {
             success = true;
-        }
-        else if ( "installFeature".equals( action ) )
-        {
+        } else if ("installFeature".equals(action)) {
             success = this.installFeature(feature, version);
-        }
-        else if ( "uninstallFeature".equals( action ) )
-        {
-            success = this.uninstallFeature( feature, version );
-        }
-        else if ( "refreshRepository".equals( action ) )
-        {
-            success = this.refreshRepository( url );
-        }
-        else if ( "removeRepository".equals( action ) )
-        {
-            success = this.removeRepository( url );
-        }
-        else if ( "addRepository".equals( action ) )
-        {
-            success = this.addRepository( url );
+        } else if ("uninstallFeature".equals(action)) {
+            success = this.uninstallFeature(feature, version);
+        } else if ("refreshRepository".equals(action)) {
+            success = this.refreshRepository(url);
+        } else if ("removeRepository".equals(action)) {
+            success = this.removeRepository(url);
+        } else if ("addRepository".equals(action)) {
+            success = this.addRepository(url);
         }
 
-        if ( success )
-        {
+        if (success) {
             // let's wait a little bit to give the framework time
             // to process our request
-            try
-            {
-                Thread.sleep( 800 );
-            }
-            catch ( InterruptedException e )
-            {
-                // we ignore this
+            try {
+                Thread.sleep(800);
+            } catch (InterruptedException e) {
+                // ignore
             }
-            this.renderJSON( resp, null );
-        }
-        else
-        {
-            super.doPost( req, resp );
+            this.renderJSON(resp);
+        } else {
+            super.doPost(req, resp);
         }
     }
 
     @Override
-    protected void renderContent( HttpServletRequest request, HttpServletResponse response
) throws IOException
-    {
+    protected void renderContent(HttpServletRequest request, HttpServletResponse response)
throws IOException {
 
-        // get request info from request attribute
         final PrintWriter pw = response.getWriter();
 
-        String appRoot = ( String ) request.getAttribute(WebConsoleConstants.ATTR_APP_ROOT);
-        final String featuresScriptTag = "<script src='" + appRoot + this.featuresJs
-            + "' language='JavaScript'></script>";
-        pw.println( featuresScriptTag );
-
-        pw.println( "<script type='text/javascript'>" );
-        pw.println( "// <![CDATA[" );
-        pw.println( "var imgRoot = '" + appRoot + "/res/imgs';" );
-        pw.println( "// ]]>" );
-        pw.println( "</script>" );
-
-        pw.println( "<div id='plugin_content'>" );
-
-        pw.println( "<script type='text/javascript'>" );
-        pw.println( "// <![CDATA[" );
-        pw.print( "renderFeatures( " );
-        writeJSON( pw );
-        pw.println( " )" );
-        pw.println( "// ]]>" );
-        pw.println( "</script>" );
-    }
+        String appRoot = (String) request.getAttribute(WebConsoleConstants.ATTR_APP_ROOT);
 
+        final String featuresScriptTag = "<script src='" + appRoot + this.featuresJs +
"' language='JavaScript'></script>";
+        pw.println(featuresScriptTag);
 
-    //
-    // Additional methods
-    //
-
-    protected URL getResource( String path )
-    {
-        path = path.substring( NAME.length() + 1 );
-        URL url = this.classLoader.getResource( path );
+        pw.println("<script type='text/javascript'>");
+        pw.println("// <![CDATA[");
+        pw.println("var imgRoot = '" + appRoot + "/res/imgs';");
+        pw.println("// ]]>");
+        pw.println("</script>");
+
+        pw.println("<div id='plugin_content'>");
+
+        pw.println("<script type='text/javascript'>");
+        pw.println("// <![CDATA[");
+        pw.print("renderFeatures( ");
+        writeJSON(pw);
+        pw.println(" )");
+        pw.println("// ]]>");
+        pw.println("</script>");
+    }
+
+    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;
             try {
@@ -223,337 +173,262 @@ public class FeaturesPlugin extends Abst
                 }
             }
         }
-
         return url;
     }
 
-
     private boolean installFeature(String feature, String version) {
         boolean success = false;
-        if ( featuresService == null )
-        {
-            this.log.error( "Shell Features service is unavailable." );
-        }
-        try
-        {
-            featuresService.installFeature( feature, version );
-            success = true;
+        if (featuresService == null) {
+            this.log.error("Features service is not available");
         }
-        catch ( Exception e )
-        {
-            this.log.error( "failed to install feature: ", e );
+        try {
+            featuresService.installFeature(feature, version);
+            success = true;
+        } catch (Exception e) {
+            this.log.error("Can't install feature {}/{}", feature, version, e);
         }
         return success;
     }
 
-
     private boolean uninstallFeature(String feature, String version) {
         boolean success = false;
-        if ( featuresService == null )
-        {
-            this.log.error( "Shell Features service is unavailable." );
-        }
-        try
-        {
-            featuresService.uninstallFeature( feature, version );
-            success = true;
+        if (featuresService == null) {
+            this.log.error("Features service is not available");
         }
-        catch ( Exception e )
-        {
-            this.log.error( "failed to install feature: ", e );
+        try {
+            featuresService.uninstallFeature(feature, version);
+            success = true;
+        } catch (Exception e) {
+            this.log.error("Can't uninstall feature {}/{}", feature, version, e);
         }
         return success;
     }
 
-
     private boolean removeRepository(String url) {
         boolean success = false;
-        if ( featuresService == null )
-        {
-            this.log.error( "Shell Features service is unavailable." );
-        }
-        try
-        {
-            featuresService.removeRepository( new URI( url ) );
-            success = true;
+        if (featuresService == null) {
+            this.log.error("Features service is not available");
         }
-        catch ( Exception e )
-        {
-            this.log.error( "failed to install feature: ", e );
+        try {
+            featuresService.removeRepository(new URI(url));
+            success = true;
+        } catch (Exception e) {
+            this.log.error("Can't remove features repository {}", url, e);
         }
         return success;
     }
 
-
     private boolean refreshRepository(String url) {
         boolean success = false;
-        if ( featuresService == null )
-        {
-            this.log.error( "Shell Features service is unavailable." );
-        }
-        try
-        {
-            featuresService.removeRepository( new URI( url ) );
-            featuresService.addRepository( new URI( url ) );
-            success = true;
+        if (featuresService == null) {
+            this.log.error("Features service is not available");
         }
-        catch ( Exception e )
-        {
-            this.log.error( "failed to install feature: ", e );
+        try {
+            featuresService.removeRepository(new URI(url));
+            featuresService.addRepository(new URI(url));
+            success = true;
+        } catch (Exception e) {
+            this.log.error("Can't refresh features repository {}", url, e);
         }
         return success;
     }
 
-
     private boolean addRepository(String url) {
         boolean success = false;
-        if ( featuresService == null )
-        {
-            this.log.error( "Shell Features service is unavailable." );
-        }
-        try
-        {
-            featuresService.addRepository( new URI( url ) );
-            success = true;
+        if (featuresService == null) {
+            this.log.error("Features service is not available");
         }
-        catch ( Exception e )
-        {
-            this.log.error( "failed to install feature: ", e );
+        try {
+            featuresService.addRepository(new URI(url));
+            success = true;
+        } catch (Exception e) {
+            this.log.error("Can't add features repository {}", url, e);
         }
         return success;
     }
 
-
-    private void renderJSON( final HttpServletResponse response, final String feature ) throws
IOException
-    {
-        response.setContentType( "application/json" );
-        response.setCharacterEncoding( "UTF-8" );
+    private void renderJSON(final HttpServletResponse response) throws IOException {
+        response.setContentType("application/json");
+        response.setCharacterEncoding("UTF-8");
 
         final PrintWriter pw = response.getWriter();
-        writeJSON( pw );
+        writeJSON(pw);
     }
 
-
-    private void writeJSON( final PrintWriter pw ) throws IOException
-    {
+    private void writeJSON(final PrintWriter pw) throws IOException {
         final List<Repository> repositories = this.getRepositories();
-        final List<ExtendedFeature> features = this.getFeatures( repositories );
-        final String statusLine = this.getStatusLine( features );
+        final List<ExtendedFeature> features = this.getFeatures(repositories);
+        final String statusLine = this.getStatusLine(features);
 
-        final JSONWriter jw = new JSONWriter( pw );
+        final JSONWriter jw = new JSONWriter(pw);
 
-        try
-        {
+        try {
             jw.object();
 
-            jw.key( "status" );
-            jw.value( statusLine );
+            jw.key("status");
+            jw.value(statusLine);
 
-            jw.key( "repositories" );
+            jw.key("repositories");
             jw.array();
-            for ( Repository r : repositories )
-            {
+            for (Repository r : repositories) {
                 jw.object();
-                jw.key( "name" );
-                jw.value( r.getName() );
-                jw.key( "url" );
+                jw.key("name");
+                jw.value(r.getName());
+                jw.key("url");
                 String uri = r.getURI().toString();
-                jw.value( uri );
-                jw.key( "actions" );
+                jw.value(uri);
+                jw.key("actions");
                 jw.array();
                 boolean enable = true;
-                if ( uri.startsWith( "bundle" ) ) {
+                if (uri.startsWith("bundle")) {
                     enable = false;
                 }
-                action( jw, enable, "refreshRepository", "Refresh", "refresh" );
-                action( jw, enable, "removeRepository", "Remove", "delete" );
+                action(jw, enable, "refreshRepository", "Refresh", "refresh");
+                action(jw, enable, "removeRepository", "Remove", "delete");
                 jw.endArray();
                 jw.endObject();
             }
             jw.endArray();
 
-            jw.key( "features" );
+            jw.key("features");
             jw.array();
-            for ( ExtendedFeature f : features )
-            {
-                featureInfo( jw, f );
+            for (ExtendedFeature f : features) {
+                featureInfo(jw, f);
             }
             jw.endArray();
 
             jw.endObject();
 
-        }
-        catch ( JSONException je )
-        {
-            throw new IOException( je.toString() );
+        } catch (JSONException je) {
+            throw new IOException(je.toString());
         }
 
     }
 
-
-    private List<Repository> getRepositories()
-    {
+    private List<Repository> getRepositories() {
         List<Repository> repositories = new ArrayList<Repository>();
 
-        if ( featuresService == null )
-        {
-            this.log.error( "Shell Features service is unavailable." );
+        if (featuresService == null) {
+            this.log.error("Features service is not available");
             return repositories;
         }
 
-        try
-        {
-            for ( Repository r : featuresService.listRepositories() ) {
-                repositories.add( r );
+        try {
+            for (Repository r : featuresService.listRepositories()) {
+                repositories.add(r);
             }
-        }
-        catch ( Exception e )
-        {
-            this.log.error( e.getMessage() );
+        } catch (Exception e) {
+            this.log.error(e.getMessage());
         }
 
         return repositories;
     }
 
-
-    private List<ExtendedFeature> getFeatures( List<Repository> repositories
)
-    {
+    private List<ExtendedFeature> getFeatures(List<Repository> repositories)
{
         List<ExtendedFeature> features = new ArrayList<ExtendedFeature>();
 
-        if ( featuresService == null )
-        {
-            this.log.error( "Shell Features service is unavailable." );
+        if (featuresService == null) {
+            this.log.error("Features service is not available");
             return features;
         }
 
-        try
-        {
-            for ( Repository r : repositories )
-            {
-                for ( Feature f : r.getFeatures() )
-                {
+        try {
+            for (Repository r : repositories) {
+                for (Feature f : r.getFeatures()) {
                     ExtendedFeature.State state =
-                        featuresService.isInstalled(f) ? ExtendedFeature.State.INSTALLED
: ExtendedFeature.State.UNINSTALLED;
-                    features.add( new ExtendedFeature(  state, r.getName(), f ) );
+                            featuresService.isInstalled(f) ? ExtendedFeature.State.INSTALLED
: ExtendedFeature.State.UNINSTALLED;
+                    features.add(new ExtendedFeature(state, r.getName(), f));
                 }
             }
-        }
-        catch ( Exception e )
-        {
-            this.log.error( e.getMessage() );
+        } catch (Exception e) {
+            this.log.error(e.getMessage());
         }
 
-        Collections.sort( features, new ExtendedFeatureComparator() );
+        Collections.sort(features, new ExtendedFeatureComparator());
         return features;
     }
 
-
-    class ExtendedFeatureComparator implements Comparator<ExtendedFeature>
-    {
-        public int compare( ExtendedFeature o1, ExtendedFeature o2 )
-        {
-            return o1.getName().toLowerCase().compareTo( o2.getName().toLowerCase() );
+    class ExtendedFeatureComparator implements Comparator<ExtendedFeature> {
+        @Override
+        public int compare(ExtendedFeature o1, ExtendedFeature o2) {
+            return o1.getName().toLowerCase().compareTo(o2.getName().toLowerCase());
         }
     }
 
-
-    private String getStatusLine( final List<ExtendedFeature> features )
-    {
+    private String getStatusLine(final List<ExtendedFeature> features) {
         int installed = 0;
-        for ( ExtendedFeature f : features )
-        {
-            if ( f.getState() == ExtendedFeature.State.INSTALLED )
-            {
+        for (ExtendedFeature f : features) {
+            if (f.getState() == ExtendedFeature.State.INSTALLED) {
                 installed++;
             }
         }
         final StringBuffer buffer = new StringBuffer();
-        buffer.append( "Feature information: " );
-        appendFeatureInfoCount( buffer, "in total", features.size() );
-        if ( installed == features.size() )
-        {
-            buffer.append( " - all " );
-            appendFeatureInfoCount( buffer, "active.", features.size() );
-        }
-        else
-        {
-            if ( installed != 0 )
-            {
-                buffer.append( ", " );
-                appendFeatureInfoCount( buffer, "installed", installed );
+        buffer.append("Feature information: ");
+        appendFeatureInfoCount(buffer, "in total", features.size());
+        if (installed == features.size()) {
+            buffer.append(" - all ");
+            appendFeatureInfoCount(buffer, "active.", features.size());
+        } else {
+            if (installed != 0) {
+                buffer.append(", ");
+                appendFeatureInfoCount(buffer, "installed", installed);
             }
-            buffer.append( '.' );
+            buffer.append('.');
         }
         return buffer.toString();
     }
 
-
-    private void appendFeatureInfoCount( final StringBuffer buf, String msg, int count )
-    {
-        buf.append( count );
-        buf.append( " feature" );
-        if ( count != 1 )
-            buf.append( 's' );
-        buf.append( ' ' );
-        buf.append( msg );
+    private void appendFeatureInfoCount(final StringBuffer buf, String msg, int count) {
+        buf.append(count);
+        buf.append(" feature");
+        if (count != 1)
+            buf.append('s');
+        buf.append(' ');
+        buf.append(msg);
     }
 
-
-    private void featureInfo( JSONWriter jw, ExtendedFeature feature ) throws JSONException
-    {
+    private void featureInfo(JSONWriter jw, ExtendedFeature feature) throws JSONException
{
         jw.object();
-        jw.key( "id" );
-        jw.value( feature.getId() );
-        jw.key( "name" );
-        jw.value( feature.getName() );
-        jw.key( "version" );
-        jw.value( feature.getVersion() );
-        jw.key( "repository" );
-        jw.value( feature.getRepository() );
-        jw.key( "state" );
+        jw.key("id");
+        jw.value(feature.getId());
+        jw.key("name");
+        jw.value(feature.getName());
+        jw.key("version");
+        jw.value(feature.getVersion());
+        jw.key("repository");
+        jw.value(feature.getRepository());
+        jw.key("state");
         ExtendedFeature.State state = feature.getState();
-        jw.value( state.toString() );
+        jw.value(state.toString());
 
-        jw.key( "actions" );
+        jw.key("actions");
         jw.array();
 
-        if ( state == ExtendedFeature.State.INSTALLED )
-        {
-            action( jw, true, "uninstallFeature", "Uninstall", "delete" );
-        }
-        else if ( state == ExtendedFeature.State.UNINSTALLED )
-        {
-            action( jw, true, "installFeature", "Install", "start" );
+        if (state == ExtendedFeature.State.INSTALLED) {
+            action(jw, true, "uninstallFeature", "Uninstall", "delete");
+        } else if (state == ExtendedFeature.State.UNINSTALLED) {
+            action(jw, true, "installFeature", "Install", "start");
         }
         jw.endArray();
 
         jw.endObject();
     }
 
-
-    private void action( JSONWriter jw, boolean enabled, String op, String title, String
image ) throws JSONException
-    {
+    private void action(JSONWriter jw, boolean enabled, String op, String title, String image)
throws JSONException {
         jw.object();
-        jw.key( "enabled" ).value( enabled );
-        jw.key( "op" ).value( op );
-        jw.key( "title" ).value( title );
-        jw.key( "image" ).value( image );
+        jw.key("enabled").value(enabled);
+        jw.key("op").value(op);
+        jw.key("title").value(title);
+        jw.key("image").value(image);
         jw.endObject();
     }
 
-
-    //
-    // Dependency Injection setters
-    //
-
-    public void setFeaturesService(FeaturesService featuresService) 
-    {
+    public void setFeaturesService(FeaturesService featuresService) {
         this.featuresService = featuresService;
     }
 
-
-    public void setBundleContext(BundleContext bundleContext) 
-    {
+    public void setBundleContext(BundleContext bundleContext) {
         this.bundleContext = bundleContext;
     }
+
 }

Modified: karaf/trunk/webconsole/features/src/main/resources/OSGI-INF/blueprint/webconsole-features.xml
URL: http://svn.apache.org/viewvc/karaf/trunk/webconsole/features/src/main/resources/OSGI-INF/blueprint/webconsole-features.xml?rev=1478370&r1=1478369&r2=1478370&view=diff
==============================================================================
--- karaf/trunk/webconsole/features/src/main/resources/OSGI-INF/blueprint/webconsole-features.xml
(original)
+++ karaf/trunk/webconsole/features/src/main/resources/OSGI-INF/blueprint/webconsole-features.xml
Thu May  2 13:42:45 2013
@@ -17,8 +17,7 @@
     limitations under the License.
 
 -->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
-           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0">
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" default-activation="lazy">
 
     <reference id="featuresService" interface="org.apache.karaf.features.FeaturesService"
/>
 



Mime
View raw message