Package org.apache.felix.ipojo.parser

Examples of org.apache.felix.ipojo.parser.MethodMetadata


            String[] signature) throws MBeanException, ReflectionException {

        MethodField method = m_configMap.getMethodFromName(operationName,
            signature);
        if (method != null) {
            MethodMetadata methodCall = method.getMethod();
            Callback mc = new Callback(methodCall, m_instanceManager);
            try {
                return mc.call(params);
            } catch (NoSuchMethodException e) {
                throw new ReflectionException(e);
View Full Code Here


                } else {
                    callbackType = subscriberMetadata.getDataType().getName();
                }

                // Check the event callback method is present
                MethodMetadata methodMetadata = pojoMetadata.getMethod(
                        subscriberMetadata.getCallback(),
                        new String[] { callbackType });
                String callbackSignature = subscriberMetadata.getCallback()
                        + "(" + callbackType + ")";
                if (methodMetadata == null) {
View Full Code Here

                } else {
                    callbackType = subscriberMetadata.getDataType().getName();
                }

                // Create the specified callback and register it
                MethodMetadata methodMetadata = pojoMetadata.getMethod(
                        subscriberMetadata.getCallback(),
                        new String[] { callbackType });
                Callback callback = new Callback(methodMetadata, m_manager);
                m_callbacksByName.put(name, callback);
View Full Code Here

            String eorb = sub[i].getAttribute(EXCEPTIONONROLLBACK_ATTRIBUTE);

            if (method == null) {
                throw new ConfigurationException("A transactional element must specified the method attribute");
            }
            MethodMetadata meta = this.getPojoMetadata().getMethod(method);
            if (meta == null) {
                throw new ConfigurationException("A transactional method is not in the pojo class : " + method);
            }

            int timeout = 0;
View Full Code Here

          throw new ConfigurationException("Invalid property definition "  + definition.getName()+ ": the specified field does not exist");

      }

      if (definition.getCallback() != null) {
        MethodMetadata method = getPojoMetadata().getMethod(definition.getCallback());
        if (method == null)
          throw new ConfigurationException("Invalid property definition "  + definition.getName() + ": the specified method does not exist");
      }
    }
  }
View Full Code Here

    /*
     * Try to use iPojo metadata
     */

    MethodMetadata methodIPojoMetadata = null;
    if (pojoMetadata != null) {
      for (MethodMetadata method : pojoMetadata.getMethods(methodName)) {

        String arguments[] = method.getMethodArguments();
        boolean match = (1 == arguments.length);
        if (match) {
          methodIPojoMetadata = method;
        }
      }
    }


    if (methodIPojoMetadata != null) {
      return boxed(methodIPojoMetadata.getMethodArguments()[0]);
    }

    throw new NoSuchMethodException("unavailable metadata for method " + methodName);

  }
View Full Code Here

    /*
     * Try to use iPojo metadata
     */
   
    MethodMetadata methodIPojoMetadata = null;
    if (pojoMetadata != null) {
      for (MethodMetadata method : pojoMetadata.getMethods(methodName)) {

        if (methodSignature == null) {
          methodIPojoMetadata = method;
          break;
        }

        String signature[] = methodSignature.split(",");
        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;
          }
        }

        if (match) {
          methodIPojoMetadata = method;
          break;
        }
      }
    }

    if (methodIPojoMetadata != null) {
      return boxed(methodIPojoMetadata.getMethodReturn());
    }

    throw new NoSuchMethodException("unavailable metadata for method " + methodName + "(" + methodSignature != null ? methodSignature : "" + ")");

  }
View Full Code Here

       
        this.relation  = relation;
        this.injection  = injection;
       
        if (injection instanceof RequirerInstrumentation.MessageConsumerCallback) {
            MethodMetadata callbackMetadata = null;
            String callbackParameterType    = null;
           
            for (MethodMetadata method : this.component.getPojoMetadata().getMethods(injection.getName())) {
                if (method.getMethodArguments().length == 1) {
                    callbackMetadata        = method;
View Full Code Here

      /*
       * 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;
View Full Code Here

            String method = hooksMetadata[i].getAttribute("method");
            if (method == null) {
                throw new ConfigurationException("Lifecycle callback : A callback needs to contain a method attribute");
            }
           
            MethodMetadata met = meta.getMethod(method, new String[0]);
           
            int transition = -1;
            String trans = hooksMetadata[i].getAttribute("transition");
            if (trans == null) {
                throw new ConfigurationException("Lifecycle callback : the transition attribute is missing");
View Full Code Here

TOP

Related Classes of org.apache.felix.ipojo.parser.MethodMetadata

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.