servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r679841 - in /servicemix/smx4/kernel/trunk: assembly/src/main/distribution/text/etc/ gshell/gshell-core/src/main/resources/org/apache/geronimo/gshell/spring/etc/ gshell/gshell-features/src/main/java/org/apache/servicemix/gshell/features/int...
Date Fri, 25 Jul 2008 15:53:45 GMT
Author: gnodet
Date: Fri Jul 25 08:53:44 2008
New Revision: 679841

URL: http://svn.apache.org/viewvc?rev=679841&view=rev
Log:
SMX4KNL-67: Allow the features service to obtain a list of features to install at startup

Modified:
    servicemix/smx4/kernel/trunk/assembly/src/main/distribution/text/etc/org.apache.servicemix.features.cfg
    servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/org/apache/geronimo/gshell/spring/etc/org.apache.servicemix.features.cfg
    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/resources/META-INF/spring/gshell-features.xml

Modified: servicemix/smx4/kernel/trunk/assembly/src/main/distribution/text/etc/org.apache.servicemix.features.cfg
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/assembly/src/main/distribution/text/etc/org.apache.servicemix.features.cfg?rev=679841&r1=679840&r2=679841&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/assembly/src/main/distribution/text/etc/org.apache.servicemix.features.cfg
(original)
+++ servicemix/smx4/kernel/trunk/assembly/src/main/distribution/text/etc/org.apache.servicemix.features.cfg
Fri Jul 25 08:53:44 2008
@@ -18,4 +18,11 @@
 ################################################################################
 
 #
+# Comma separated list of features repositories to register by default
+#
 featuresRepositories=http://svn.apache.org/repos/asf/servicemix/smx4/obr-repo/features.xml
+
+#
+# Comma separated list of features to install at startup
+#
+featuresBoot=

Modified: servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/org/apache/geronimo/gshell/spring/etc/org.apache.servicemix.features.cfg
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/org/apache/geronimo/gshell/spring/etc/org.apache.servicemix.features.cfg?rev=679841&r1=679840&r2=679841&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/org/apache/geronimo/gshell/spring/etc/org.apache.servicemix.features.cfg
(original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/org/apache/geronimo/gshell/spring/etc/org.apache.servicemix.features.cfg
Fri Jul 25 08:53:44 2008
@@ -18,4 +18,11 @@
 ################################################################################
 
 #
+# Comma separated list of features repositories to register by default
+#
 featuresRepositories=http://svn.apache.org/repos/asf/servicemix/smx4/obr-repo/features.xml
+
+#
+# Comma separated list of features to install at startup
+#
+featuresBoot=

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=679841&r1=679840&r2=679841&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
Fri Jul 25 08:53:44 2008
@@ -72,6 +72,7 @@
     private Map<URI, RepositoryImpl> repositories = new HashMap<URI, RepositoryImpl>();
     private Map<String, Feature> features;
     private Map<String, Set<Long>> installed = new HashMap<String, Set<Long>>();
+    private String boot;
 
     public BundleContext getBundleContext() {
         return bundleContext;
@@ -105,6 +106,10 @@
         }
     }
 
+    public void setBoot(String boot) {
+        this.boot = boot;
+    }
+
     public void addRepository(URI uri) throws Exception {
         internalAddRepository(uri);
         saveState();
@@ -251,6 +256,20 @@
             }
             saveState();
         }
+        if (boot != null) {
+            new Thread() {
+                public void run() {
+                    String[] list = boot.split(",");
+                    for (String f : list) {
+                        try {
+                            installFeature(f);
+                        } catch (Exception e) {
+                            LOGGER.error("Error installing boot feature " + f, e);
+                        }
+                    }
+                }
+            }.start();
+        }
     }
 
     public void stop() throws Exception {

Modified: servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/resources/META-INF/spring/gshell-features.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/resources/META-INF/spring/gshell-features.xml?rev=679841&r1=679840&r2=679841&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/resources/META-INF/spring/gshell-features.xml
(original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-features/src/main/resources/META-INF/spring/gshell-features.xml
Fri Jul 25 08:53:44 2008
@@ -48,6 +48,7 @@
 
     <bean id="featuresService" class="org.apache.servicemix.gshell.features.internal.FeaturesServiceImpl"
init-method="start" destroy-method="stop">
         <property name="urls" value="${featuresRepositories}" />
+        <property name="boot" value="${featuresBoot}" />
         <property name="configAdmin" ref="configAdmin" />
         <property name="preferences" ref="preferences" />
     </bean>
@@ -110,6 +111,7 @@
     <osgix:property-placeholder persistent-id="org.apache.servicemix.features">
         <osgix:default-properties>
             <prop key="featuresRepositories"></prop>
+            <prop key="featuresBoot"></prop>
         </osgix:default-properties>
     </osgix:property-placeholder>
 



Mime
View raw message