Package fr.imag.adele.apam.declarations.references.resources

Examples of fr.imag.adele.apam.declarations.references.resources.InterfaceReference


      return getType();
    }

    @Override
    protected ResourceReference generateReference(String type) {
      return new InterfaceReference(type);
    }
View Full Code Here


  }

  @Override
  public Implementation resolveSpecByInterface(Component client, String interfaceName, Set<String> constraints, List<String> preferences) {

    RelationDefinition dep = new RelationDefinitionImpl(new InterfaceReference(interfaceName), client.getKind(), ComponentKind.IMPLEMENTATION, constraints, preferences);
    return resolveSpecByResource(client, dep);
  }
View Full Code Here

      targetProvides.add(getTargetReference(ResourceReference.class));
    }
    else if (getTarget() != null) {
      targetProvides.addAll(getTarget().getProvidedResources());
      if (getTarget() instanceof AtomicImplementationDeclaration) {
        targetProvides.add(new InterfaceReference(((AtomicImplementationDeclaration)getTarget()).getClassName()));
      }

    }
  }
View Full Code Here

                /*
                 * Get the field interceptor depending on the kind of reference
                 */

                InterfaceReference interfaceReference = injection.getRequiredResource().as(InterfaceReference.class);
                MessageReference messageReference = injection.getRequiredResource().as(MessageReference.class);
                FieldInterceptor interceptor = null;
                try {

                    if (interfaceReference != null)
View Full Code Here

    /*
     * Add the list of provided interfaces
     */
    for (String providedIntereface : factory.getComponentDescription().getprovidedServiceSpecification()) {
      declaration.getProvidedResources().add(new InterfaceReference(providedIntereface));
    }
   
    /*
     * Add the list of factory properties
     */
 
View Full Code Here

   */
  private static boolean matches(Specification specification, ServiceReference reference) {
   
      Set<InterfaceReference> providedServices = new HashSet<InterfaceReference>();
    for (String interfaceName : (String[]) reference.getProperty(Constants.OBJECTCLASS)) {
      providedServices.add(new InterfaceReference(interfaceName));
    }
   
    return providedServices.containsAll(specification.getDeclaration().getProvidedResources(InterfaceReference.class));
  }
View Full Code Here

    }
   
      Set<ResourceReference> providedResources = new HashSet<ResourceReference>();
     
    for (String providedResource : factory.getComponentDescription().getprovidedServiceSpecification()) {
      providedResources.add(new InterfaceReference(providedResource));
    }

    Set<ResourceReference> matchedResources = new HashSet<ResourceReference>(specification.getProvidedResources());
    matchedResources.retainAll(providedResources);
View Full Code Here

    private Specification getBestMatchingSpecification(IPojoFactory factory) {
     
      Set<ResourceReference> providedResources = new HashSet<ResourceReference>();
     
    for (String providedResource : factory.getComponentDescription().getprovidedServiceSpecification()) {
      providedResources.add(new InterfaceReference(providedResource));
    }

    Specification best   = null;
    int bestScore    = 0;
   
View Full Code Here

  /**
   * Get an interface reference coded in an attribute
   */
  private InterfaceReference parseInterfaceReference(String inComponent, Element element, String attribute, boolean mandatory) {
    String interfaceName = parseString(inComponent, element, attribute, mandatory);
    return ((interfaceName == null) && !mandatory) ? null : new InterfaceReference(interfaceName);
  }
View Full Code Here

    /*
     * if not explicitly provided, get all the implemented interfaces.
     */
    if (declaration.getProvidedResources(InterfaceReference.class).isEmpty() && (pojoMetadata != null)) {
      for (String implementedInterface : pojoMetadata.getInterfaces()) {
        declaration.getProvidedResources().add(new InterfaceReference(implementedInterface));
      }
    }

    /*
     * If not explicitly provided, get all produced messages from the declared intercepted methods
View Full Code Here

TOP

Related Classes of fr.imag.adele.apam.declarations.references.resources.InterfaceReference

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.