Examples of MethodInvoker


Examples of org.platformlayer.ops.reflection.MethodInvoker

    Method method = findTargetMethod(controller, scope);
    if (method == null) {
      throw new IllegalStateException("Cannot find handler for operation on " + controller.getClass());
    }

    MethodInvoker invoker = invokerProvider.get();

    if (scope != null) {
      invoker.addProvider(new Function<Class<?>, Object>() {
        @Override
        public Object apply(Class<?> clazz) {
          return scope.getInstance(clazz);
        }
      });
    }

    invoker.invokeMethod(controller, method);
  }
View Full Code Here

Examples of org.springframework.batch.support.MethodInvoker

    boolean synthetic = false;
    for (Entry<String, String> entry : metaDataMap.entrySet()) {
      final ListenerMetaData metaData = this.getMetaDataFromPropertyName(entry.getKey());
      Set<MethodInvoker> invokers = new HashSet<MethodInvoker>();

      MethodInvoker invoker;
      invoker = getMethodInvokerForInterface(metaData.getListenerInterface(), metaData.getMethodName(), delegate,
          metaData.getParamTypes());
      if (invoker != null) {
        invokers.add(invoker);
      }
View Full Code Here

Examples of org.springframework.util.MethodInvoker

      // expected
    }
  }

  public void testInvokeWithNullArgument() throws Exception {
    MethodInvoker methodInvoker = new MethodInvoker();
    methodInvoker.setTargetClass(MethodInvokerTests.TestClass1.class);
    methodInvoker.setTargetMethod("nullArgument");
    methodInvoker.setArguments(new Object[] {null});
    methodInvoker.prepare();
    methodInvoker.invoke();
  }
View Full Code Here

Examples of org.switchyard.component.resteasy.util.MethodInvoker

            LOGGER.error(m, e);
            throw new HandlerException(m, e);
        }

        Object response = null;
        MethodInvoker methodInvoker = _methodMap.get(opName);
        if (methodInvoker == null) {
            final String m = RestEasyMessages.MESSAGES.unableToMapAmongResources(opName, _methodMap.keySet().toString());
            throw new HandlerException(m);
        }

        try {
            RESTEasyBindingData restResponse = methodInvoker.invoke(restRequest.getParameters(), restRequest.getHeaders());
            restResponse.setOperationName(opName);
            Message out = _messageComposer.compose(restResponse, exchange);
            // Our transformer magic transforms the entity appropriately here :)
            exchange.send(out);
        } catch (Exception e) {
View Full Code Here

Examples of soaprmi.soaprpc.MethodInvoker

                            + types[i]);
                }
                params[i] = value;
            }

            MethodInvoker mi = null; //newCall(m);
            // prepare this method invoker
            //      try {
            mi =
                MethodInvoker.makeMethodInvoker(
                    getInputNamespace(),
                    returnType,
                    getName(),
                    types,
                    names,
                    getSoapActionURI(),
                    soaprmiMapping);
            //      } catch(soaprmi.RemoteException ex) {
            //      throw new WSIFException(
            //        "Could not prepare method invoker for operation "+getName(), ex);
            //      }

            Map requestHeaders = new HashMap();

            requestHeaders.put("SOAPAction", getSoapActionURI());

            StringWriter sw = new StringWriter();
            Writer writer = new BufferedWriter(sw);

            String locationUri = portInstance.getLocation();

            if (Trc.ON)
                Trc.event(
                    this,
                    "invoking SoapRMI operation "
                        + getName()
                        + " on "
                        + locationUri);

            mi.sendRequest(params, writer);

            String requestContent = sw.toString();

            String httpProxyHost = null;
            int httpProxyPort = -1;

            URL url = new URL(locationUri);

            Reader reader =
                HTTPUtils.post(url, requestContent, requestHeaders, "text/xml; charset=utf-8",
                //NOTE putting "" around utf-8 is crashing Tomcat 3.2.1
        60 * 1000, //timeout,
    httpProxyHost, httpProxyPort);

            Object result = mi.receiveResponse(reader);

            if (returnType != null) {
                if (result != null
                    && !returnType.isPrimitive()
                    && !(returnType.isAssignableFrom(result.getClass()))) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.