Package org.apache.felix.ipojo.architecture

Examples of org.apache.felix.ipojo.architecture.HandlerDescription


        ServiceReference refv1 = ipojo.getServiceReferenceByName(Architecture.class.getName(), "mycons");
        Assert.assertNotNull(refv1);
        Architecture arch = (Architecture) osgi.getServiceObject(refv1);

        HandlerDescription desc = arch.getInstanceDescription().getHandlerDescription("org.apache.felix.ipojo:requires");
        Assert.assertNotNull(desc);

        DependencyHandlerDescription d = (DependencyHandlerDescription) desc;
        Assert.assertNotNull(d.getDependencies());
        Assert.assertEquals(1, d.getDependencies().length);
View Full Code Here


        ServiceReference refv1 = ipojo.getServiceReferenceByName(Architecture.class.getName(), "mycons");
        Assert.assertNotNull(refv1);
        Architecture arch = (Architecture) osgi.getServiceObject(refv1);

        HandlerDescription desc = arch.getInstanceDescription().getHandlerDescription("org.apache.felix.ipojo:requires");
        Assert.assertNotNull(desc);

        DependencyHandlerDescription d = (DependencyHandlerDescription) desc;
        Assert.assertNotNull(d.getDependencies());
        Assert.assertEquals(1, d.getDependencies().length);
View Full Code Here

    factory.start();

    instance = factory.createComponentInstance(new Properties());
    assertEquals(ComponentInstance.VALID, instance.getState());

    HandlerDescription hd = instance.getInstanceDescription().getHandlerDescription(v);
    assertNotNull(hd);
    assertTrue(hd instanceof CheckServiceHandlerDescription);

    System.setProperty(ORG_APACHE_FELIX_IPOJO_HANDLER_AUTO_PRIMITIVE, "");
View Full Code Here

    factory.start();

    instance = factory.createComponentInstance(new Properties());
    assertEquals(ComponentInstance.VALID, instance.getState());

    HandlerDescription hd = instance.getInstanceDescription().getHandlerDescription(v);
    assertNotNull(hd);
    assertTrue(hd instanceof CheckServiceHandlerDescription);

    System.setProperty(ORG_APACHE_FELIX_IPOJO_HANDLER_AUTO_PRIMITIVE, "");
View Full Code Here

        ServiceReference refv1 = ipojoHelper.getServiceReferenceByName(Architecture.class.getName(), "mycons");
        Assert.assertNotNull(refv1);
        Architecture arch = (Architecture) osgiHelper.getRawServiceObject(refv1);

        HandlerDescription desc = arch.getInstanceDescription().getHandlerDescription("org.apache.felix.ipojo:requires");
        Assert.assertNotNull(desc);

        DependencyHandlerDescription d = (DependencyHandlerDescription) desc;
        Assert.assertNotNull(d.getDependencies());
        Assert.assertEquals(1, d.getDependencies().length);
View Full Code Here

        ServiceReference refv1 = ipojoHelper.getServiceReferenceByName(Architecture.class.getName(), "mycons");
        Assert.assertNotNull(refv1);
        Architecture arch = (Architecture) osgiHelper.getRawServiceObject(refv1);

        HandlerDescription desc = arch.getInstanceDescription().getHandlerDescription("org.apache.felix.ipojo:requires");
        Assert.assertNotNull(desc);

        DependencyHandlerDescription d = (DependencyHandlerDescription) desc;
        Assert.assertNotNull(d.getDependencies());
        Assert.assertEquals(1, d.getDependencies().length);
View Full Code Here

     * If the handler override this method, it can customize the description.
     * By default, this method returns the simplest description.
     * @return the description of the handler.
     */
    public HandlerDescription getDescription() {
        return new HandlerDescription(this);
    }
View Full Code Here

    @Test
    public void createAHost() throws Exception {
        PrimitiveComponentType type = createAWhiteboardHost();
        ComponentInstance ci = type.createInstance();
        assertThat(ci.getState(), is(ComponentInstance.VALID));
        HandlerDescription hd = ci.getInstanceDescription().getHandlerDescription(Whiteboard.NAMESPACE + ":" + Whiteboard.NAME);
        assertThat(hd, is(notNullValue()));
    }
View Full Code Here

    @Test
    public void createDoubleHost() throws Exception {
        PrimitiveComponentType type = createASecondWhiteboardHost();
        ComponentInstance ci = type.createInstance();
        assertThat(ci.getState(), is(ComponentInstance.VALID));
        HandlerDescription hd = ci.getInstanceDescription().getHandlerDescription(Whiteboard.NAMESPACE + ":" + Whiteboard.NAME);
        assertThat(hd, is(notNullValue()));
    }
View Full Code Here

          ServiceReference refv1 = ipojoHelper.getServiceReferenceByName(Architecture.class.getName(), "IgnoreCase-1");
          Assert.assertNotNull(refv1);
          Architecture arch = (Architecture) osgiHelper.getRawServiceObject(refv1);
          Assert.assertEquals(ComponentInstance.VALID, arch.getInstanceDescription().getState());

          HandlerDescription desc = arch.getInstanceDescription()
              .getHandlerDescription("orG.apAche.feliX.iPOJO.tests.CORE.hAnDlEr:EmPtY")// Check with the declared name.

          Assert.assertNotNull(desc);
          Assert.assertTrue(desc.isValid());
    }
View Full Code Here

TOP

Related Classes of org.apache.felix.ipojo.architecture.HandlerDescription

Copyright © 2018 www.massapicom. 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.