geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r771336 - in /geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint: BlueprintExtender.java context/BlueprintContextImpl.java
Date Mon, 04 May 2009 15:37:39 GMT
Author: gawor
Date: Mon May  4 15:37:39 2009
New Revision: 771336

URL: http://svn.apache.org/viewvc?rev=771336&view=rev
Log:
minor refactoring

Modified:
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/BlueprintExtender.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BlueprintContextImpl.java

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/BlueprintExtender.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/BlueprintExtender.java?rev=771336&r1=771335&r2=771336&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/BlueprintExtender.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/BlueprintExtender.java
Mon May  4 15:37:39 2009
@@ -145,11 +145,8 @@
             if (compatible) {
                 final BlueprintContextImpl blueprintContext = new BlueprintContextImpl(bundle.getBundleContext(),
sender, handlers, executors, urls, lazyActivation);
                 contextMap.put(bundle, blueprintContext);
-                if (lazyActivation) {
-                    blueprintContext.run();
-                } else {
-                    executors.submit(blueprintContext);
-                }
+                // run synchronous when bundle is lazy activated 
+                blueprintContext.run(lazyActivation ? false: true);
             } else {
                 LOGGER.info("Bundle {} is not compatible with this blueprint extender", bundle.getSymbolicName());
             }

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BlueprintContextImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BlueprintContextImpl.java?rev=771336&r1=771335&r2=771336&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BlueprintContextImpl.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BlueprintContextImpl.java
Mon May  4 15:37:39 2009
@@ -151,6 +151,14 @@
         }
     }
     
+    public void run(boolean asynch) {
+        if (asynch) {
+            executors.submit(this);
+        } else {
+            run();
+        }
+    }
+    
     public synchronized void run() {
         try {
             for (;;) {
@@ -447,13 +455,8 @@
         if (state == State.WaitForTrigger) {
             LOGGER.debug("Activation triggered (service activation: {})", serviceActivation);

             state = State.Create;
-            if (serviceActivation) {
-                // service triggered activation runs synchronously
-                run();
-            } else {
-                // classloader triggered activation runs asynchronously
-                executors.submit(this);
-            }
+            // service triggered activation runs synchronously but classloader triggered
activation runs asynchronously
+            run(serviceActivation ? false : true);
         }
     }
     



Mime
View raw message