geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r798257 - in /geronimo/sandbox/blueprint/blueprint-core/src: main/java/org/apache/geronimo/blueprint/container/ main/java/org/apache/geronimo/blueprint/di/ test/java/org/apache/geronimo/blueprint/ test/java/org/apache/geronimo/blueprint/poj...
Date Mon, 27 Jul 2009 19:03:41 GMT
Author: gawor
Date: Mon Jul 27 19:03:41 2009
New Revision: 798257

URL: http://svn.apache.org/viewvc?rev=798257&view=rev
Log:
handle dynamic cycles and cycles in prototype scoped beans

Added:
    geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/PojoRecursive.java
  (with props)
Modified:
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BeanRecipe.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintContainerImpl.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintRepository.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ReferenceListRecipe.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ReferenceRecipe.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ServiceRecipe.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/AbstractRecipe.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/ExecutionContext.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/Repository.java
    geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/WiringTest.java
    geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-circular.xml

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BeanRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BeanRecipe.java?rev=798257&r1=798256&r2=798257&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BeanRecipe.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BeanRecipe.java
Mon Jul 27 19:03:41 2009
@@ -494,7 +494,7 @@
         
         // Add partially created object to the container
 //        if (initMethod == null) {
-            addObject(obj, true);
+            addPartialObject(obj);
 //        }
 
         // inject properties
@@ -509,7 +509,6 @@
             try {
                 invoke(initMethod, obj, null);
             } catch (Throwable t) {
-                LOGGER.info("Error invoking init method", getRealCause(t));
                 throw new ComponentDefinitionException("Unable to intialize bean " + getName(),
getRealCause(t));
             }
         }

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintContainerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintContainerImpl.java?rev=798257&r1=798256&r2=798257&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintContainerImpl.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintContainerImpl.java
Mon Jul 27 19:03:41 2009
@@ -607,7 +607,7 @@
         }
         LOGGER.debug("Instantiating components: {}", components);
         try {
-            repository.createAll(components);
+            repository.createAll(components, false);
         } catch (ComponentDefinitionException e) {
             throw e;
         } catch (Throwable t) {
@@ -685,7 +685,7 @@
         }
         try {
             LOGGER.debug("Instantiating component {}", id);
-            return repository.create(id);
+            return repository.create(id, false);
         } catch (NoSuchComponentException e) {
             throw e;
         } catch (ComponentDefinitionException e) {

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintRepository.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintRepository.java?rev=798257&r1=798256&r2=798257&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintRepository.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintRepository.java
Mon Jul 27 19:03:41 2009
@@ -87,6 +87,8 @@
      * stack is used to detect circular dependencies.
      */
     private final LinkedList<Recipe> stack = new LinkedList<Recipe>();
+    
+    private int createReentered = 0;
 
     public BlueprintRepository(ExtendedBlueprintContainer container) {
         blueprintContainer = container;
@@ -115,20 +117,24 @@
     }
 
     public Object create(String name) throws ComponentDefinitionException {
-        Map<String, Object> instances = createAll(Arrays.asList(name));
-        return instances.get(name);
+        return create(name, true);
     }
-
-    public Map<String, Object> createAll(String... names) throws ComponentDefinitionException
{
-        return createAll(Arrays.asList(names));
+    
+    public Object create(String name, boolean allowReentry) throws ComponentDefinitionException
{
+        Map<String, Object> instances = createAll(Arrays.asList(name), allowReentry);
+        return instances.get(name);
     }
 
     public Map<String, Object> createAll(Collection<String> names) throws ComponentDefinitionException
{
+        return createAll(names, true);        
+    }
+    
+    public Map<String, Object> createAll(Collection<String> names, boolean allowReentry)
throws ComponentDefinitionException {
         ExecutionContext oldContext = ExecutionContext.Holder.setContext(this);
         try {
             Map<String, Object> instances = new LinkedHashMap<String, Object>();
             for (String name : names) {
-                Object obj = createInstance(name);
+                Object obj = createInstance(name, allowReentry);
                 try {
                     // Make sure to go through the conversion step in case we have a Convertible
object
                     obj = convert(obj, new ReifiedType(Object.class));
@@ -180,18 +186,27 @@
         }
     }
 
-    private Object createInstance(String name) {
+    private Object createInstance(String name, boolean allowReentry) {
         // We need to synchronize recipe creation on the repository
         // so that we don't end up with multiple threads creating the
         // same instance at the same time.
         Object instance = getInstance(name);
         if (instance == null) {
             synchronized (instanceLock) {
-                instance = getInstance(name);
-                if (instance == null) {
-                    Recipe recipe = getRecipe(name);
-                    if (recipe != null) {
-                        instance = recipe.create();
+                try {
+                    if (!allowReentry) {
+                        createReentered++;               
+                    }
+                    instance = getInstance(name);
+                    if (instance == null) {
+                        Recipe recipe = getRecipe(name);
+                        if (recipe != null) {
+                            instance = recipe.create();
+                        }
+                    }
+                } finally {
+                    if (!allowReentry) {
+                        createReentered--;
                     }
                 }
             }
@@ -202,6 +217,10 @@
         return instance;
     }
 
+    public boolean isCreateReentered() {
+        return createReentered >= 2;
+    }
+    
     public void validate() {
         for (Recipe recipe : getAllRecipes()) {
             // Check that references are satisfied
@@ -322,19 +341,23 @@
         return object;
     }
 
-    public void addObject(String name, Object object, boolean partialObject) {
-        if (partialObject) {
-            partialObjects.put(name, object);
-        } else {
-            if (instances.get(name) != null) {
-                throw new ComponentDefinitionException("Name " + name + " is already registered
to instance " + instances.get(name));
-            }
-            instances.put(name, object);
-            creationOrder.add(name); 
-            partialObjects.remove(name);
+    public void addFullObject(String name, Object object) {
+        if (instances.get(name) != null) {
+            throw new ComponentDefinitionException("Name " + name + " is already registered
to instance " + instances.get(name));
         }
+        instances.put(name, object);
+        creationOrder.add(name); 
+        partialObjects.remove(name);
     }
-
+    
+    public void addPartialObject(String name, Object object) {
+        partialObjects.put(name, object);
+    }
+    
+    public Object removePartialObject(String name) {
+        return partialObjects.remove(name);
+    }
+    
     public Object getPartialObject(String name) {
         Object obj = partialObjects.get(name);
         if (obj == null) {

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ReferenceListRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ReferenceListRecipe.java?rev=798257&r1=798256&r2=798257&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ReferenceListRecipe.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ReferenceListRecipe.java
Mon Jul 27 19:03:41 2009
@@ -75,7 +75,7 @@
                 }
             }
             ProvidedObject object = new ProvidedObject();
-            addObject(object, true);
+            addPartialObject(object);
             // Handle initial references
             createListeners();
             retrack();

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ReferenceRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ReferenceRecipe.java?rev=798257&r1=798256&r2=798257&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ReferenceRecipe.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ReferenceRecipe.java
Mon Jul 27 19:03:41 2009
@@ -84,7 +84,7 @@
             // Add partially created proxy to the context
             ServiceProxyWrapper wrapper = new ServiceProxyWrapper();
 
-            addObject(wrapper, true);
+            addPartialObject(wrapper);
 
             // Handle initial references
             createListeners();

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ServiceRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ServiceRecipe.java?rev=798257&r1=798256&r2=798257&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ServiceRecipe.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ServiceRecipe.java
Mon Jul 27 19:03:41 2009
@@ -126,7 +126,7 @@
             }
         }
         ServiceRegistrationProxy proxy = new ServiceRegistrationProxy();
-        addObject(proxy, true);
+        addPartialObject(proxy);
         internalGetService(null, null); // null bundle means we don't want to retrieve the
actual service when used with a ServiceFactory
         return proxy;
     }

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/AbstractRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/AbstractRecipe.java?rev=798257&r1=798256&r2=798257&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/AbstractRecipe.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/AbstractRecipe.java
Mon Jul 27 19:03:41 2009
@@ -18,6 +18,7 @@
 package org.apache.geronimo.blueprint.di;
 
 import java.lang.reflect.Type;
+import java.util.ArrayList;
 
 import org.apache.geronimo.blueprint.container.GenericType;
 import org.osgi.service.blueprint.container.ReifiedType;
@@ -53,6 +54,11 @@
             // if this recipe has already been executed in this container, return the currently
registered value
             Object obj = context.getPartialObject(name);
             if (obj != null) {
+                if (context.isCreateReentered()) {
+                    ArrayList<Recipe> circularity = new ArrayList<Recipe>();
+                    circularity.add(this);
+                    throw new CircularDependencyException("Dynamic cycle detected in recipe",
circularity);
+                }
                 return obj;
             }
 
@@ -60,7 +66,11 @@
             context.push(this);
             try {
                 obj = internalCreate();
-                addObject(obj, false);
+                if (prototype) {
+                    context.removePartialObject(name);
+                } else {
+                    context.addFullObject(name, obj);
+                }
                 return obj;
             } finally {
                 Recipe popped = context.pop();
@@ -75,11 +85,8 @@
 
     protected abstract Object internalCreate() throws ComponentDefinitionException;
 
-    protected void addObject(Object obj, boolean partial) {
-        if (prototype) {
-            return;
-        }
-        ExecutionContext.Holder.getContext().addObject(name, obj, partial);
+    protected void addPartialObject(Object obj) {
+        ExecutionContext.Holder.getContext().addPartialObject(name, obj);
     }
     
     protected Object convert(Object obj, ReifiedType type) throws Exception {

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/ExecutionContext.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/ExecutionContext.java?rev=798257&r1=798256&r2=798257&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/ExecutionContext.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/ExecutionContext.java
Mon Jul 27 19:03:41 2009
@@ -81,14 +81,11 @@
      */
     public abstract Object getObject(String name);
 
-    /**
-     * Add an object to the repository.
-     *
-     * @param name the unique name of the object instance
-     * @param object the object instance
-     * @throws org.osgi.service.blueprint.container.ComponentDefinitionException if another
object instance is already registered with the name
-     */
-    public abstract void addObject(String name, Object object, boolean partialObject);
+    public abstract void addFullObject(String name, Object object);
+    
+    public abstract void addPartialObject(String name, Object object);
+    
+    public abstract Object removePartialObject(String name);
     
     public abstract Object getPartialObject(String name);
 
@@ -97,5 +94,7 @@
     public abstract Class loadClass(String className) throws ClassNotFoundException;
 
     public abstract Recipe getRecipe(String name);
+    
+    public abstract boolean isCreateReentered();
 }
 

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/Repository.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/Repository.java?rev=798257&r1=798256&r2=798257&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/Repository.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/di/Repository.java
Mon Jul 27 19:03:41 2009
@@ -53,8 +53,6 @@
 
     Object create(String name) throws ComponentDefinitionException;
 
-    Map<String,Object> createAll(String... names) throws ComponentDefinitionException;
-
     Map<String, Object> createAll(Collection<String> names) throws ComponentDefinitionException;
 
     <T> List<T> getAllRecipes(Class<T> clazz, String... names);

Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/WiringTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/WiringTest.java?rev=798257&r1=798256&r2=798257&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/WiringTest.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/WiringTest.java
Mon Jul 27 19:03:41 2009
@@ -21,6 +21,7 @@
 import java.math.BigInteger;
 import java.net.URI;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -28,6 +29,7 @@
 import java.util.Set;
 
 import org.apache.geronimo.blueprint.CallbackTracker.Callback;
+import org.apache.geronimo.blueprint.di.CircularDependencyException;
 import org.apache.geronimo.blueprint.di.Repository;
 import org.apache.geronimo.blueprint.namespace.ComponentDefinitionRegistryImpl;
 import org.apache.geronimo.blueprint.pojos.BeanD;
@@ -35,11 +37,14 @@
 import org.apache.geronimo.blueprint.pojos.Multiple;
 import org.apache.geronimo.blueprint.pojos.PojoA;
 import org.apache.geronimo.blueprint.pojos.PojoB;
+import org.apache.geronimo.blueprint.pojos.PojoCircular;
 import org.apache.geronimo.blueprint.pojos.PojoGenerics;
 import org.apache.geronimo.blueprint.pojos.PojoListener;
 import org.apache.geronimo.blueprint.container.AggregateConverter;
+import org.apache.geronimo.blueprint.container.BlueprintRepository;
 import org.apache.geronimo.blueprint.container.GenericType;
 import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.blueprint.container.ComponentDefinitionException;
 
 public class WiringTest extends AbstractBlueprintTest {
 
@@ -167,7 +172,7 @@
 
         ComponentDefinitionRegistryImpl registry = parse("/test-depends-on.xml");
         Repository repository = new TestBlueprintContainer(registry).getRepository();
-        Map instances = repository.createAll("c", "d", "e");
+        Map instances = repository.createAll(Arrays.asList("c", "d", "e"));
         
         List<Callback> callback = CallbackTracker.getCallbacks();
         assertEquals(3, callback.size());
@@ -359,4 +364,64 @@
         assertEquals(obj2, ((PojoListener) obj3).getService() );        
     }
      
+    public void testCircularPrototype() throws Exception {
+        ComponentDefinitionRegistryImpl registry = parse("/test-circular.xml");
+        BlueprintRepository repository = new TestBlueprintContainer(registry).getRepository();
+        
+        PojoCircular driver1 = (PojoCircular) repository.create("circularPrototypeDriver");
+        
+        assertTrue(driver1.getCircular() == driver1.getCircular().getCircular());
+        
+        PojoCircular driver2 = (PojoCircular) repository.create("circularPrototypeDriver");
+        
+        assertTrue(driver1 != driver2);
+        assertTrue(driver1.getCircular() != driver2.getCircular());
+        assertTrue(driver1.getCircular().getCircular() != driver2.getCircular().getCircular());
+        
+        PojoCircular prototype = (PojoCircular) repository.create("circularPrototype");
+        
+        assertTrue(prototype != driver1.getCircular());
+        assertTrue(prototype != driver2.getCircular());
+    }
+    
+    public void testRecursive() throws Exception {
+        ComponentDefinitionRegistryImpl registry = parse("/test-circular.xml");
+        BlueprintRepository repository = new TestBlueprintContainer(registry).getRepository();
+        
+        try {
+            repository.create("recursiveConstructor", false);
+            fail("Did not throw exception");           
+        } catch (ComponentDefinitionException e) {
+            if (e.getCause() instanceof CircularDependencyException) {                  
       
+                // that's what we expect
+            } else {
+                fail("Did not throw expected exception");
+                throw e;
+            }
+        }
+        
+        try {
+            repository.create("recursiveSetter", false);
+            fail("Did not throw exception");           
+        } catch (ComponentDefinitionException e) {
+            if (e.getCause() instanceof CircularDependencyException) {                  
       
+                // that's what we expect
+            } else {
+                fail("Did not throw expected exception");
+                throw e;
+            }
+        }
+        
+        try {
+            repository.create("recursiveInitMethod", false);
+            fail("Did not throw exception");
+        } catch (ComponentDefinitionException e) {
+            if (e.getCause() instanceof CircularDependencyException) {                  
       
+                // that's what we expect
+            } else {
+                fail("Did not throw expected exception");
+                throw e;
+            }
+        }
+    }
 }

Added: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/PojoRecursive.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/PojoRecursive.java?rev=798257&view=auto
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/PojoRecursive.java
(added)
+++ geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/PojoRecursive.java
Mon Jul 27 19:03:41 2009
@@ -0,0 +1,46 @@
+/*
+ * 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.pojos;
+
+import org.osgi.service.blueprint.container.BlueprintContainer;
+
+public class PojoRecursive {
+
+    private BlueprintContainer container;
+    private String component;
+
+    public PojoRecursive(BlueprintContainer container, String component) {
+        this.container = container;
+        this.component = component;
+    }
+    
+    public PojoRecursive(BlueprintContainer container, String component, int foo) {
+        this.container = container;
+        this.component = component;
+        container.getComponentInstance(component);
+    }
+    
+    public void setFoo(int foo) {
+        container.getComponentInstance(component);
+    }
+    
+    public void init() {    
+        container.getComponentInstance(component);
+    }
+}

Propchange: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/PojoRecursive.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/PojoRecursive.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/pojos/PojoRecursive.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-circular.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-circular.xml?rev=798257&r1=798256&r2=798257&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-circular.xml (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-circular.xml Mon Jul
27 19:03:41 2009
@@ -36,6 +36,7 @@
     </bean>
     
     
+    
     <bean id="serviceBean" class="org.apache.geronimo.blueprint.pojos.PojoB">
         <property name="uri" value="urn:myuri" />
     </bean>
@@ -53,5 +54,34 @@
            registration-method="register"
            unregistration-method="unregister"/>
     </service>
+    
+    
+    
+    <bean id="circularPrototype" class="org.apache.geronimo.blueprint.pojos.PojoCircular"
scope = "prototype">
+        <property name="circular" ref="circularPrototype"/>
+    </bean>
+    
+    <bean id="circularPrototypeDriver" class="org.apache.geronimo.blueprint.pojos.PojoCircular"
scope = "prototype">
+        <property name="circular" ref="circularPrototypeDriver"/>
+    </bean>
+    
+    
+    
+    <bean id="recursiveConstructor" class="org.apache.geronimo.blueprint.pojos.PojoRecursive">
+        <argument ref="blueprintContainer"/>
+        <argument value="recursiveConstructor"/>
+        <argument value="1"/>
+    </bean>
+    
+    <bean id="recursiveSetter" class="org.apache.geronimo.blueprint.pojos.PojoRecursive">
+        <argument ref="blueprintContainer"/>
+        <argument value="recursiveSetter"/>
+        <property name="foo" value="1"/>
+    </bean>
+    
+    <bean id="recursiveInitMethod" class="org.apache.geronimo.blueprint.pojos.PojoRecursive"
init-method = "init">
+        <argument ref="blueprintContainer"/>
+        <argument value="recursiveInitMethod"/>
+    </bean>
 
 </blueprint>
\ No newline at end of file



Mime
View raw message