Package org.springframework.util

Examples of org.springframework.util.MethodInvoker.prepare()


  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();
  }

  public void testInvokeWithIntArgument() throws Exception {
    ArgumentConvertingMethodInvoker methodInvoker = new ArgumentConvertingMethodInvoker();
View Full Code Here


    try {
      MethodInvoker methodInvoker = new MethodInvoker();
      methodInvoker.setTargetObject(getDelegate());
      methodInvoker.setTargetMethod(methodName);
      methodInvoker.setArguments(arguments);
      methodInvoker.prepare();
      return methodInvoker.invoke();
    }
    catch (InvocationTargetException ex) {
      Throwable targetEx = ex.getTargetException();
      if (targetEx instanceof JMSException) {
View Full Code Here

    try {
      MethodInvoker methodInvoker = new MethodInvoker();
      methodInvoker.setTargetObject(target);
      methodInvoker.setTargetMethod(name);
      methodInvoker.setArguments(args);
      methodInvoker.prepare();

      if (logger.isDebugEnabled()) {
        logger.debug("Invoking method [" + name + "] on target [" + target + "] with arguments ["
            + ObjectUtils.nullSafeToString(args) + "]");
      }
View Full Code Here

       
        MethodInvoker beanMethod = new MethodInvoker();
        beanMethod.setTargetObject(bean);
        beanMethod.setTargetMethod(targetMethod);
        beanMethod.setArguments(arguments);
        beanMethod.prepare();
       
        logger.debug("Invoking Bean: "+targetBean+"; Method: "+targetMethod+"; arguments: "+arguments+";");
       
        beanMethod.invoke();
      }catch(JobExecutionException e){
View Full Code Here

    try {
      MethodInvoker methodInvoker = new MethodInvoker();
      methodInvoker.setTargetObject(getDelegate());
      methodInvoker.setTargetMethod(methodName);
      methodInvoker.setArguments(arguments);
      methodInvoker.prepare();
      return methodInvoker.invoke();
    }
    catch (InvocationTargetException ex) {
      Throwable targetEx = ex.getTargetException();
      if (targetEx instanceof JMSException) {
View Full Code Here

    try {
      MethodInvoker methodInvoker = new MethodInvoker();
      methodInvoker.setTargetObject(getDelegate());
      methodInvoker.setTargetMethod(methodName);
      methodInvoker.setArguments(arguments);
      methodInvoker.prepare();
      return methodInvoker.invoke();
    }
    catch (InvocationTargetException ex) {
      throw new ListenerExecutionFailedException(
          "Listener method '" + methodName + "' threw exception", ex.getTargetException());
View Full Code Here

    try {
      MethodInvoker methodInvoker = new MethodInvoker();
      methodInvoker.setTargetObject(getDelegate());
      methodInvoker.setTargetMethod(methodName);
      methodInvoker.setArguments(arguments);
      methodInvoker.prepare();
      return methodInvoker.invoke();
    } catch (InvocationTargetException ex) {
      Throwable targetEx = ex.getTargetException();
      if (targetEx instanceof DataAccessException) {
        throw (DataAccessException) targetEx;
View Full Code Here

                bean = applicationContext.getBean(td.getBeanName());
            } else {
                bean = applicationContext.getAutowireCapableBeanFactory().createBean(Class.forName(td.getBeanClass()));
            }
            methodInvoker.setTargetObject(bean);
            methodInvoker.prepare();
        } catch (Exception e) {
            throw new DynamicTaskException("create task runnable error, task id is : " + taskId, e);
        }
        return new Runnable() {
            @Override
View Full Code Here

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

  @Test
  public void testInvokeWithIntArgument() throws Exception {
View Full Code Here

    try {
      MethodInvoker methodInvoker = new MethodInvoker();
      methodInvoker.setTargetObject(getDelegate());
      methodInvoker.setTargetMethod(methodName);
      methodInvoker.setArguments(arguments);
      methodInvoker.prepare();
      return methodInvoker.invoke();
    }
    catch (InvocationTargetException ex) {
      Throwable targetEx = ex.getTargetException();
      if (targetEx instanceof JMSException) {
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.