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

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

public class TaskSchedulerPoller<T>
extends java.lang.Object
implements org.springframework.batch.poller.Poller<T>, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean

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

Author:
Dave Syer

Constructor Summary
TaskSchedulerPoller()
           
 
Method Summary
 void afterPropertiesSet()
           
 java.util.concurrent.Future<T> poll(java.util.concurrent.Callable<T> callback)
           
 void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
           
 void setTaskScheduler(org.springframework.scheduling.TaskScheduler taskScheduler)
           
 void setTrigger(org.springframework.scheduling.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(org.springframework.scheduling.Trigger trigger)

setTaskScheduler

public void setTaskScheduler(org.springframework.scheduling.TaskScheduler taskScheduler)

setBeanFactory

public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
                    throws org.springframework.beans.BeansException
Specified by:
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
Throws:
org.springframework.beans.BeansException

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception

poll

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


Copyright © 2011. All Rights Reserved.