org.springframework.batch.poller.scheduling
Class TaskSchedulerPoller<T>

java.lang.Object
  extended by org.springframework.batch.poller.scheduling.TaskSchedulerPoller<T>
All Implemented Interfaces:
Poller<T>, BeanFactoryAware, InitializingBean

public class TaskSchedulerPoller<T>
extends Object
implements Poller<T>, BeanFactoryAware, InitializingBean

A Poller implementation that uses a TaskScheduler to poll in a background thread.

Author:
Dave Syer

Constructor Summary
TaskSchedulerPoller()
           
 
Method Summary
 void afterPropertiesSet()
           
 Future<T> poll(Callable<T> callback)
           
 void setBeanFactory(BeanFactory beanFactory)
           
 void setTaskScheduler(TaskScheduler taskScheduler)
           
 void setTrigger(Trigger trigger)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskSchedulerPoller

public TaskSchedulerPoller()
Method Detail

setTrigger

public void setTrigger(Trigger trigger)

setTaskScheduler

public void setTaskScheduler(TaskScheduler taskScheduler)

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
                    throws BeansException
Specified by:
setBeanFactory in interface BeanFactoryAware
Throws:
BeansException

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

poll

public Future<T> poll(Callable<T> callback)
               throws Exception
Specified by:
poll in interface Poller<T>
Parameters:
callback - a Callable to use to retrieve a result
Returns:
the result, or null if the operation times out
Throws:
Exception
See Also:
Poller.poll(Callable)


Copyright © 2011. All Rights Reserved.