Examples of PropertyDescription


Examples of edu.mit.simile.fresnel.selection.PropertyDescription

              }
              tmconn.commit();
              tmconn.setAutoCommit(true);
              tmconn.close();
              if (selector instanceof PropertyDescription) {
                PropertyDescription selectorPD = (PropertyDescription) selector;
                if (current == max) {
                  // if we've hit the limit, stop with sublensing
                  subr.setTitle(resolveLabel(in, objResource));
                } else {                 
                  // pick a sublens to apply to the resource
                  int newdepth = (selectorPD.getDepth() + current < max) ? selectorPD.getDepth() + current : max;
                  Lens sublens = null;
                  Iterator<Lens> sublensesIt = selectorPD.getSublensesIterator();
                  boolean match = false;
                  matched:
                  while (sublensesIt.hasNext()) {
                    sublens = sublensesIt.next();
                    Iterator<ISelector> domainIt = sublens.getDomainSet().iterator();
View Full Code Here

Examples of edu.mit.simile.fresnel.selection.PropertyDescription

              r.addProperty(pr);
            }
            if (object instanceof Resource) {
              Resource objResource = (Resource) object;
              if (selector instanceof PropertyDescription) {
                PropertyDescription selectorPD = (PropertyDescription) selector;
                if (current == max) {
                  ValueResult vr = new ValueResult(resolveLabel(in, objResource, false).getString(), pr, selected.getContext());
                  pr.addValue(vr);
                  this._propertyResultModelHash.putResult(prop, pr);
                } else {
                  // pick a sublens to apply to the resource
                  int newdepth = (selectorPD.getDepth() + current < max) ? selectorPD.getDepth() : max;
                  Lens sublens = null;
                  Iterator<Lens> sublensesIt = selectorPD.getSublensesIterator();
                  boolean matched = false;
                  matching:
                  while (sublensesIt.hasNext()) {
                    sublens = sublensesIt.next();
                    Iterator<ISelector> domainIt = sublens.getDomainSet().iterator();
View Full Code Here

Examples of edu.mit.simile.fresnel.selection.PropertyDescription

      Iterator<ISelector> psi = parent.getShowProperties().iterator();
      while (psi.hasNext()) {
        ISelector check = psi.next();
        if (check.canSelect(in, r.getParent().getOrigin(), r.getOrigin())) {
          if (check instanceof PropertyDescription) {
            PropertyDescription pd = (PropertyDescription) check;
            if (pd.isGroupUse()) {
              // pick which format to use...
              Group groupFormats = (Group) pd.getUse();
              Iterator<Format> fi = groupFormats.getFormats().iterator();
              while (fi.hasNext()) {
                Format potential = fi.next();
                for (Iterator<ISelector> di = potential.getDomainSet().iterator(); di.hasNext(); ) {
                  ISelector potentialCheck = di.next();
                  if (potentialCheck.canSelect(getModel(), r.getParent().getOrigin(), r.getOrigin())) {
                    format = potential;
                    break;
                  }
                }
              }
            } else {
              if (null != pd.getUse()) {
                format = (Format) pd.getUse();
                break;
              }
            }
          }
        }
View Full Code Here

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

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

            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

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

                                           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

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

    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

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

        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

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

    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

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

        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
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.