Package org.apache.aries.blueprint.di

Examples of org.apache.aries.blueprint.di.Repository.create()


        String name = recipe.getName();
        Repository repo = blueprintContainer.getRepository();
        if (repo.getRecipe(name) != recipe) {
            repo.putRecipe(name, recipe);
        }
        return repo.create(name);
    }
   
    private String getComponentName() {
        if (metadata.getServiceComponent() instanceof RefMetadata) {
            RefMetadata ref = (RefMetadata) metadata.getServiceComponent();
View Full Code Here


    public void testWiring() throws Exception {
        ComponentDefinitionRegistryImpl registry = parse("/test-wiring.xml");
        Repository repository = new TestBlueprintContainer(registry).getRepository();
       
        Object obj1 = repository.create("pojoA");
        assertNotNull(obj1);
        assertTrue(obj1 instanceof PojoA);
        PojoA pojoa = (PojoA) obj1;
        // test singleton scope
        assertTrue(obj1 == repository.create("pojoA"));
View Full Code Here

        Object obj1 = repository.create("pojoA");
        assertNotNull(obj1);
        assertTrue(obj1 instanceof PojoA);
        PojoA pojoa = (PojoA) obj1;
        // test singleton scope
        assertTrue(obj1 == repository.create("pojoA"));
       
        Object obj2 = repository.create("pojoB");
        assertNotNull(obj2);
        assertTrue(obj2 instanceof PojoB);
        PojoB pojob = (PojoB) obj2;
View Full Code Here

        assertTrue(obj1 instanceof PojoA);
        PojoA pojoa = (PojoA) obj1;
        // test singleton scope
        assertTrue(obj1 == repository.create("pojoA"));
       
        Object obj2 = repository.create("pojoB");
        assertNotNull(obj2);
        assertTrue(obj2 instanceof PojoB);
        PojoB pojob = (PojoB) obj2;
       
        assertNotNull(pojoa.getPojob());
View Full Code Here

       
        // test init-method
        assertEquals(true, pojob.getInitCalled());
       
        // test service
        Object obj3 = repository.create("service1");
        assertNotNull(obj3);
        assertTrue(obj3 instanceof ServiceRegistration);   
       
        // tests 'prototype' scope
        Object obj4 = repository.create("pojoC");
View Full Code Here

        Object obj3 = repository.create("service1");
        assertNotNull(obj3);
        assertTrue(obj3 instanceof ServiceRegistration);   
       
        // tests 'prototype' scope
        Object obj4 = repository.create("pojoC");
        assertNotNull(obj4);
       
        assertTrue(obj4 != repository.create("pojoC"));
       
        repository.destroy();
View Full Code Here

       
        // tests 'prototype' scope
        Object obj4 = repository.create("pojoC");
        assertNotNull(obj4);
       
        assertTrue(obj4 != repository.create("pojoC"));
       
        repository.destroy();
       
        // test destroy-method
        assertEquals(true, pojob.getDestroyCalled());
View Full Code Here

   
    public void testSetterDisambiguation() throws Exception {
        ComponentDefinitionRegistryImpl registry = parse("/test-wiring.xml");
        Repository repository = new TestBlueprintContainer(registry).getRepository();

        AmbiguousPojo pojo = (AmbiguousPojo) repository.create("ambiguousViaInt");
        assertEquals(5, pojo.getSum());
       
        pojo = (AmbiguousPojo) repository.create("ambiguousViaList");
        assertEquals(7, pojo.getSum());
       
View Full Code Here

        Repository repository = new TestBlueprintContainer(registry).getRepository();

        AmbiguousPojo pojo = (AmbiguousPojo) repository.create("ambiguousViaInt");
        assertEquals(5, pojo.getSum());
       
        pojo = (AmbiguousPojo) repository.create("ambiguousViaList");
        assertEquals(7, pojo.getSum());
       
       
    }
   
View Full Code Here

   
    public void testFieldInjection() throws Exception {
      ComponentDefinitionRegistryImpl registry = parse("/test-wiring.xml");
      Repository repository = new TestBlueprintContainer(registry).getRepository();
     
      Object fiTestBean = repository.create("FITestBean");
      assertNotNull(fiTestBean);
      assertTrue(fiTestBean instanceof FITestBean);
     
      FITestBean bean = (FITestBean) fiTestBean;
      // single field injection
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.