Package fr.imag.adele.apam

Examples of fr.imag.adele.apam.Component


  // /special case

  @Override
  public Component getWaitComponent(String name, long timeout) {
    Component compo = getComponent(name);
    if (compo != null) {
      return compo;
    }

    /*
 
View Full Code Here


    // if (definition != null) {
    // return definition;
    // }

    PropertyDefinition definition = null;
    Component group = this; // .getGroup();
    while (group != null) {
      definition = group.getDeclaration().getPropertyDefinition(attr);
      if (definition != null) {
        return definition;
      }
      group = group.getGroup();
    }
    return null;
  }
View Full Code Here

   *
   * @param relName
   * @return
   */
  public Link getExistingLink(String relName) {
    Component group = this;
    while (group != null) {
      for (Link link : ((ComponentImpl) group).getLocalLinks()) {
        if (link.getName().equals(relName)) {
          return link;
        }
      }
      group = group.getGroup();
    }
    return null;
  }
View Full Code Here

   * @param relName
   * @return
   */
  public Set<Link> getExistingLinks(String relName) {
    Set<Link> dests = new HashSet<Link>();
    Component group = this;
    while (group != null) {
      for (Link link : ((ComponentImpl) group).getLocalLinks()) {
        if (link.getName().equals(relName)) {
          dests.add(link);
        }
      }
      group = group.getGroup();
    }
    return dests;
  }
View Full Code Here

    return w;
  }

  @Override
  public Link getLink(String relName) {
    Component group = this;
    while (group != null) {
      for (Link link : ((ComponentImpl) group).getLocalLinks()) {
        if (link.getName().equals(relName)) {
          return link;
        }
      }
      group = group.getGroup();
    }

    // None are present. Try to resolve
    RelationDefinition rel = getRelation(relName);
    if (rel == null) {
      logger.error("relation " + relName + " undefined for " + this);
      return null;
    }
    Component source = rel.getRelSource(this);
    CST.apamResolver.resolveLink(source, rel);
    return getExistingLink(relName);
  }
View Full Code Here

    }

    // if (!rel.isLazy())
    // return dests ;

    Component source = rel.getRelSource(this);
    CST.apamResolver.resolveLink(source, rel);
    return getExistingLinks(relName);
  }
View Full Code Here

    Set<ResourceReference> provided = new HashSet<ResourceReference>();
   
    /*
     * add all provided resources declared at all levels of abstraction
     */
    Component ancestor = this;
    while (ancestor != null) {
      provided.addAll(ancestor.getDeclaration().getProvidedResources());
      ancestor = ancestor.getGroup();
    }
   
    return Collections.unmodifiableSet(provided);
  }
View Full Code Here

   * Warning : do not resolve !
   */
  @Override
  public Set<Link> getRawLinks() {
    Set<Link> allLinks = new HashSet<Link>();
    Component group = this;
    while (group != null) {
      allLinks.addAll(((ComponentImpl) group).getLocalLinks());
      group = group.getGroup();
    }
    return allLinks;
  }
View Full Code Here

   * @return
   */
  @Override
  public RelationDefinition getRelation(String id) {
    RelationDefinition dep = null;
    Component group = this;
    while (group != null) {
      dep = ((ComponentImpl) group).getLocalRelation(id);
      if (dep != null) {
        return dep;
      }
      group = group.getGroup();
    }

    // Looking for composite definitions.
    if (this instanceof Instance) {
      CompositeType comptype = ((Instance) this).getComposite()
View Full Code Here

  @Override
  public Set<RelationDefinition> getRelations() {
    Set<RelationDefinition> relDefs = new HashSet<RelationDefinition>();
    Set<String> processed = new HashSet<String>();

    Component group = this;
    while (group != null) {

      for (RelationDefinition relDef : group.getLocalRelations()) {
        if (!processed.contains(relDef.getName())) {
          relDefs.add(relDef);
          processed.add(relDef.getName());
        }
      }

      group = group.getGroup();
    }

    // Looking for composite definitions.
    if (this instanceof Instance) {
      CompositeType comptype = ((Instance) this).getComposite()
View Full Code Here

TOP

Related Classes of fr.imag.adele.apam.Component

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.