Examples of PassThroughRecipe


Examples of org.apache.aries.blueprint.di.PassThroughRecipe

        }
        return deps;
    }

    private Recipe createPassThroughRecipe(PassThroughMetadata passThroughMetadata) {
        return new PassThroughRecipe(getName(passThroughMetadata.getId()),
            passThroughMetadata.getObject());
    }
View Full Code Here

Examples of org.apache.aries.blueprint.di.PassThroughRecipe

        }
        return deps;
    }

    private Recipe createPassThroughRecipe(PassThroughMetadata passThroughMetadata) {
        return new PassThroughRecipe(getName(passThroughMetadata.getId()),
            passThroughMetadata.getObject());
    }
View Full Code Here

Examples of org.apache.aries.blueprint.di.PassThroughRecipe

        }
        return deps;
    }

    private Recipe createPassThroughRecipe(PassThroughMetadata passThroughMetadata) {
        return new PassThroughRecipe(getName(passThroughMetadata.getId()),
            passThroughMetadata.getObject());
    }
View Full Code Here

Examples of org.apache.aries.blueprint.di.PassThroughRecipe

        }
        return deps;
    }

    private Recipe createPassThroughRecipe(PassThroughMetadata passThroughMetadata) {
        return new PassThroughRecipe(getName(passThroughMetadata.getId()),
            passThroughMetadata.getObject());
    }
View Full Code Here

Examples of org.apache.aries.blueprint.di.PassThroughRecipe

    @Test
    public void protectedClassAccess() throws Exception {
        BlueprintContainerImpl container = new BlueprintContainerImpl(null, null, null, null, null, null, null, null, null);
        BeanRecipe recipe = new BeanRecipe("a", container, null, false);
        recipe.setFactoryComponent(new PassThroughRecipe("factory", new Factory().create()));
        recipe.setFactoryMethod("getA");
        ExecutionContext.Holder.setContext(new BlueprintRepository(container));
        assertNotNull(recipe.create());

        recipe = new BeanRecipe("b", container, null, false);
        recipe.setFactoryComponent(new PassThroughRecipe("factory", new Factory().create()));
        recipe.setFactoryMethod("getB");
        ExecutionContext.Holder.setContext(new BlueprintRepository(container));
        assertNotNull(recipe.create());

        recipe = new BeanRecipe("c", container, null, false);
        recipe.setFactoryComponent(new PassThroughRecipe("factory", new Factory().create()));
        recipe.setFactoryMethod("getC");
        ExecutionContext.Holder.setContext(new BlueprintRepository(container));
        assertNotNull(recipe.create());

        recipe = new BeanRecipe("d", container, null, false);
        recipe.setFactoryComponent(new PassThroughRecipe("factory", new Factory().create()));
        recipe.setFactoryMethod("getD");
        ExecutionContext.Holder.setContext(new BlueprintRepository(container));
        try {
            assertNotNull(recipe.create());
            fail("Should have thrown an exception");
        } catch (ComponentDefinitionException e) {
            // ok
        }

        recipe = new BeanRecipe("a", container, null, false);
        recipe.setFactoryComponent(new PassThroughRecipe("factory", new Factory()));
        recipe.setFactoryMethod("create");
        recipe.setProperty("a", "a");
        ExecutionContext.Holder.setContext(new BlueprintRepository(container));
        assertNotNull(recipe.create());

        recipe = new BeanRecipe("b", container, null, false);
        recipe.setFactoryComponent(new PassThroughRecipe("factory", new Factory()));
        recipe.setFactoryMethod("create");
        recipe.setProperty("b", "b");
        ExecutionContext.Holder.setContext(new BlueprintRepository(container));
        assertNotNull(recipe.create());

        recipe = new BeanRecipe("c", container, null, false);
        recipe.setFactoryComponent(new PassThroughRecipe("factory", new Factory()));
        recipe.setFactoryMethod("create");
        recipe.setProperty("c", "c");
        ExecutionContext.Holder.setContext(new BlueprintRepository(container));
        assertNotNull(recipe.create());

        recipe = new BeanRecipe("d", container, null, false);
        recipe.setFactoryComponent(new PassThroughRecipe("factory", new Factory()));
        recipe.setFactoryMethod("create");
        recipe.setProperty("d", "d");
        ExecutionContext.Holder.setContext(new BlueprintRepository(container));
        try {
            assertNotNull(recipe.create());
            fail("Should have thrown an exception");
        } catch (ComponentDefinitionException e) {
            // ok
        }

        recipe = new BeanRecipe("a", container, null, false);
        recipe.setFactoryComponent(new PassThroughRecipe("factory", new Factory()));
        recipe.setFactoryMethod("create");
        recipe.setInitMethod("init");
        ExecutionContext.Holder.setContext(new BlueprintRepository(container));
        assertNotNull(recipe.create());
View Full Code Here

Examples of org.apache.aries.blueprint.di.PassThroughRecipe

        }
        return deps;
    }

    private Recipe createPassThroughRecipe(PassThroughMetadata passThroughMetadata) {
        return new PassThroughRecipe(getName(passThroughMetadata.getId()),
            passThroughMetadata.getObject());
    }
View Full Code Here

Examples of org.apache.aries.blueprint.di.PassThroughRecipe

    @Test
    public void protectedClassAccess() throws Exception {
        BlueprintContainerImpl container = new BlueprintContainerImpl(null, null, null, null, null, null, null);
        BeanRecipe recipe = new BeanRecipe("a", container, null, false);
        recipe.setFactoryComponent(new PassThroughRecipe("factory", new Factory().create()));
        recipe.setFactoryMethod("getA");
        ExecutionContext.Holder.setContext(new BlueprintRepository(container));
        assertNotNull(recipe.create());

        recipe = new BeanRecipe("b", container, null, false);
        recipe.setFactoryComponent(new PassThroughRecipe("factory", new Factory().create()));
        recipe.setFactoryMethod("getB");
        ExecutionContext.Holder.setContext(new BlueprintRepository(container));
        assertNotNull(recipe.create());

        recipe = new BeanRecipe("c", container, null, false);
        recipe.setFactoryComponent(new PassThroughRecipe("factory", new Factory().create()));
        recipe.setFactoryMethod("getC");
        ExecutionContext.Holder.setContext(new BlueprintRepository(container));
        assertNotNull(recipe.create());

        recipe = new BeanRecipe("d", container, null, false);
        recipe.setFactoryComponent(new PassThroughRecipe("factory", new Factory().create()));
        recipe.setFactoryMethod("getD");
        ExecutionContext.Holder.setContext(new BlueprintRepository(container));
        try {
            assertNotNull(recipe.create());
            fail("Should have thrown an exception");
        } catch (ComponentDefinitionException e) {
            // ok
        }

        recipe = new BeanRecipe("a", container, null, false);
        recipe.setFactoryComponent(new PassThroughRecipe("factory", new Factory()));
        recipe.setFactoryMethod("create");
        recipe.setProperty("a", "a");
        ExecutionContext.Holder.setContext(new BlueprintRepository(container));
        assertNotNull(recipe.create());

        recipe = new BeanRecipe("b", container, null, false);
        recipe.setFactoryComponent(new PassThroughRecipe("factory", new Factory()));
        recipe.setFactoryMethod("create");
        recipe.setProperty("b", "b");
        ExecutionContext.Holder.setContext(new BlueprintRepository(container));
        assertNotNull(recipe.create());

        recipe = new BeanRecipe("c", container, null, false);
        recipe.setFactoryComponent(new PassThroughRecipe("factory", new Factory()));
        recipe.setFactoryMethod("create");
        recipe.setProperty("c", "c");
        ExecutionContext.Holder.setContext(new BlueprintRepository(container));
        assertNotNull(recipe.create());

        recipe = new BeanRecipe("d", container, null, false);
        recipe.setFactoryComponent(new PassThroughRecipe("factory", new Factory()));
        recipe.setFactoryMethod("create");
        recipe.setProperty("d", "d");
        ExecutionContext.Holder.setContext(new BlueprintRepository(container));
        try {
            assertNotNull(recipe.create());
            fail("Should have thrown an exception");
        } catch (ComponentDefinitionException e) {
            // ok
        }

        recipe = new BeanRecipe("a", container, null, false);
        recipe.setFactoryComponent(new PassThroughRecipe("factory", new Factory()));
        recipe.setFactoryMethod("create");
        recipe.setInitMethod("init");
        ExecutionContext.Holder.setContext(new BlueprintRepository(container));
        assertNotNull(recipe.create());
View Full Code Here

Examples of org.apache.aries.blueprint.di.PassThroughRecipe

        }
        return deps;
    }

    private Recipe createPassThroughRecipe(PassThroughMetadata passThroughMetadata) {
        return new PassThroughRecipe(getName(passThroughMetadata.getId()),
            passThroughMetadata.getObject());
    }
View Full Code Here

Examples of org.apache.aries.blueprint.di.PassThroughRecipe

        }
        return deps;
    }

    private Recipe createPassThroughRecipe(PassThroughMetadata passThroughMetadata) {
        return new PassThroughRecipe(getName(passThroughMetadata.getId()),
            passThroughMetadata.getObject());
    }
View Full Code Here

Examples of org.apache.aries.blueprint.di.PassThroughRecipe

        }
        return deps;
    }

    private Recipe createPassThroughRecipe(PassThroughMetadata passThroughMetadata) {
        return new PassThroughRecipe(getName(passThroughMetadata.getId()),
            passThroughMetadata.getObject());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.