aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guillaume Nodet (JIRA)" <>
Subject [jira] Commented: (ARIES-536) Have a way to specify a blueprint bundle should be started in sync with the start level service as much as possible
Date Wed, 19 Jan 2011 11:48:43 GMT


Guillaume Nodet commented on ARIES-536:

I'm experimenting with the following patch:

diff --git a/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/
index 74ea5ed..d83c3d1 100644
--- a/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/
+++ b/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/
@@ -31,7 +31,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.atomic.AtomicReference;
 import org.apache.aries.blueprint.BlueprintConstants;
 import org.apache.aries.blueprint.ParserService;
@@ -54,8 +53,6 @@ import org.osgi.framework.SynchronousBundleListener;
 import org.osgi.service.blueprint.container.BlueprintContainer;
 import org.osgi.service.blueprint.container.BlueprintEvent;
 import org.osgi.util.tracker.BundleTrackerCustomizer;
-import org.osgi.util.tracker.ServiceTracker;
-import org.osgi.util.tracker.ServiceTrackerCustomizer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -313,7 +310,14 @@ public class BlueprintExtender implements BundleActivator, SynchronousBundleList
                 if (compatible) {
                     final BlueprintContainerImpl blueprintContainer = new BlueprintContainerImpl(bundle.getBundleContext(),
context.getBundle(), eventDispatcher, handlers, executors,
                     containers.put(bundle, blueprintContainer);
-                    blueprintContainer.schedule();
+                    String val = context.getProperty("org.apache.aries.blueprint.synchronous");
+                    if (Boolean.parseBoolean(val)) {
+                        LOGGER.debug("Starting creation of blueprint bundle {} synchronously",
+              ;
+                    } else {
+                        LOGGER.debug("Scheduling creation of blueprint bundle {} asynchronously",
+                        blueprintContainer.schedule();
+                    }
                 } else {
           "Bundle {} is not compatible with this blueprint extender",

It will simply start the initlal processing of the blueprint bundle synchronously up to the
end or any missing dependency.

> Have a way to specify a blueprint bundle should be started in sync with the start level
service as much as possible
> -------------------------------------------------------------------------------------------------------------------
>                 Key: ARIES-536
>                 URL:
>             Project: Aries
>          Issue Type: New Feature
>          Components: Blueprint
>            Reporter: Guillaume Nodet
> The use case is for ordering startup using start-level.  If you have a bundle that has
an optional dependency on a service provided by blueprint, you have no way to raise the chances
that the service will be used from the start as blueprint bundles are started asynchronously.
> I'd like to have a way to specifiy that the blueprint bundle should be started asynchronously,
at least until a GRACE_PERIOD event would be fired, in which case, the remaning things would
be done asynchronously.
> This definitely should not be used as a way to work around bad bundle behaviors that
aren't resiliant with missing dependencies, but really to ensure that when the server boots
up, services are started in an optimal order (log and  configadmin should be started before
the other ones if possible).

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message