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

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


    }

    @Override
    public ResourceReference getRequiredResource() {
      String target = argumentType.get();
      return target != null && !target.equals(InstrumentedClass.UNKNOWN_TYPE)? new MessageReference(target) : new UnknownReference(new MessageReference(this.toString()));
    }
View Full Code Here


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

     * The type of the java resource that needs to be provided at runtime by
     * the component to perform this instrumentation
     */
    @Override
    public ResourceReference getProvidedResource() {
      MessageReference target = methodReturnType.get();
      return target != null ? target : new UnknownReference(new MessageReference(methodName));
    }
View Full Code Here

  }

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

    RelationDefinition dep = new RelationDefinitionImpl(new MessageReference(messageName), client.getKind(), ComponentKind.IMPLEMENTATION, constraints, preferences);
    return resolveSpecByResource(client, dep);
  }
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)
                        interceptor = new InterfaceInjectionManager(getFactory(), getInstanceManager(), this, relation, injection);
View Full Code Here

       */
      PojoMetadata manipulation           = getFactory().getPojoMetadata();
      AtomicImplementationDeclaration primitive  = (AtomicImplementationDeclaration) declaration;
      for (ProviderInstrumentation providerInstrumentation : primitive.getProviderInstrumentation()) {
       
          MessageReference messageReference = providerInstrumentation.getProvidedResource().as(MessageReference.class);
        if (messageReference == null)
          continue;

        if (! (providerInstrumentation instanceof ProviderInstrumentation.MessageProviderMethodInterception))
          continue;

        ProviderInstrumentation.MessageProviderMethodInterception interception =
            (ProviderInstrumentation.MessageProviderMethodInterception) providerInstrumentation;
         
      /*
       * Search for the specified method to intercept, we always look for a perfect match of the
       * specified signature, and do not allow ambiguous method names
       */
     
      MethodMetadata candidate = null;
      for (MethodMetadata method :  manipulation.getMethods(interception.getMethodName())) {
       
        if (interception.getMethodSignature() == null) {
          candidate = method;
          break;
        }
       
        String signature[]  = Util.split(interception.getMethodSignature());
        String arguments[]  = method.getMethodArguments();
        boolean match     = (signature.length == arguments.length);

        for (int i = 0; match && i < signature.length; i++) {
          if (!signature[i].equals(arguments[i]))
            match = false;
        }
       
        match = match && method.getMethodReturn().equals(messageReference.getJavaType());
        if (match) {
          candidate = method;
          break;
        }
      }
View Full Code Here

  /**
   * Get a message reference coded in an attribute
   */
  private MessageReference parseMessageReference(String inComponent, Element element, String attribute, boolean mandatory) {
    String messageName = parseString(inComponent, element, attribute, mandatory);
    return ((messageName == null) && !mandatory) ? null : new MessageReference(messageName);
  }
View Full Code Here

    /*
     * If not explicitly provided, get all produced messages from the declared intercepted methods
     */
    if (declaration.getProvidedResources(MessageReference.class).isEmpty()) {
      for (ProviderInstrumentation providerInstrumentation : declaration.getProviderInstrumentation()) {
        MessageReference instrumentedMessage = providerInstrumentation.getProvidedResource().as(MessageReference.class);
        if (instrumentedMessage != null) {
          declaration.getProvidedResources().add(instrumentedMessage);
        }

      }
View Full Code Here

    for (String interfaceName : list(interfaces,true)) {
      component.getProvidedResources().add(new InterfaceReference(interfaceName));
    }

    for (String message : list(messages,true)) {
      component.getProvidedResources().add(new MessageReference(message));
    }
   
    for (String reqpackage : list(packages,true)) {
      component.getProvidedResources().add(new PackageReference(reqpackage));
    }   
View Full Code Here

            }
        }
       
        if(isDefined(CST.PROVIDE_MESSAGES)) {
            for(String ref : list(CST.PROVIDE_MESSAGES)) {
              component.getProvidedResources().add(new MessageReference(ref));
            }
        }
       
        // Add encoded properties, definitions and relations
View Full Code Here

TOP

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

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.