incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r904019 - /sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/tasks/SynchronousRefreshPackagesTask.java
Date Thu, 28 Jan 2010 09:46:44 GMT
Author: bdelacretaz
Date: Thu Jan 28 09:46:43 2010
New Revision: 904019

URL: http://svn.apache.org/viewvc?rev=904019&view=rev
Log:
SLING-1305 - SynchronousRefreshPackagesTask might miss PACKAGES_REFRESHED event - patch contributed
by Marcel Reutegger, thanks!

Modified:
    sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/tasks/SynchronousRefreshPackagesTask.java

Modified: sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/tasks/SynchronousRefreshPackagesTask.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/tasks/SynchronousRefreshPackagesTask.java?rev=904019&r1=904018&r2=904019&view=diff
==============================================================================
--- sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/tasks/SynchronousRefreshPackagesTask.java
(original)
+++ sling/trunk/installer/osgi/installer/src/main/java/org/apache/sling/osgi/installer/impl/tasks/SynchronousRefreshPackagesTask.java
Thu Jan 28 09:46:43 2010
@@ -31,7 +31,7 @@
     /** Max time allowed to refresh packages (TODO configurable??) */
     public static final int MAX_REFRESH_PACKAGES_WAIT_SECONDS = 30;
 
-	private int packageRefreshEventsCount;
+	private volatile int packageRefreshEventsCount;
 	private OsgiInstallerContext ctx;
 
     /**
@@ -84,9 +84,9 @@
 
         // It seems like (at least with Felix 1.0.4) we won't get a FrameworkEvent.PACKAGES_REFRESHED
         // if one happened very recently and there's nothing to refresh
-        ctx.getPackageAdmin().refreshPackages(null);
         ctx.getBundleContext().addFrameworkListener(this);
         try {
+            ctx.getPackageAdmin().refreshPackages(null);
             while(true) {
                 if(System.currentTimeMillis() > timeout) {
                 	if(ctx.getLogService() != null) {



Mime
View raw message