|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.quartz.simpl.SimpleThreadPool org.springframework.scheduling.quartz.SimpleThreadPoolTaskExecutor
public class SimpleThreadPoolTaskExecutor
Subclass of Quartz's SimpleThreadPool that implements Spring's TaskExecutor interface and listens to Spring lifecycle callbacks.
Can be used as a thread-pooling TaskExecutor backend, in particular on JDK <= 1.5 (where the JDK ThreadPoolExecutor isn't available yet). Can be shared between a Quartz Scheduler (specified as "taskExecutor") and other TaskExecutor users, or even used completely independent of a Quartz Scheduler (as plain TaskExecutor backend).
SimpleThreadPool
,
TaskExecutor
,
SchedulerFactoryBean.setTaskExecutor(org.springframework.core.task.TaskExecutor)
Constructor Summary | |
---|---|
SimpleThreadPoolTaskExecutor()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware). |
void |
destroy()
Invoked by a BeanFactory on destruction of a singleton. |
void |
execute(Runnable task)
Execute the given task . |
boolean |
prefersShortLivedTasks()
This task executor prefers short-lived work units. |
void |
setWaitForJobsToCompleteOnShutdown(boolean waitForJobsToCompleteOnShutdown)
Set whether to wait for running jobs to complete on shutdown. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleThreadPoolTaskExecutor()
Method Detail |
---|
public void setWaitForJobsToCompleteOnShutdown(boolean waitForJobsToCompleteOnShutdown)
SimpleThreadPool.shutdown(boolean)
public void afterPropertiesSet() throws SchedulerConfigException
InitializingBean
This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.
afterPropertiesSet
in interface InitializingBean
SchedulerConfigException
public void execute(Runnable task)
TaskExecutor
task
.
The call might return immediately if the implementation uses an asynchronous execution strategy, or might block in the case of synchronous execution.
execute
in interface TaskExecutor
task
- the Runnable
to execute (never null
)public boolean prefersShortLivedTasks()
prefersShortLivedTasks
in interface SchedulingTaskExecutor
true
if this TaskExecutor
prefers
short-lived taskspublic void destroy()
DisposableBean
destroy
in interface DisposableBean
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |