Package org.apache.felix.ipojo.architecture

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


     * @param fact : the factory to test.
     * @return true if the factory match, false otherwise.
     */
    public boolean match(ServiceReference fact) {
        // Check if the factory can provide the specification
        ComponentTypeDescription desc = (ComponentTypeDescription) fact.getProperty("component.description");
        if (desc == null) {
            return false; // No component type description.
        }

        String[] provides = desc.getprovidedServiceSpecification();
        for (int i = 0; provides != null && i < provides.length; i++) {
            if (provides[i].equals(m_specification)) {
                // Check that the factory needs every properties contained in
                // the configuration
                PropertyDescription[] props = desc.getProperties();
                Properties conf = new Properties();
                Enumeration keys = m_configuration.keys();
                while (keys.hasMoreElements()) {
                    String key = (String) keys.nextElement();
                    if (!containsProperty(key, props)) { return false; }
View Full Code Here


   
    Element[] pd2 = cd.getElements("property");
    assertNull("Check props null", pd2);
   
    // Check Description equality
    ComponentTypeDescription desc = (ComponentTypeDescription) sr_fooProvider1.getProperty("component.description");
    assertNotNull("check description equality", desc);
  }
View Full Code Here

   
    assertEquals("Check component.properties name [" + 4 + "]", "intAProp", pd2[4].getAttribute("name"));
    assertEquals("Check component.properties type [" + 4 + "]", "int[]", pd2[4].getAttribute("type"));
   
    // Check Description equality
    ComponentTypeDescription desc = (ComponentTypeDescription) sr_fooProvider2.getProperty("component.description");
        assertNotNull("check description equality", desc);

        // Check that we have the complete metadata
        assertNotNull(fooProvider2.getComponentMetadata());
  }
View Full Code Here

   
    assertEquals("Check component.properties name [" + 4 + "]", "intAProp", pd2[4].getAttribute("name"));
    assertEquals("Check component.properties type [" + 4 + "]", "int[]", pd2[4].getAttribute("type"));
   
    // Check Description equality
    ComponentTypeDescription desc = (ComponentTypeDescription) sr_fooProviderDyn2.getProperty("component.description");
    assertNotNull("check description equality", desc);

        // Check that we have the complete metadata
        assertNotNull(fooProvider2.getComponentMetadata());
  }
View Full Code Here

   
    assertEquals("Check component.properties name [" + 2 + "]", "baz", pd2[2].getAttribute("name"));
    assertEquals("Check component.properties type [" + 2 + "]", "java.lang.String", pd2[2].getAttribute("type"));
   
    // Check Description equality
    ComponentTypeDescription desc = (ComponentTypeDescription) sr_fooProvider3.getProperty("component.description");
    assertNotNull("check description equality", desc);
  }
View Full Code Here

       
        Element[] pd2 = cd.getElements("property");
        assertNull("Check props null", pd2);
   
    // Check Description equality
        ComponentTypeDescription desc = (ComponentTypeDescription) sr_foobarProvider.getProperty("component.description");
    assertNotNull("check description equality", desc);

        // Check that we have the complete metadata
        assertNotNull(foobarProvider.getComponentMetadata());
  }
View Full Code Here

    /**
     * Gets the component type description.
     * @return the component type description
     */
    public ComponentTypeDescription getComponentTypeDescription() {
        return new ComponentTypeDescription(this);
    }
View Full Code Here

        } catch (Exception e) {
            e.printStackTrace();
            fail("Unacceptable configuration : " + e.getMessage());
        }

        ComponentTypeDescription cd = ci.getFactory().getComponentDescription();
        assertEquals("Check component type name", cd.getName(), "composite.empty");
//    assertEquals("Check class name (" + cd.getClassName() + ")", cd.getClassName(), "composite");
        assertEquals("Check offered service", cd.getprovidedServiceSpecification().length, 0);
        assertEquals("Check configurable properties", cd.getProperties().length, 0);

        CompositeInstanceDescription id = (CompositeInstanceDescription) ci.getInstanceDescription();
        assertEquals("Check composite instance name", id.getName(), "empty");
        assertEquals("Check composite instance state (" + id.getState() + ")", id.getState(), ComponentInstance.VALID);
View Full Code Here

   
    Element[] pd2 = cd.getElements("property");
    assertNull("Check props null", pd2);
   
    // Check Description equality
    ComponentTypeDescription desc = (ComponentTypeDescription) sr_fooProvider1.getProperty("component.description");
    assertNotNull("check description equality", desc);
  }
View Full Code Here

   
    assertEquals("Check component.properties name [" + 4 + "]", "intAProp", pd2[4].getAttribute("name"));
    assertEquals("Check component.properties type [" + 4 + "]", "int[]", pd2[4].getAttribute("type"));
   
    // Check Description equality
    ComponentTypeDescription desc = (ComponentTypeDescription) sr_fooProvider2.getProperty("component.description");
        assertNotNull("check description equality", desc);
  }
View Full Code Here

TOP

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

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.