geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r768734 - in /geronimo/sandbox/blueprint: blueprint-core/src/main/java/org/apache/geronimo/blueprint/ blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/ blueprint-itests/src/test/java/org/apache/geronimo/blueprint/itests/
Date Sun, 26 Apr 2009 18:17:43 GMT
Author: gnodet
Date: Sun Apr 26 18:17:43 2009
New Revision: 768734

URL: http://svn.apache.org/viewvc?rev=768734&view=rev
Log:
Replace all references to moduleContext by blueprintContext

Added:
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/BlueprintContextEventSender.java
      - copied, changed from r768689, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ModuleContextEventSender.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/DefaultBlueprintContextEventSender.java
      - copied, changed from r768689, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/DefaultModuleContextEventSender.java
Removed:
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ModuleContextEventSender.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/DefaultModuleContextEventSender.java
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/AbstractServiceReferenceRecipe.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BlueprintContextImpl.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BundleScopeServiceFactory.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/CollectionBasedServiceReferenceRecipe.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Instanciator.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/ServiceRegistrationProxy.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/UnaryServiceReferenceRecipe.java
    geronimo/sandbox/blueprint/blueprint-itests/src/test/java/org/apache/geronimo/blueprint/itests/TestBlueprintContext.java

Copied: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/BlueprintContextEventSender.java
(from r768689, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ModuleContextEventSender.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/BlueprintContextEventSender.java?p2=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/BlueprintContextEventSender.java&p1=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ModuleContextEventSender.java&r1=768689&r2=768734&rev=768734&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/ModuleContextEventSender.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/BlueprintContextEventSender.java
Sun Apr 26 18:17:43 2009
@@ -26,14 +26,14 @@
  * @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
  * @version $Rev: 760378 $, $Date: 2009-03-31 11:31:38 +0200 (Tue, 31 Mar 2009) $
  */
-public interface ModuleContextEventSender extends Destroyable {
+public interface BlueprintContextEventSender extends Destroyable {
 
-    void sendCreating(BlueprintContext moduleContext);
-    void sendCreated(BlueprintContext moduleContext);
-    void sendDestroying(BlueprintContext moduleContext);
-    void sendDestroyed(BlueprintContext moduleContext);
-    void sendWaiting(BlueprintContext moduleContext, String[] serviceObjectClass, String
serviceFilter);
-    void sendFailure(BlueprintContext moduleContext, Throwable cause);
-    void sendFailure(BlueprintContext moduleContext, Throwable cause, String[] serviceObjectClass,
String serviceFilter);
+    void sendCreating(BlueprintContext blueprintContext);
+    void sendCreated(BlueprintContext blueprintContext);
+    void sendDestroying(BlueprintContext blueprintContext);
+    void sendDestroyed(BlueprintContext blueprintContext);
+    void sendWaiting(BlueprintContext blueprintContext, String[] serviceObjectClass, String
serviceFilter);
+    void sendFailure(BlueprintContext blueprintContext, Throwable cause);
+    void sendFailure(BlueprintContext blueprintContext, Throwable cause, String[] serviceObjectClass,
String serviceFilter);
 
 }

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=768734&r1=768733&r2=768734&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
Sun Apr 26 18:17:43 2009
@@ -29,7 +29,7 @@
 import java.util.concurrent.Executors;
 
 import org.apache.geronimo.blueprint.utils.HeaderParser.PathElement;
-import org.apache.geronimo.blueprint.context.DefaultModuleContextEventSender;
+import org.apache.geronimo.blueprint.context.DefaultBlueprintContextEventSender;
 import org.apache.geronimo.blueprint.context.BlueprintContextImpl;
 import org.apache.geronimo.blueprint.namespace.NamespaceHandlerRegistryImpl;
 import org.apache.geronimo.blueprint.utils.HeaderParser;
@@ -54,14 +54,14 @@
 
     private final ExecutorService executors = Executors.newSingleThreadExecutor();
     private final Map<Bundle, BlueprintContextImpl> contextMap = new HashMap<Bundle,
BlueprintContextImpl>();
-    private ModuleContextEventSender sender;
+    private BlueprintContextEventSender sender;
     private NamespaceHandlerRegistry handlers;
 
     public void start(BundleContext context) {
         LOGGER.debug("Starting blueprint extender...");
         context.addBundleListener(this);
 
-        sender = new DefaultModuleContextEventSender(context);
+        sender = new DefaultBlueprintContextEventSender(context);
         handlers = new NamespaceHandlerRegistryImpl(context);
 
         Bundle[] bundles = context.getBundles();
@@ -95,10 +95,10 @@
     }
 
     private void destroyContext(Bundle bundle) {
-        BlueprintContextImpl moduleContext = contextMap.remove(bundle);
-        if (moduleContext != null) {
+        BlueprintContextImpl blueprintContext = contextMap.remove(bundle);
+        if (blueprintContext != null) {
             LOGGER.debug("Destroying BlueprintContext for bundle {}", bundle.getSymbolicName());
-            moduleContext.destroy();
+            blueprintContext.destroy();
         }
     }
     
@@ -138,9 +138,9 @@
                 compatible = true;
             }
             if (compatible) {
-                final BlueprintContextImpl moduleContext = new BlueprintContextImpl(bundle.getBundleContext(),
sender, handlers, executors, urls);
-                contextMap.put(bundle, moduleContext);
-                executors.submit(moduleContext);
+                final BlueprintContextImpl blueprintContext = new BlueprintContextImpl(bundle.getBundleContext(),
sender, handlers, executors, urls);
+                contextMap.put(bundle, blueprintContext);
+                executors.submit(blueprintContext);
             } 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/AbstractServiceReferenceRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/AbstractServiceReferenceRecipe.java?rev=768734&r1=768733&r2=768734&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/AbstractServiceReferenceRecipe.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/AbstractServiceReferenceRecipe.java
Sun Apr 26 18:17:43 2009
@@ -32,7 +32,7 @@
 import org.apache.xbean.recipe.AbstractRecipe;
 import org.apache.xbean.recipe.Recipe;
 import org.apache.xbean.recipe.ConstructionException;
-import org.apache.geronimo.blueprint.ModuleContextEventSender;
+import org.apache.geronimo.blueprint.BlueprintContextEventSender;
 import org.apache.geronimo.blueprint.BlueprintConstants;
 import org.apache.geronimo.blueprint.Destroyable;
 import org.apache.geronimo.blueprint.SatisfiableRecipe;
@@ -55,8 +55,8 @@
  */
 public abstract class AbstractServiceReferenceRecipe extends AbstractRecipe implements ServiceListener,
Destroyable, SatisfiableRecipe {
 
-    protected final BlueprintContext moduleContext;
-    protected final ModuleContextEventSender sender;
+    protected final BlueprintContext blueprintContext;
+    protected final BlueprintContextEventSender sender;
     protected final ServiceReferenceMetadata metadata;
     protected final Recipe listenersRecipe;
     protected List<Listener> listeners;
@@ -66,17 +66,17 @@
     private boolean satisfied;
     private final List<SatisfactionListener> satisfactionListeners = new CopyOnWriteArrayList<SatisfactionListener>();
 
-    protected AbstractServiceReferenceRecipe(BlueprintContext moduleContext,
-                                             ModuleContextEventSender sender,
+    protected AbstractServiceReferenceRecipe(BlueprintContext blueprintContext,
+                                             BlueprintContextEventSender sender,
                                              ServiceReferenceMetadata metadata,
                                              Recipe listenersRecipe) {
-        this.moduleContext = moduleContext;
+        this.blueprintContext = blueprintContext;
         this.sender = sender;
         this.metadata = metadata;
         this.listenersRecipe = listenersRecipe;
         // Create a ClassLoader delegating to the bundle, but also being able to see our
bundle classes
         // so that the created proxy can access cglib classes.
-        this.proxyClassLoader = new BundleDelegatingClassLoader(moduleContext.getBundleContext().getBundle(),
+        this.proxyClassLoader = new BundleDelegatingClassLoader(blueprintContext.getBundleContext().getBundle(),
                                                                 getClass().getClassLoader());
     }
 

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=768734&r1=768733&r2=768734&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
Sun Apr 26 18:17:43 2009
@@ -35,7 +35,7 @@
 import org.apache.geronimo.blueprint.utils.HeaderParser;
 import org.apache.geronimo.blueprint.utils.BundleDelegatingClassLoader;
 import org.apache.geronimo.blueprint.utils.HeaderParser.PathElement;
-import org.apache.geronimo.blueprint.ModuleContextEventSender;
+import org.apache.geronimo.blueprint.BlueprintContextEventSender;
 import org.apache.geronimo.blueprint.NamespaceHandlerRegistry;
 import org.apache.geronimo.blueprint.Destroyable;
 import org.apache.geronimo.blueprint.SatisfiableRecipe;
@@ -85,7 +85,7 @@
     }
 
     private final BundleContext bundleContext;
-    private final ModuleContextEventSender sender;
+    private final BlueprintContextEventSender sender;
     private final NamespaceHandlerRegistry handlers;
     private final List<URL> urls;
     private final ComponentDefinitionRegistryImpl helperComponentDefinitionRegistry;
@@ -102,7 +102,7 @@
     private Map<String, List<SatisfiableRecipe>> satisfiables;
     private ClassLoader classLoader;
 
-    public BlueprintContextImpl(BundleContext bundleContext, ModuleContextEventSender sender,
NamespaceHandlerRegistry handlers, ExecutorService executors, List<URL> urls) {
+    public BlueprintContextImpl(BundleContext bundleContext, BlueprintContextEventSender
sender, NamespaceHandlerRegistry handlers, ExecutorService executors, List<URL> urls)
{
         this.bundleContext = bundleContext;
         this.sender = sender;
         this.handlers = handlers;
@@ -122,7 +122,7 @@
         destroyables.put(name, destroyable);
     }
 
-    public ModuleContextEventSender getSender() {
+    public BlueprintContextEventSender getSender() {
         return sender;
     }
 
@@ -199,7 +199,7 @@
                         instantiateComponents();
                         registerAllServices();
 
-                        // Register the ModuleContext in the OSGi registry
+                        // Register the BlueprintContext in the OSGi registry
                         if (registration == null) {
                             Properties props = new Properties();
                             props.put(BlueprintConstants.CONTEXT_SYMBOLIC_NAME_PROPERTY,

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BundleScopeServiceFactory.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BundleScopeServiceFactory.java?rev=768734&r1=768733&r2=768734&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BundleScopeServiceFactory.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/BundleScopeServiceFactory.java
Sun Apr 26 18:17:43 2009
@@ -35,12 +35,12 @@
  */
 public class BundleScopeServiceFactory implements ServiceFactory {
 
-    private BlueprintContextImpl moduleContext;
+    private BlueprintContextImpl blueprintContext;
     private BlueprintObjectRecipe serviceRecipe;
-    private Map<Bundle, Entry> instanceMap = Collections.synchronizedMap(new HashMap<Bundle,
Entry>()); 
-    
-    public BundleScopeServiceFactory(BlueprintContextImpl moduleContext, BlueprintObjectRecipe
serviceRecipe) {
-        this.moduleContext = moduleContext;
+    private Map<Bundle, Entry> instanceMap = Collections.synchronizedMap(new HashMap<Bundle,
Entry>());
+
+    public BundleScopeServiceFactory(BlueprintContextImpl blueprintContext, BlueprintObjectRecipe
serviceRecipe) {
+        this.blueprintContext = blueprintContext;
         this.serviceRecipe = serviceRecipe;
     }
     
@@ -73,7 +73,7 @@
     }
   
     private Object createInstance() {
-        Repository objectRepository = moduleContext.getObjectGraph().getRepository();
+        Repository objectRepository = blueprintContext.getObjectGraph().getRepository();
         ScopedRepository repository = new ScopedRepository((ScopedRepository)objectRepository);
         repository.set(serviceRecipe.getName(), serviceRecipe);
         ObjectGraph graph = new ObjectGraph(repository);

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/CollectionBasedServiceReferenceRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/CollectionBasedServiceReferenceRecipe.java?rev=768734&r1=768733&r2=768734&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/CollectionBasedServiceReferenceRecipe.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/CollectionBasedServiceReferenceRecipe.java
Sun Apr 26 18:17:43 2009
@@ -33,7 +33,7 @@
 
 import net.sf.cglib.proxy.Dispatcher;
 import org.apache.geronimo.blueprint.Destroyable;
-import org.apache.geronimo.blueprint.ModuleContextEventSender;
+import org.apache.geronimo.blueprint.BlueprintContextEventSender;
 import org.apache.geronimo.blueprint.utils.DynamicSortedList;
 import org.apache.geronimo.blueprint.utils.DynamicList;
 import org.apache.geronimo.blueprint.utils.DynamicSet;
@@ -47,7 +47,6 @@
 import org.osgi.framework.InvalidSyntaxException;
 import org.osgi.service.blueprint.context.BlueprintContext;
 import org.osgi.service.blueprint.reflect.RefCollectionMetadata;
-import org.osgi.service.blueprint.reflect.ReferenceMetadata;
 
 /**
  * A recipe to create a managed collection of service references
@@ -63,12 +62,12 @@
     private ManagedCollection collection;
     private final boolean optional;
 
-    public CollectionBasedServiceReferenceRecipe(BlueprintContext moduleContext,
-                                                 ModuleContextEventSender sender,
+    public CollectionBasedServiceReferenceRecipe(BlueprintContext blueprintContext,
+                                                 BlueprintContextEventSender sender,
                                                  RefCollectionMetadata metadata,
                                                  Recipe listenersRecipe,
                                                  Recipe comparatorRecipe) {
-        super(moduleContext, sender, metadata, listenersRecipe);
+        super(blueprintContext, sender, metadata, listenersRecipe);
         this.metadata = metadata;
         this.comparatorRecipe = comparatorRecipe;
         this.optional = metadata.getAvailability() == RefCollectionMetadata.OPTIONAL_AVAILABILITY;
@@ -115,7 +114,7 @@
             }
 
             // Start tracking the service
-            moduleContext.getBundleContext().addServiceListener(this, getOsgiFilter());
+            blueprintContext.getBundleContext().addServiceListener(this, getOsgiFilter());
             retrack();
 
             return collection;
@@ -126,7 +125,7 @@
     }
 
     public void destroy() {
-        moduleContext.getBundleContext().removeServiceListener(this);
+        blueprintContext.getBundleContext().removeServiceListener(this);
         List<ServiceDispatcher> dispatchers = new ArrayList<ServiceDispatcher>(collection.getDispatchers());
         for (ServiceDispatcher dispatcher : dispatchers) {
             untrack(dispatcher.reference);
@@ -135,7 +134,7 @@
 
     private void retrack() {
         try {
-            ServiceReference[] refs = moduleContext.getBundleContext().getServiceReferences(null,
getOsgiFilter());
+            ServiceReference[] refs = blueprintContext.getBundleContext().getServiceReferences(null,
getOsgiFilter());
             if (refs != null) {
                 for (ServiceReference ref : refs) {
                     track(ref);

Copied: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/DefaultBlueprintContextEventSender.java
(from r768689, geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/DefaultModuleContextEventSender.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/DefaultBlueprintContextEventSender.java?p2=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/DefaultBlueprintContextEventSender.java&p1=geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/DefaultModuleContextEventSender.java&r1=768689&r2=768734&rev=768734&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/DefaultModuleContextEventSender.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/DefaultBlueprintContextEventSender.java
Sun Apr 26 18:17:43 2009
@@ -32,7 +32,7 @@
 import org.osgi.service.blueprint.context.BlueprintContext;
 import org.osgi.service.blueprint.context.BlueprintContextListener;
 import org.apache.geronimo.blueprint.BlueprintConstants;
-import org.apache.geronimo.blueprint.ModuleContextEventSender;
+import org.apache.geronimo.blueprint.BlueprintContextEventSender;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -42,15 +42,15 @@
  * @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
  * @version $Rev: 760378 $, $Date: 2009-03-31 11:31:38 +0200 (Tue, 31 Mar 2009) $
  */
-public class DefaultModuleContextEventSender implements ModuleContextEventSender, EventConstants
{
+public class DefaultBlueprintContextEventSender implements BlueprintContextEventSender, EventConstants
{
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(DefaultModuleContextEventSender.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(DefaultBlueprintContextEventSender.class);
 
     private final Bundle extenderBundle;
     private final ServiceTracker eventAdminServiceTracker;
     private final ServiceTracker contextListenerTracker;
 
-    public DefaultModuleContextEventSender(BundleContext bundleContext) {
+    public DefaultBlueprintContextEventSender(BundleContext bundleContext) {
         this.extenderBundle = bundleContext.getBundle();
         this.eventAdminServiceTracker = new ServiceTracker(bundleContext, EventAdmin.class.getName(),
null);
         this.eventAdminServiceTracker.open();
@@ -58,41 +58,41 @@
         this.contextListenerTracker.open();
     }
 
-    public void sendCreating(BlueprintContext moduleContext) {
-        sendEvent(moduleContext, TOPIC_CREATING, null, null, null);
+    public void sendCreating(BlueprintContext blueprintContext) {
+        sendEvent(blueprintContext, TOPIC_CREATING, null, null, null);
     }
 
-    public void sendCreated(BlueprintContext moduleContext) {
-        sendEvent(moduleContext, TOPIC_CREATED, null, null, null);
+    public void sendCreated(BlueprintContext blueprintContext) {
+        sendEvent(blueprintContext, TOPIC_CREATED, null, null, null);
     }
 
-    public void sendDestroying(BlueprintContext moduleContext) {
-        sendEvent(moduleContext, TOPIC_DESTROYING, null, null, null);
+    public void sendDestroying(BlueprintContext blueprintContext) {
+        sendEvent(blueprintContext, TOPIC_DESTROYING, null, null, null);
     }
 
-    public void sendDestroyed(BlueprintContext moduleContext) {
-        sendEvent(moduleContext, TOPIC_DESTROYED, null, null, null);
+    public void sendDestroyed(BlueprintContext blueprintContext) {
+        sendEvent(blueprintContext, TOPIC_DESTROYED, null, null, null);
     }
 
-    public void sendWaiting(BlueprintContext moduleContext, String[] serviceObjectClass,
String serviceFilter) {
-        sendEvent(moduleContext, TOPIC_WAITING, null, serviceObjectClass, serviceFilter);
+    public void sendWaiting(BlueprintContext blueprintContext, String[] serviceObjectClass,
String serviceFilter) {
+        sendEvent(blueprintContext, TOPIC_WAITING, null, serviceObjectClass, serviceFilter);
     }
 
-    public void sendFailure(BlueprintContext moduleContext, Throwable cause) {
-        sendEvent(moduleContext, TOPIC_FAILURE, cause, null, null);
+    public void sendFailure(BlueprintContext blueprintContext, Throwable cause) {
+        sendEvent(blueprintContext, TOPIC_FAILURE, cause, null, null);
     }
 
-    public void sendFailure(BlueprintContext moduleContext, Throwable cause, String[] serviceObjectClass,
String serviceFilter) {
-        sendEvent(moduleContext, TOPIC_FAILURE, cause, serviceObjectClass, serviceFilter);
+    public void sendFailure(BlueprintContext blueprintContext, Throwable cause, String[]
serviceObjectClass, String serviceFilter) {
+        sendEvent(blueprintContext, TOPIC_FAILURE, cause, serviceObjectClass, serviceFilter);
     }
 
-    public void sendEvent(BlueprintContext moduleContext, String topic, Throwable cause,
String[] serviceObjectClass, String serviceFilter) {
+    public void sendEvent(BlueprintContext blueprintContext, String topic, Throwable cause,
String[] serviceObjectClass, String serviceFilter) {
 
-        Bundle bundle = moduleContext.getBundleContext().getBundle();
+        Bundle bundle = blueprintContext.getBundleContext().getBundle();
 
         LOGGER.debug("Sending blueprint context event {} for bundle {}", topic, bundle.getSymbolicName());
 
-        callListeners(moduleContext, topic, cause);
+        callListeners(blueprintContext, topic, cause);
 
         EventAdmin eventAdmin = getEventAdmin();
         if (eventAdmin == null) {
@@ -126,7 +126,7 @@
         eventAdmin.postEvent(event);
     }
 
-    private void callListeners(BlueprintContext moduleContext, String topic, Throwable cause)
{
+    private void callListeners(BlueprintContext blueprintContext, String topic, Throwable
cause) {
         boolean created = TOPIC_CREATED.equals(topic);
         boolean failure = TOPIC_FAILURE.equals(topic);
         if (created || failure) {
@@ -135,9 +135,9 @@
                 for (Object listener : listeners) {
                     try {
                         if (created) {
-                            ((BlueprintContextListener) listener).contextCreated(moduleContext.getBundleContext().getBundle());
+                            ((BlueprintContextListener) listener).contextCreated(blueprintContext.getBundleContext().getBundle());
                         } else {
-                            ((BlueprintContextListener) listener).contextCreationFailed(moduleContext.getBundleContext().getBundle(),
cause);
+                            ((BlueprintContextListener) listener).contextCreationFailed(blueprintContext.getBundleContext().getBundle(),
cause);
                         }
                     } catch (Throwable t) {
                         LOGGER.info("Error calling blueprint context listener", t);

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Instanciator.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Instanciator.java?rev=768734&r1=768733&r2=768734&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Instanciator.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Instanciator.java
Sun Apr 26 18:17:43 2009
@@ -172,7 +172,7 @@
         recipe.allow(Option.PRIVATE_PROPERTIES);
         recipe.setName(serviceExport.getId());
         recipe.setExplicitDependencies(serviceExport.getExplicitDependencies());
-        recipe.setProperty("moduleContext", blueprintContext);
+        recipe.setProperty("blueprintContext", blueprintContext);
         BeanMetadata exportedComponent = getLocalServiceComponent(serviceExport.getServiceComponent());
         if (exportedComponent != null && BeanMetadata.SCOPE_BUNDLE.equals(exportedComponent.getScope()))
{
             BlueprintObjectRecipe exportedComponentRecipe = createBeanRecipe(exportedComponent);

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/ServiceRegistrationProxy.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/ServiceRegistrationProxy.java?rev=768734&r1=768733&r2=768734&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/ServiceRegistrationProxy.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/ServiceRegistrationProxy.java
Sun Apr 26 18:17:43 2009
@@ -41,7 +41,7 @@
  */
 public class ServiceRegistrationProxy implements ServiceRegistration {
   
-    private BlueprintContext moduleContext;
+    private BlueprintContext blueprintContext;
     private Object service;
     private Map serviceProperties;
     private List<Listener> listeners;
@@ -49,7 +49,7 @@
 
     private ServiceRegistration registration = null;
     private Map registrationProperties = null;
-    
+
     protected Object getService() {
         return service;
     }
@@ -98,7 +98,7 @@
             props.put(BlueprintConstants.COMPONENT_NAME_PROPERTY, componentName);
         }
         String[] classesArray = classes.toArray(new String[classes.size()]);
-        registration = moduleContext.getBundleContext().registerService(classesArray, service,
props);
+        registration = blueprintContext.getBundleContext().registerService(classesArray,
service, props);
         registrationProperties = props;
         
         System.out.println("service registered: " + service + " " + classes);

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/UnaryServiceReferenceRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/UnaryServiceReferenceRecipe.java?rev=768734&r1=768733&r2=768734&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/UnaryServiceReferenceRecipe.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/UnaryServiceReferenceRecipe.java
Sun Apr 26 18:17:43 2009
@@ -25,7 +25,7 @@
 import java.util.HashSet;
 
 import net.sf.cglib.proxy.Dispatcher;
-import org.apache.geronimo.blueprint.ModuleContextEventSender;
+import org.apache.geronimo.blueprint.BlueprintContextEventSender;
 import org.apache.xbean.recipe.ConstructionException;
 import org.apache.xbean.recipe.ExecutionContext;
 import org.apache.xbean.recipe.Recipe;
@@ -56,11 +56,11 @@
     private final Object monitor = new Object();
     private final boolean optional;
 
-    public UnaryServiceReferenceRecipe(BlueprintContext moduleContext,
-                                       ModuleContextEventSender sender,
+    public UnaryServiceReferenceRecipe(BlueprintContext blueprintContext,
+                                       BlueprintContextEventSender sender,
                                        ReferenceMetadata metadata,
                                        Recipe listenersRecipe) {
-        super(moduleContext,  sender, metadata, listenersRecipe);
+        super(blueprintContext,  sender, metadata, listenersRecipe);
         this.metadata = metadata;
         this.optional = metadata.getAvailability() == ReferenceMetadata.OPTIONAL_AVAILABILITY;
         if (this.optional) {
@@ -81,7 +81,7 @@
             }
 
             // Start tracking the service
-            moduleContext.getBundleContext().addServiceListener(this, getOsgiFilter());
+            blueprintContext.getBundleContext().addServiceListener(this, getOsgiFilter());
             retrack();
 
             // Return the object
@@ -97,7 +97,7 @@
     }
 
     public void destroy() {
-        moduleContext.getBundleContext().removeServiceListener(this);
+        blueprintContext.getBundleContext().removeServiceListener(this);
         unbind();
     }
 
@@ -110,7 +110,7 @@
 
     private void retrack() {
         try {
-            ServiceReference[] refs = moduleContext.getBundleContext().getServiceReferences(null,
getOsgiFilter());
+            ServiceReference[] refs = blueprintContext.getBundleContext().getServiceReferences(null,
getOsgiFilter());
             ServiceReference ref = getBestServiceReference(refs);
             if (ref != null) {
                 bind(ref);
@@ -140,10 +140,10 @@
     private void bind(ServiceReference ref) {
         synchronized (monitor) {
             if (trackedServiceReference != null) {
-                moduleContext.getBundleContext().ungetService(trackedServiceReference);
+                blueprintContext.getBundleContext().ungetService(trackedServiceReference);
             }
             trackedServiceReference = ref;
-            trackedService = moduleContext.getBundleContext().getService(trackedServiceReference);
+            trackedService = blueprintContext.getBundleContext().getService(trackedServiceReference);
             for (Listener listener : listeners) {
                 listener.bind(trackedServiceReference, trackedService);
             }
@@ -159,7 +159,7 @@
                 for (Listener listener : listeners) {
                     listener.unbind(trackedServiceReference, trackedService);
                 }
-                moduleContext.getBundleContext().ungetService(trackedServiceReference);
+                blueprintContext.getBundleContext().ungetService(trackedServiceReference);
                 trackedServiceReference = null;
                 trackedService = null;
                 if (!optional) {
@@ -175,7 +175,7 @@
             synchronized (monitor) {
                 if (trackedService == null && metadata.getTimeout() > 0) {
                     Set<String> interfaces = new HashSet<String>(metadata.getInterfaceNames());
-                    sender.sendWaiting(moduleContext, interfaces.toArray(new String[interfaces.size()]),
getOsgiFilter());
+                    sender.sendWaiting(blueprintContext, interfaces.toArray(new String[interfaces.size()]),
getOsgiFilter());
                     monitor.wait(metadata.getTimeout());
                 }
                 if (trackedService == null) {

Modified: geronimo/sandbox/blueprint/blueprint-itests/src/test/java/org/apache/geronimo/blueprint/itests/TestBlueprintContext.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-itests/src/test/java/org/apache/geronimo/blueprint/itests/TestBlueprintContext.java?rev=768734&r1=768733&r2=768734&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-itests/src/test/java/org/apache/geronimo/blueprint/itests/TestBlueprintContext.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-itests/src/test/java/org/apache/geronimo/blueprint/itests/TestBlueprintContext.java
Sun Apr 26 18:17:43 2009
@@ -99,7 +99,7 @@
 
         try {
             blueprintContext = getBlueprintContextForBundle("blueprint-sample", 1);
-            fail("ModuleContext should have been unregistered");
+            fail("BlueprintContext should have been unregistered");
         } catch (Exception e) {
             // Expected, as the module context should have been unregistered
         }



Mime
View raw message