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

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

Best Java code snippets using org.springframework.batch.core.listener.JobListenerFactoryBean.getObject (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.listenerJobListenerFactoryBeangetObject

Popular methods of JobListenerFactoryBean

  • <init>
  • setDelegate
  • 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

  • Reactive rest calls using spring rest template
  • getApplicationContext (Context)
  • requestLocationUpdates (LocationManager)
  • putExtra (Intent)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • BoxLayout (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top plugins for Android Studio
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