Tabnine Logo
JobListenerFactoryBean.setDelegate
Code IndexAdd Tabnine to your IDE (free)

How to use
setDelegate
method
in
org.springframework.batch.core.listener.JobListenerFactoryBean

Best Java code snippets using org.springframework.batch.core.listener.JobListenerFactoryBean.setDelegate (Showing top 14 results out of 315)

origin: spring-projects/spring-batch

/**
 * Convenience method to wrap any object and expose the appropriate
 * {@link JobExecutionListener} interfaces.
 *
 * @param delegate a delegate object
 * @return a JobListener instance constructed from the delegate
 */
public static JobExecutionListener getListener(Object delegate) {
  JobListenerFactoryBean factory = new JobListenerFactoryBean();
  factory.setDelegate(delegate);
  return (JobExecutionListener) factory.getObject();
}
origin: spring-projects/spring-batch

@Test(expected = IllegalArgumentException.class)
public void testWrongSignatureAnnotation() {
  AbstractTestComponent delegate = new AbstractTestComponent() {
    @AfterJob
    public void aMethod(Integer item) {
      executed = true;
    }
  };
  factoryBean.setDelegate(delegate);
  factoryBean.getObject();
}
origin: spring-projects/spring-batch

@Test(expected = IllegalArgumentException.class)
public void testWrongSignatureNamedMethod() {
  AbstractTestComponent delegate = new AbstractTestComponent() {
    @SuppressWarnings("unused")
    public void aMethod(Integer item) {
      executed = true;
    }
  };
  factoryBean.setDelegate(delegate);
  Map<String, String> metaDataMap = new HashMap<>();
  metaDataMap.put(AFTER_JOB.getPropertyName(), "aMethod");
  factoryBean.setMetaDataMap(metaDataMap);
  factoryBean.getObject();
}
origin: spring-projects/spring-batch

@Test
public void testVanillaInterfaceWithProxy() throws Exception {
  JobListenerWithInterface delegate = new JobListenerWithInterface();
  ProxyFactory factory = new ProxyFactory(delegate);
  factoryBean.setDelegate(factory.getProxy());
  Object listener = factoryBean.getObject();
  assertTrue(listener instanceof JobExecutionListener);
}
origin: spring-projects/spring-batch

@Test
public void testEmptySignatureNamedMethod() {
  AbstractTestComponent delegate = new AbstractTestComponent() {
    @SuppressWarnings("unused")
    public void aMethod() {
      executed = true;
    }
  };
  factoryBean.setDelegate(delegate);
  Map<String, String> metaDataMap = new HashMap<>();
  metaDataMap.put(AFTER_JOB.getPropertyName(), "aMethod");
  factoryBean.setMetaDataMap(metaDataMap);
  JobExecutionListener listener = (JobExecutionListener) factoryBean.getObject();
  listener.afterJob(new JobExecution(1L));
  assertTrue(delegate.isExecuted());
}
origin: spring-projects/spring-batch

@Test
public void testRightSignatureNamedMethod() {
  AbstractTestComponent delegate = new AbstractTestComponent() {
    @SuppressWarnings("unused")
    public void aMethod(JobExecution jobExecution) {
      executed = true;
      assertEquals(new Long(25), jobExecution.getId());
    }
  };
  factoryBean.setDelegate(delegate);
  Map<String, String> metaDataMap = new HashMap<>();
  metaDataMap.put(AFTER_JOB.getPropertyName(), "aMethod");
  factoryBean.setMetaDataMap(metaDataMap);
  JobExecutionListener listener = (JobExecutionListener) factoryBean.getObject();
  listener.afterJob(new JobExecution(25L));
  assertTrue(delegate.isExecuted());
}
origin: spring-projects/spring-batch

@Test
public void testEmptySignatureAnnotation() {
  AbstractTestComponent delegate = new AbstractTestComponent() {
    @AfterJob
    public void aMethod() {
      executed = true;
    }
  };
  factoryBean.setDelegate(delegate);
  JobExecutionListener listener = (JobExecutionListener) factoryBean.getObject();
  listener.afterJob(new JobExecution(1L));
  assertTrue(delegate.isExecuted());
}
origin: spring-projects/spring-batch

@Test
public void testRightSignatureAnnotation() {
  AbstractTestComponent delegate = new AbstractTestComponent() {
    @AfterJob
    public void aMethod(JobExecution jobExecution) {
      executed = true;
      assertEquals(new Long(25), jobExecution.getId());
    }
  };
  factoryBean.setDelegate(delegate);
  JobExecutionListener listener = (JobExecutionListener) factoryBean.getObject();
  listener.afterJob(new JobExecution(25L));
  assertTrue(delegate.isExecuted());
}
origin: spring-projects/spring-batch

@Test
public void testWithInterface() throws Exception {
  JobListenerWithInterface delegate = new JobListenerWithInterface();
  factoryBean.setDelegate(delegate);
  JobExecutionListener listener = (JobExecutionListener) factoryBean.getObject();
  JobExecution jobExecution = new JobExecution(11L);
  listener.beforeJob(jobExecution);
  listener.afterJob(jobExecution);
  assertTrue(delegate.beforeJobCalled);
  assertTrue(delegate.afterJobCalled);
}
origin: spring-projects/spring-batch

@Test
public void testWithAnnotations() throws Exception {
  AnnotatedTestClass delegate = new AnnotatedTestClass();
  factoryBean.setDelegate(delegate);
  JobExecutionListener listener = (JobExecutionListener) factoryBean.getObject();
  JobExecution jobExecution = new JobExecution(11L);
  listener.beforeJob(jobExecution);
  listener.afterJob(jobExecution);
  assertTrue(delegate.beforeJobCalled);
  assertTrue(delegate.afterJobCalled);
}
origin: apache/servicemix-bundles

/**
 * Convenience method to wrap any object and expose the appropriate
 * {@link JobExecutionListener} interfaces.
 *
 * @param delegate a delegate object
 * @return a JobListener instance constructed from the delegate
 */
public static JobExecutionListener getListener(Object delegate) {
  JobListenerFactoryBean factory = new JobListenerFactoryBean();
  factory.setDelegate(delegate);
  return (JobExecutionListener) factory.getObject();
}
origin: org.springframework.batch/org.springframework.batch.core

/**
 * Convenience method to wrap any object and expose the appropriate
 * {@link JobExecutionListener} interfaces.
 * 
 * @param delegate a delegate object
 * @return a JobListener instance constructed from the delegate
 */
public static JobExecutionListener getListener(Object delegate) {
  JobListenerFactoryBean factory = new JobListenerFactoryBean();
  factory.setDelegate(delegate);
  return (JobExecutionListener) factory.getObject();
}
origin: org.springframework.batch/spring-batch-core

/**
 * Convenience method to wrap any object and expose the appropriate
 * {@link JobExecutionListener} interfaces.
 *
 * @param delegate a delegate object
 * @return a JobListener instance constructed from the delegate
 */
public static JobExecutionListener getListener(Object delegate) {
  JobListenerFactoryBean factory = new JobListenerFactoryBean();
  factory.setDelegate(delegate);
  return (JobExecutionListener) factory.getObject();
}
origin: org.springframework.batch.core/org.motechproject.org.springframework.batch.core

/**
 * Convenience method to wrap any object and expose the appropriate
 * {@link JobExecutionListener} interfaces.
 *
 * @param delegate a delegate object
 * @return a JobListener instance constructed from the delegate
 */
public static JobExecutionListener getListener(Object delegate) {
  JobListenerFactoryBean factory = new JobListenerFactoryBean();
  factory.setDelegate(delegate);
  return (JobExecutionListener) factory.getObject();
}
org.springframework.batch.core.listenerJobListenerFactoryBeansetDelegate

Popular methods of JobListenerFactoryBean

  • <init>
  • getObject
  • getListener
    Convenience method to wrap any object and expose the appropriate JobExecutionListener interfaces.
  • isListener
    Convenience method to check whether the given object is or can be made into a JobExecutionListener.
  • setMetaDataMap

Popular in Java

  • Start an intent from android
  • getSystemService (Context)
  • putExtra (Intent)
  • setScale (BigDecimal)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Best IntelliJ 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