Tabnine Logo
MethodInvoker.invokeMethod
Code IndexAdd Tabnine to your IDE (free)

How to use
invokeMethod
method
in
org.springframework.batch.support.MethodInvoker

Best Java code snippets using org.springframework.batch.support.MethodInvoker.invokeMethod (Showing top 12 results out of 315)

origin: spring-projects/spring-batch

@Override
public Object invoke(MethodInvocation invocation) throws Throwable {
  String methodName = invocation.getMethod().getName();
  if (ordered && methodName.equals("getOrder")) {
    return invocation.proceed();
  }
  Set<MethodInvoker> invokers = invokerMap.get(methodName);
  if (invokers == null) {
    return null;
  }
  ExitStatus status = null;
  for (MethodInvoker invoker : invokers) {
    Object retVal = invoker.invokeMethod(invocation.getArguments());
    if (retVal instanceof ExitStatus) {
      if (status != null) {
        status = status.and((ExitStatus) retVal);
      }
      else {
        status = (ExitStatus) retVal;
      }
    }
  }
  // The only possible return values are ExitStatus or int (from Ordered)
  return status;
}
origin: spring-projects/spring-batch

@Test
public void testMethod() throws Exception{
  
  Method method = TestClass.class.getMethod("before");
  MethodInvoker methodInvoker = new SimpleMethodInvoker(testClass, method);
  methodInvoker.invokeMethod(value);
  assertTrue(testClass.beforeCalled);
}

origin: spring-projects/spring-batch

@Test(expected=IllegalArgumentException.class)
public void testMethodWithTooManyArguments() throws Exception{
  Method method = TestClass.class.getMethod("beforeWithTooManyArguments", String.class, int.class);
  MethodInvoker methodInvoker = new SimpleMethodInvoker(testClass, method);
  methodInvoker.invokeMethod(value);
  assertFalse(testClass.beforeCalled);
}

origin: spring-projects/spring-batch

@Test
public void testMethodWithArgument() throws Exception{
  MethodInvoker methodInvoker = new SimpleMethodInvoker(testClass, "argumentTest", Object.class);
  methodInvoker.invokeMethod(new Object());
  assertTrue(testClass.argumentTestCalled);
}

origin: spring-projects/spring-batch

@Test
public void testMethodWithExecution() throws Exception{
  Method method = TestClass.class.getMethod("beforeWithArgument", String.class);
  MethodInvoker methodInvoker = new SimpleMethodInvoker(testClass, method);
  methodInvoker.invokeMethod(value);
  assertTrue(testClass.beforeCalled);
}

origin: spring-projects/spring-batch

@Test(expected=IllegalArgumentException.class)
public void testMethodByNameWithTooManyArguments() throws Exception{
  MethodInvoker methodInvoker = new SimpleMethodInvoker(testClass, "beforeWithTooManyArguments", String.class);
  methodInvoker.invokeMethod(value);
  assertFalse(testClass.beforeCalled);
}

origin: spring-projects/spring-batch

@Test
public void testMethodByName() throws Exception{
  
  MethodInvoker methodInvoker = new SimpleMethodInvoker(testClass, "before", String.class);
  methodInvoker.invokeMethod(value);
  assertTrue(testClass.beforeCalled);
}

origin: spring-projects/spring-batch

@Test
public void testMethodByNameWithExecution() throws Exception{
  MethodInvoker methodInvoker = new SimpleMethodInvoker(testClass, "beforeWithArgument", String.class);
  methodInvoker.invokeMethod(value);
  assertTrue(testClass.beforeCalled);
}

origin: org.springframework.batch/spring-batch-core

@Override
public Object invoke(MethodInvocation invocation) throws Throwable {
  String methodName = invocation.getMethod().getName();
  if (ordered && methodName.equals("getOrder")) {
    return invocation.proceed();
  }
  Set<MethodInvoker> invokers = invokerMap.get(methodName);
  if (invokers == null) {
    return null;
  }
  ExitStatus status = null;
  for (MethodInvoker invoker : invokers) {
    Object retVal = invoker.invokeMethod(invocation.getArguments());
    if (retVal instanceof ExitStatus) {
      if (status != null) {
        status = status.and((ExitStatus) retVal);
      }
      else {
        status = (ExitStatus) retVal;
      }
    }
  }
  // The only possible return values are ExitStatus or int (from Ordered)
  return status;
}
origin: org.springframework.batch/org.springframework.batch.core

public Object invoke(MethodInvocation invocation) throws Throwable {
  String methodName = invocation.getMethod().getName();
  if (ordered && methodName.equals("getOrder")) {
    return invocation.proceed();
  }
  Set<MethodInvoker> invokers = invokerMap.get(methodName);
  if (invokers == null) {
    return null;
  }
  ExitStatus status = null;
  for (MethodInvoker invoker : invokers) {
    Object retVal = invoker.invokeMethod(invocation.getArguments());
    if (retVal instanceof ExitStatus) {
      if (status != null) {
        status = status.and((ExitStatus) retVal);
      }
      else {
        status = (ExitStatus) retVal;
      }
    }
  }
  // The only possible return values are ExitStatus or int (from Ordered)
  return status;
}
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

@Override
public Object invoke(MethodInvocation invocation) throws Throwable {
  String methodName = invocation.getMethod().getName();
  if (ordered && methodName.equals("getOrder")) {
    return invocation.proceed();
  }
  Set<MethodInvoker> invokers = invokerMap.get(methodName);
  if (invokers == null) {
    return null;
  }
  ExitStatus status = null;
  for (MethodInvoker invoker : invokers) {
    Object retVal = invoker.invokeMethod(invocation.getArguments());
    if (retVal instanceof ExitStatus) {
      if (status != null) {
        status = status.and((ExitStatus) retVal);
      }
      else {
        status = (ExitStatus) retVal;
      }
    }
  }
  // The only possible return values are ExitStatus or int (from Ordered)
  return status;
}
origin: apache/servicemix-bundles

@Override
public Object invoke(MethodInvocation invocation) throws Throwable {
  String methodName = invocation.getMethod().getName();
  if (ordered && methodName.equals("getOrder")) {
    return invocation.proceed();
  }
  Set<MethodInvoker> invokers = invokerMap.get(methodName);
  if (invokers == null) {
    return null;
  }
  ExitStatus status = null;
  for (MethodInvoker invoker : invokers) {
    Object retVal = invoker.invokeMethod(invocation.getArguments());
    if (retVal instanceof ExitStatus) {
      if (status != null) {
        status = status.and((ExitStatus) retVal);
      }
      else {
        status = (ExitStatus) retVal;
      }
    }
  }
  // The only possible return values are ExitStatus or int (from Ordered)
  return status;
}
org.springframework.batch.supportMethodInvokerinvokeMethod

Popular methods of MethodInvoker

    Popular in Java

    • Updating database using SQL prepared statement
    • onCreateOptionsMenu (Activity)
    • runOnUiThread (Activity)
    • getApplicationContext (Context)
    • BufferedWriter (java.io)
      Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
    • Calendar (java.util)
      Calendar is an abstract base class for converting between a Date object and a set of integer fields
    • Date (java.util)
      A specific moment in time, with millisecond precision. Values typically come from System#currentTime
    • Iterator (java.util)
      An iterator over a sequence of objects, such as a collection.If a collection has been changed since
    • JarFile (java.util.jar)
      JarFile is used to read jar entries and their associated data from jar files.
    • Handler (java.util.logging)
      A Handler object accepts a logging request and exports the desired messages to a target, for example
    • Top Vim plugins
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now