felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r959217 - /felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
Date Wed, 30 Jun 2010 07:17:28 GMT
Author: gnodet
Date: Wed Jun 30 07:17:27 2010
New Revision: 959217

URL: http://svn.apache.org/viewvc?rev=959217&view=rev
Log:
FELIX-1657: Add option in fileinstall to start bundles transiently (START_TRANSIENT)

Modified:
    felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java

Modified: felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
URL: http://svn.apache.org/viewvc/felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java?rev=959217&r1=959216&r2=959217&view=diff
==============================================================================
--- felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
(original)
+++ felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
Wed Jun 30 07:17:27 2010
@@ -87,6 +87,7 @@ public class DirectoryWatcher extends Th
     public final static String TMPDIR = "felix.fileinstall.tmpdir";
     public final static String FILTER = "felix.fileinstall.filter";
     public final static String START_NEW_BUNDLES = "felix.fileinstall.bundles.new.start";
+    public final static String USE_START_TRANSIENT = "felix.fileinstall.bundles.startTransient";
     public final static String NO_INITIAL_DELAY = "felix.fileinstall.noInitialDelay";
 
     static final SecureRandom random = new SecureRandom();
@@ -99,6 +100,7 @@ public class DirectoryWatcher extends Th
     long poll;
     int logLevel;
     boolean startBundles;
+    boolean useStartTransient;
     String filter;
     BundleContext context;
     String originatingFileName;
@@ -129,6 +131,7 @@ public class DirectoryWatcher extends Th
         tmpDir = getFile(properties, TMPDIR, null);
         prepareTempDir();
         startBundles = getBoolean(properties, START_NEW_BUNDLES, true);  // by default, we
start bundles.
+        useStartTransient = getBoolean(properties, USE_START_TRANSIENT, false);  // by default,
we start bundles persistently.
         filter = (String) properties.get(FILTER);
         noInitialDelay = getBoolean(properties, NO_INITIAL_DELAY, false);
         this.context.addBundleListener(this);
@@ -1101,7 +1104,7 @@ public class DirectoryWatcher extends Th
                 if (bundle != null)
                 {
                     if (bundle.getState() != Bundle.STARTING && bundle.getState()
!= Bundle.ACTIVE
-                        && FileInstall.getStartLevel().isBundlePersistentlyStarted(bundle)
+                        && (useStartTransient || FileInstall.getStartLevel().isBundlePersistentlyStarted(bundle))
                         && FileInstall.getStartLevel().getStartLevel() >= FileInstall.getStartLevel().getBundleStartLevel(bundle))
                     {
                         bundles.add(bundle);
@@ -1130,7 +1133,7 @@ public class DirectoryWatcher extends Th
         {
             try
             {
-                bundle.start();
+                bundle.start(useStartTransient ? Bundle.START_TRANSIENT : 0);
                 log(Logger.LOG_INFO, "Started bundle: " + bundle.getLocation(), null);
             }
             catch (BundleException e)



Mime
View raw message