Package org.apache.felix.ipojo.architecture

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


                String imm = props[j].getAttribute("immutable");
                if (imm != null && imm.equalsIgnoreCase("true")) {
                    immutable = true;
                }

                PropertyDescription pd = new PropertyDescription(name, type, value, immutable);
                desc.addProperty(pd);

                String man = props[j].getAttribute("mandatory");
                if (man != null && man.equalsIgnoreCase("true")) {
                    pd.setMandatory();
                }
            }
        }
    }
View Full Code Here


            Element metadata)
        throws ConfigurationException {

        // Update the current component description
        Dictionary dict = new Properties();
        cd.addProperty(new PropertyDescription(TOPICS_PROPERTY,
                Dictionary.class.getName(), dict.toString()));
        dict = new Properties();
        cd.addProperty(new PropertyDescription(FILTER_PROPERTY,
                Dictionary.class.getName(), dict.toString()));

        // Get Metadata subscribers
        Element[] subscribers = metadata.getElements("subscriber", NAMESPACE);
        if (subscribers != null) {
View Full Code Here

                                           Element metadata)
            throws ConfigurationException {

        // Update the current component description
        Dictionary dict = new Properties();
        PropertyDescription pd = new PropertyDescription(TOPICS_PROPERTY,
                Dictionary.class.getName(), dict.toString());
        cd.addProperty(pd);

        // Get Metadata publishers
        Element[] publishers = metadata.getElements("publisher", NAMESPACE);
View Full Code Here

    props.put("changes", new Integer(changes));

  }

  public void initializeComponentFactory(ComponentTypeDescription cd, Element metadata) {
      cd.addProperty(new PropertyDescription("csh.simple", "java.lang.String", null));
        cd.addProperty(new PropertyDescription("csh.map", "java.util.Dictionary", null));
  }
View Full Code Here

        assertNull(ref.getProperty("private"));

        // Check the the .private property has the right value
        ConfigurationHandlerDescription desc = (ConfigurationHandlerDescription) ipojoHelper.getArchitectureByName(configuration.getPid())
                .getInstanceDescription().getHandlerDescription("org.apache.felix.ipojo:properties");
        PropertyDescription prop = desc.getPropertyByName(".private");
        assertEquals(prop.getValue(), "wow");

        // Update the property
        props.put("message", "message2");
        props.put("propagated", "propagated2");
        props.put(".private", "wow2");
        configuration.update(props);

        grace();

        ref = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), configuration.getPid());
        // Check the propagation
        assertEquals(ref.getProperty("propagated"), "propagated2");
        assertEquals(ref.getProperty("message"), "message2");

        desc = (ConfigurationHandlerDescription) ipojoHelper.getArchitectureByName(configuration.getPid())
                .getInstanceDescription().getHandlerDescription("org.apache.felix.ipojo:properties");
        prop = desc.getPropertyByName(".private");
        assertEquals(prop.getValue(), "wow2");

        configuration.delete();
    }
View Full Code Here

    props.put("changes", new Integer(changes));

  }

  public void initializeComponentFactory(ComponentTypeDescription cd, Element metadata) {
      cd.addProperty(new PropertyDescription("csh.simple", "java.lang.String", null));
        cd.addProperty(new PropertyDescription("csh.map", "java.util.Dictionary", null));
  }
View Full Code Here

        m_value = (String) configuration.get("foo");

  }

  public void initializeComponentFactory(ComponentTypeDescription cd, Element metadata) {
      cd.addProperty(new PropertyDescription("csh.simple", "java.lang.String", null));
        cd.addProperty(new PropertyDescription("csh.map", "java.util.Dictionary", null));
  }
View Full Code Here

     */
    public ConfigurationHandlerDescription(Handler handler, List/*<Property>*/ props, String pid) {
        super(handler);
        m_properties = new PropertyDescription[props.size()];
        for (int i = 0; i < props.size(); i++) {
            m_properties[i] = new PropertyDescription((Property) props.get(i));
        }       
        m_pid = pid;
    }
View Full Code Here

            boolean mandatory = false;
            String man = configurables[i].getAttribute("mandatory");
            mandatory =  man != null && man.equalsIgnoreCase("true");

            PropertyDescription pd = null;
            if (value == null) {
                pd = new PropertyDescription(name, type, null, false); // Cannot be immutable if we have no value.
            } else {
                pd = new PropertyDescription(name, type, value, immutable);
            }

            if (mandatory) {
                pd.setMandatory();
            }

            desc.addProperty(pd);
        }
View Full Code Here

                String imm = props[j].getAttribute("immutable");
                if (imm != null && imm.equalsIgnoreCase("true")) {
                    immutable = true;
                }

                PropertyDescription pd = new PropertyDescription(name, type, value, immutable);
                desc.addProperty(pd);

                String man = props[j].getAttribute("mandatory");
                if (man != null && man.equalsIgnoreCase("true")) {
                    pd.setMandatory();
                }
            }
        }
    }
View Full Code Here

TOP

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

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.