geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r767950 - in /geronimo/sandbox/blueprint: blueprint-core/src/main/java/org/apache/geronimo/blueprint/ blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/ blueprint-sample/src/main/resources/OSGI-INF/blueprint/
Date Thu, 23 Apr 2009 16:02:38 GMT
Author: gnodet
Date: Thu Apr 23 16:02:37 2009
New Revision: 767950

URL: http://svn.apache.org/viewvc?rev=767950&view=rev
Log:
Implement initial wait for service references and registration / unregistration of exported
services based on mandatory references

Added:
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/SatisfiableRecipe.java
Modified:
    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/CollectionBasedServiceReferenceRecipe.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-sample/src/main/resources/OSGI-INF/blueprint/config.xml

Added: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/SatisfiableRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/SatisfiableRecipe.java?rev=767950&view=auto
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/SatisfiableRecipe.java
(added)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/SatisfiableRecipe.java
Thu Apr 23 16:02:37 2009
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.geronimo.blueprint;
+
+import org.apache.xbean.recipe.Recipe;
+
+/**
+ * Interface used to desribe an object which can satisfy a constraint or not.
+ *
+ * If the state of the object changes, registered SatisfactionListener objects
+ * will be notified of the change.
+ *
+ * @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 SatisfiableRecipe extends Recipe {
+
+    /**
+     * A listener that will be notified when the constraint satisfaction changes.
+     *
+     * @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 SatisfactionListener {
+
+        void notifySatisfaction(SatisfiableRecipe satisfiable);
+
+    }
+
+    boolean isSatisfied();
+
+    void registerListener(SatisfactionListener listener);
+
+}

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=767950&r1=767949&r2=767950&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
Thu Apr 23 16:02:37 2009
@@ -26,6 +26,7 @@
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Collection;
+import java.util.concurrent.CopyOnWriteArrayList;
 import java.lang.reflect.Method;
 
 import org.apache.xbean.recipe.AbstractRecipe;
@@ -34,6 +35,7 @@
 import org.apache.geronimo.blueprint.ModuleContextEventSender;
 import org.apache.geronimo.blueprint.BlueprintConstants;
 import org.apache.geronimo.blueprint.Destroyable;
+import org.apache.geronimo.blueprint.SatisfiableRecipe;
 import org.apache.geronimo.blueprint.utils.ReflectionUtils;
 import org.apache.geronimo.blueprint.utils.BundleDelegatingClassLoader;
 import org.osgi.service.blueprint.context.BlueprintContext;
@@ -51,7 +53,7 @@
  * @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 abstract class AbstractServiceReferenceRecipe extends AbstractRecipe implements ServiceListener,
Destroyable {
+public abstract class AbstractServiceReferenceRecipe extends AbstractRecipe implements ServiceListener,
Destroyable, SatisfiableRecipe {
 
     protected final BlueprintContext moduleContext;
     protected final ModuleContextEventSender sender;
@@ -61,6 +63,9 @@
     private String filter;
     protected final ClassLoader proxyClassLoader;
 
+    private boolean satisfied;
+    private final List<SatisfactionListener> satisfactionListeners = new CopyOnWriteArrayList<SatisfactionListener>();
+
     protected AbstractServiceReferenceRecipe(BlueprintContext moduleContext,
                                              ModuleContextEventSender sender,
                                              ServiceReferenceMetadata metadata,
@@ -75,6 +80,23 @@
                                                                 getClass().getClassLoader());
     }
 
+    public void registerListener(SatisfactionListener listener) {
+        satisfactionListeners.add(listener);
+    }
+
+    public boolean isSatisfied() {
+        return satisfied;
+    }
+
+    protected final void setSatisfied(boolean satisfied) {
+        if (this.satisfied != satisfied) {
+            this.satisfied = satisfied;
+            for (SatisfactionListener listener : satisfactionListeners) {
+                listener.notifySatisfaction(this);
+            }
+        }
+    }
+
     protected String getOsgiFilter() {
         if (filter == null) {
             List<String> members = new ArrayList<String>();

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=767950&r1=767949&r2=767950&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
Thu Apr 23 16:02:37 2009
@@ -29,6 +29,7 @@
 import java.util.Set;
 import java.util.Properties;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.concurrent.ExecutorService;
 
 import org.apache.geronimo.blueprint.BlueprintConstants;
@@ -37,14 +38,19 @@
 import org.apache.geronimo.blueprint.ModuleContextEventSender;
 import org.apache.geronimo.blueprint.NamespaceHandlerRegistry;
 import org.apache.geronimo.blueprint.Destroyable;
+import org.apache.geronimo.blueprint.SatisfiableRecipe;
 import org.apache.geronimo.blueprint.convert.ConversionServiceImpl;
 import org.apache.geronimo.blueprint.namespace.ComponentDefinitionRegistryImpl;
 import org.apache.xbean.recipe.ObjectGraph;
 import org.apache.xbean.recipe.Repository;
+import org.apache.xbean.recipe.Recipe;
+import org.apache.xbean.recipe.ExecutionContext;
+import org.apache.xbean.recipe.DefaultExecutionContext;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceRegistration;
+import org.osgi.framework.ServiceReference;
 import org.osgi.service.blueprint.context.BlueprintContext;
 import org.osgi.service.blueprint.context.NoSuchComponentException;
 import org.osgi.service.blueprint.convert.ConversionService;
@@ -63,7 +69,7 @@
  * @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 BlueprintContextImpl implements BlueprintContext, NamespaceHandlerRegistry.Listener,
Runnable {
+public class BlueprintContextImpl implements BlueprintContext, NamespaceHandlerRegistry.Listener,
Runnable, SatisfiableRecipe.SatisfactionListener {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(BlueprintContextImpl.class);
 
@@ -71,6 +77,8 @@
         Unknown,
         WaitForNamespaceHandlers,
         Populated,
+        WaitForInitialReferences,
+        InitialReferencesSatisfied,
         Created,
         Failed
     }
@@ -89,6 +97,7 @@
     private ServiceRegistration registration;
     private boolean waitForNamespaceHandlersEventSent;
     private Map<String, Destroyable> destroyables = new HashMap<String, Destroyable>();
+    private Map<String, List<SatisfiableRecipe>> satisfiables;
 
     public BlueprintContextImpl(BundleContext bundleContext, ModuleContextEventSender sender,
NamespaceHandlerRegistry handlers, ExecutorService executors, List<URL> urls) {
         this.bundleContext = bundleContext;
@@ -158,9 +167,24 @@
                         Instanciator i = new Instanciator(this);
                         Repository repository = i.createRepository();
                         objectGraph = new ObjectGraph(repository);
-
                         registerTypeConverters();
-
+                        instanciateServiceReferences();
+                        if (checkAllSatisfiables()) {
+                            state = State.InitialReferencesSatisfied;
+                        } else {
+                            // TODO: pass correct parameters
+                            // TODO: do we need to send one event for each missing reference
?
+                            // TODO: create a timer, then fail after it elapsed
+                            sender.sendWaiting(this, null, null);
+                            state = State.WaitForInitialReferences;
+                        }
+                        break;
+                    case WaitForInitialReferences:
+                        if (checkAllSatisfiables()) {
+                            state = State.InitialReferencesSatisfied;
+                        }
+                        break;
+                    case InitialReferencesSatisfied:
                         instantiateComponents();
 
                         // TODO: access to any OSGi reference proxy is currently a problem
at this point, because calling toString() will
@@ -209,7 +233,102 @@
             }
         }
     }
-    
+
+    private Map<String, List<SatisfiableRecipe>> getSatisfiableDependenciesMap()
{
+        if (satisfiables == null) {
+            boolean createNewContext = !ExecutionContext.isContextSet();
+            if (createNewContext) {
+                ExecutionContext.setContext(new DefaultExecutionContext(objectGraph.getRepository()));
+            }
+            try {
+                satisfiables = new HashMap<String, List<SatisfiableRecipe>>();
+                for (String name : componentDefinitionRegistry.getComponentDefinitionNames())
{
+                    Object val = objectGraph.getRepository().get(name);
+                    if (val instanceof Recipe) {
+                        Recipe r = (Recipe) val;
+                        List<SatisfiableRecipe> recipes = new ArrayList<SatisfiableRecipe>();
+                        if (r instanceof SatisfiableRecipe) {
+                            recipes.add((SatisfiableRecipe) r);
+                        }
+                        getSatisfiableDependencies(r, recipes);
+                        if (!recipes.isEmpty()) {
+                            satisfiables.put(name, recipes);
+                        }
+                    }
+                }
+                return satisfiables;
+            } finally {
+                if (createNewContext) {
+                    ExecutionContext.setContext(null);
+                }
+            }
+        }
+        return satisfiables;
+    }
+
+    private void getSatisfiableDependencies(Recipe r, List<SatisfiableRecipe> recipes)
{
+        for (Recipe dep : r.getNestedRecipes()) {
+            if (dep instanceof SatisfiableRecipe) {
+                recipes.add((SatisfiableRecipe) dep);
+            }
+            getSatisfiableDependencies(dep, recipes);
+        }
+    }
+
+    private void instanciateServiceReferences() {
+        Map<String, List<SatisfiableRecipe>> dependencies = getSatisfiableDependenciesMap();
+        List<String> satisfiables = new ArrayList<String>();
+        for (String name : dependencies.keySet()) {
+            for (SatisfiableRecipe satisfiable : dependencies.get(name)) {
+                satisfiables.add(satisfiable.getName());
+                satisfiable.registerListener(this);
+            }
+        }
+        LOGGER.debug("Instanciating service references: {}", satisfiables);
+        objectGraph.createAll(satisfiables);
+    }
+
+    private boolean checkAllSatisfiables() {
+        Map<String, List<SatisfiableRecipe>> dependencies = getSatisfiableDependenciesMap();
+        for (String name : dependencies.keySet()) {
+            for (SatisfiableRecipe recipe : dependencies.get(name)) {
+                if (!recipe.isSatisfied()) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+
+    public void notifySatisfaction(SatisfiableRecipe satisfiable) {
+        LOGGER.debug("Notified satisfaction for {}: {}", satisfiable.getName(), satisfiable.isSatisfied());
+        if (state == State.WaitForInitialReferences) {
+            executors.submit(this);
+        } else if (state == State.Created) {
+            Map<String, List<SatisfiableRecipe>> dependencies = getSatisfiableDependenciesMap();
+            for (String name : dependencies.keySet()) {
+                ComponentMetadata metadata = componentDefinitionRegistry.getComponentDefinition(name);
+                if (metadata instanceof ServiceMetadata) {
+                    boolean satisfied = true;
+                    for (SatisfiableRecipe recipe : dependencies.get(name)) {
+                        if (!recipe.isSatisfied()) {
+                            satisfied = false;
+                            break;
+                        }
+                    }
+                    ServiceRegistrationProxy reg = (ServiceRegistrationProxy) getComponent(name);
+                    if (satisfied && !reg.isRegistered()) {
+                        LOGGER.debug("Registering service {} due to satisfied references",
name);
+                        reg.register();
+                    } else if (!satisfied && reg.isRegistered()) {
+                        LOGGER.debug("Unregistering service {} due to unsatisfied references",
name);
+                        reg.unregister();
+                    }
+                }
+            }
+        }
+    }
+
     private void instantiateComponents() {
         List<String> components = new ArrayList<String>();
         for (String name : componentDefinitionRegistry.getComponentDefinitionNames()) {
@@ -339,6 +458,7 @@
             unregisterAllServices();
             destroyComponents();
             // TODO: stop all reference / collections
+            // TODO: clear the repository
             waitForNamespaceHandlersEventSent = false;
             state = State.WaitForNamespaceHandlers;
             executors.submit(this);

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=767950&r1=767949&r2=767950&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
Thu Apr 23 16:02:37 2009
@@ -47,6 +47,7 @@
 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
@@ -59,8 +60,8 @@
     private final RefCollectionMetadata metadata;
     private final Recipe comparatorRecipe;
     private Comparator comparator;
-
     private ManagedCollection collection;
+    private final boolean optional;
 
     public CollectionBasedServiceReferenceRecipe(BlueprintContext moduleContext,
                                                  ModuleContextEventSender sender,
@@ -70,6 +71,10 @@
         super(moduleContext, sender, metadata, listenersRecipe);
         this.metadata = metadata;
         this.comparatorRecipe = comparatorRecipe;
+        this.optional = metadata.getAvailability() == RefCollectionMetadata.OPTIONAL_AVAILABILITY;
+        if (this.optional) {
+            setSatisfied(true);
+        }
     }
 
     public boolean canCreate(Type type) {
@@ -78,7 +83,6 @@
 
     protected Object internalCreate(Type expectedType, boolean lazyRefAllowed) throws ConstructionException
{
         try {
-
             if (comparatorRecipe != null) {
                 comparator = (Comparator) comparatorRecipe.create(proxyClassLoader);
             } else if (metadata.getOrderingBasis() != 0) {
@@ -146,7 +150,12 @@
         try {
             ServiceDispatcher dispatcher = new ServiceDispatcher(reference);
             dispatcher.proxy = createProxy(dispatcher, Arrays.asList((String[]) reference.getProperty(Constants.OBJECTCLASS)));
-            collection.addDispatcher(dispatcher);
+            synchronized (collection) {
+                collection.addDispatcher(dispatcher);
+                if (!optional) {
+                    setSatisfied(!collection.isEmpty());
+                }
+            }
             for (Listener listener : listeners) {
                 listener.bind(dispatcher.reference, dispatcher.proxy);
             }
@@ -161,7 +170,12 @@
             for (Listener listener : listeners) {
                 listener.unbind(dispatcher.reference, dispatcher.proxy);
             }
-            collection.removeDispatcher(dispatcher);
+            synchronized (collection) {
+                collection.removeDispatcher(dispatcher);
+                if (!optional) {
+                    setSatisfied(!collection.isEmpty());
+                }
+            }
             dispatcher.destroy();
         }
     }

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=767950&r1=767949&r2=767950&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
Thu Apr 23 16:02:37 2009
@@ -57,6 +57,10 @@
     protected Map getRegistrationProperties() {
         return registrationProperties;
     }
+
+    public boolean isRegistered() {
+        return registration != null;
+    }
     
     public synchronized void register() {
         if (registration != null) {

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=767950&r1=767949&r2=767950&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
Thu Apr 23 16:02:37 2009
@@ -40,6 +40,9 @@
  *
  * TODO: check synchronization / thread safety
  *
+ * TODO: looks there is a potential problem if the service is unregistered between a call
+ *        to ServiceDispatcher#loadObject() and when the actual invocation finish
+ *
  * @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) $
  */
@@ -51,6 +54,7 @@
     private volatile ServiceReference trackedServiceReference;
     private volatile Object trackedService;
     private final Object monitor = new Object();
+    private final boolean optional;
 
     public UnaryServiceReferenceRecipe(BlueprintContext moduleContext,
                                        ModuleContextEventSender sender,
@@ -58,10 +62,13 @@
                                        Recipe listenersRecipe) {
         super(moduleContext,  sender, metadata, listenersRecipe);
         this.metadata = metadata;
+        this.optional = metadata.getAvailability() == ReferenceMetadata.OPTIONAL_AVAILABILITY;
+        if (this.optional) {
+            setSatisfied(true);
+        }
     }
 
     protected Object internalCreate(Type expectedType, boolean lazyRefAllowed) throws ConstructionException
{
-        // TODO: availability
         try {
             // Create the proxy
             Object obj = createProxy(new ServiceDispatcher(), metadata.getInterfaceNames());
@@ -140,6 +147,9 @@
             for (Listener listener : listeners) {
                 listener.bind(trackedServiceReference, trackedService);
             }
+            if (!optional) {
+                setSatisfied(true);
+            }
         }
     }
 
@@ -152,6 +162,9 @@
                 moduleContext.getBundleContext().ungetService(trackedServiceReference);
                 trackedServiceReference = null;
                 trackedService = null;
+                if (!optional) {
+                    setSatisfied(false);
+                }
             }
         }
     }
@@ -159,19 +172,17 @@
     public class ServiceDispatcher implements Dispatcher {
 
         public Object loadObject() throws Exception {
-            Object svc = trackedService;
-            if (svc == null && metadata.getTimeout() > 0) {
-                Set<String> interfaces = new HashSet<String>(metadata.getInterfaceNames());
-                sender.sendWaiting(moduleContext, interfaces.toArray(new String[interfaces.size()]),
getOsgiFilter());
-                synchronized (monitor) {
+            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());
                     monitor.wait(metadata.getTimeout());
                 }
-                svc = trackedService;
-            }
-            if (svc == null) {
-                throw new ServiceUnavailableException("Timeout expired when waiting for OSGi
service", proxyClass.getSuperclass(), getOsgiFilter());
+                if (trackedService == null) {
+                    throw new ServiceUnavailableException("Timeout expired when waiting for
OSGi service", proxyClass.getSuperclass(), getOsgiFilter());
+                }
+                return trackedService;
             }
-            return svc;
         }
 
     }

Modified: geronimo/sandbox/blueprint/blueprint-sample/src/main/resources/OSGI-INF/blueprint/config.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-sample/src/main/resources/OSGI-INF/blueprint/config.xml?rev=767950&r1=767949&r2=767950&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-sample/src/main/resources/OSGI-INF/blueprint/config.xml
(original)
+++ geronimo/sandbox/blueprint/blueprint-sample/src/main/resources/OSGI-INF/blueprint/config.xml
Thu Apr 23 16:02:37 2009
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+        default-availability="optional">
 
     <type-converters>
             <bean id="converter1" class="org.apache.geronimo.blueprint.sample.DateTypeConverter">



Mime
View raw message