Package fr.imag.adele.apam

Examples of fr.imag.adele.apam.Component


        }

        /*
         * perform reification and notify after completion
         */
        Component apamReification = reify();
        if (apamReification != null) {
          notifyDeployment(apamReification);
        }
      } catch (Exception unhandledException) {
        logger.error("Error handling Apform event :", unhandledException);
View Full Code Here


    }
    return CST.componentBroker.getWaitComponent(compoName);
  }

  public static Implementation intallImplemFromURL(URL url, String compoName) {
    Component impl = installFromURL(url, compoName);
    if (impl == null) {
      return null;
    }
    if (!(impl instanceof Implementation)) {
      logger.error("component " + compoName + " is found but is not an Implementation.");
View Full Code Here

  public RelationDefinition getCtxtRelation(Component source, String id) {
    RelationDefinition dep = ctxtDependencies.get(id);
    if (dep == null) {
      return null;
    }
    Component group = source;
    while (group != null) {
      if (dep.appliesTo(group.getDeclaration().getReference())) {
        return dep;
      }
     
      group = group.getGroup();
    }
    return null;
  }
View Full Code Here

  @Override
  public Set<RelationDefinition> getCtxtRelations(Component source) {
    Set<RelationDefinition> deps = new HashSet<RelationDefinition>();

    for (RelationDefinition dep : ctxtDependencies.values()) {
      Component group = source;
      boolean applies = false;
      while (group != null && ! applies) {
        if (dep.appliesTo(group.getDeclaration().getReference())) {
          deps.add(dep);
          applies = true;
        }
       
        group = group.getGroup();
      }
    }
    return deps;
  }
View Full Code Here

      /*
       * Get the component that defines the property, notice that this may
       * deploy the implementation if not yet installed
       */
      Component implementation = CST.apamResolver.findComponentByName(composite.getMainInst(), propertyReference.getDeclaringComponent().getName());

      /*
       * In case the implementation providing the state is not available
       * signal an error.
       */
      if (implementation == null  || !(implementation instanceof Implementation)) {
        throw new InvalidConfiguration("Invalid state declaration, implementation can not be found "+
                propertyReference.getDeclaringComponent().getName());
      }

      /*
       * Eagerly instantiate an instance to hold the state.
       *
       * In case the main instance can be used to hold state we avoid
       * creating additional objects.
       */
      if (composite.getMainInst() != null  && composite.getMainInst().getImpl().equals(implementation)) {
        this.stateHolder = composite.getMainInst();
      } else {
        this.stateHolder = ((Implementation) implementation).createInstance(composite, null);
      }

      /*
       * Get the property used to handle the state
       */
      PropertyDefinition propertyDefinition = implementation.getDeclaration().getPropertyDefinition(propertyReference);

      /*
       * In case the property providing the state is not defined signal an
       * error.
       */
 
View Full Code Here

  /*
   * return the component corresponding to the sourceKind.
   */
  @Override
  public Component getRelSource(Component base) {
    Component source = base;
    while (source != null) {
      if (source.getKind() == getSourceKind()) {
        return source;
      }
      source = source.getGroup();
    }
    return null;
  }
View Full Code Here

  }
    }

    @Override
    public void run() {
  Component component = CST.apamResolver.findComponentByName(target,
    componentName);
  if (component == null) {
      System.out.println("Component " + componentName + " not found.");
      return;
  }
View Full Code Here

  }
    }

    @Override
    public void run() {
  Component component = CST.apamResolver.findComponentByName(target,
    componentName);
  if (component == null) {
      System.out.println("Component " + componentName + " not found.");
      return;
  }
View Full Code Here

    if (!sub.sourceName.equals("this")) {
      // Look for the source component
      // source = CST.apamResolver.findComponentByName(source,
      // sub.sourceName);
      // Look for existing component only (no resolution).
      Component newSource = CST.componentBroker.getComponent(sub.sourceName);
      if (newSource == null) {
        logger.error("Component " + sub.sourceName + " not found in substitution : " + value + " of attribute " + attr);
        return null;
      }
      if (!Visible.isVisible(source, newSource)) {
View Full Code Here

  protected Component waitForComponentByName(Component client,
      String componentName, long timeout) {
    waitForApam();

    Component comp = CST.apamResolver.findComponentByName(client,
        componentName);
    long sleep = 0;

    while (sleep < timeout && comp == null) {
      try {
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.