org.springframework.scheduling.support
Class DelegatingExceptionProofRunnable

java.lang.Object
  extended by org.springframework.scheduling.support.DelegatingExceptionProofRunnable
All Implemented Interfaces:
Runnable

public class DelegatingExceptionProofRunnable
extends Object
implements Runnable

Runnable wrapper that catches any exception or error thrown from its delegate Runnable. Used for continuing scheduled execution even after an exception thrown from a task's Runnable.

Since:
2.0.5
Author:
Juergen Hoeller

Constructor Summary
DelegatingExceptionProofRunnable(Runnable delegate)
          Create a new DelegatingExceptionProofRunnable that logs the exception but isn't propagating it (in order to continue scheduled execution).
DelegatingExceptionProofRunnable(Runnable delegate, boolean propagateException)
          Create a new DelegatingExceptionProofRunnable.
 
Method Summary
 Runnable getDelegate()
          Return the wrapped Runnable implementation.
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegatingExceptionProofRunnable

public DelegatingExceptionProofRunnable(Runnable delegate)
Create a new DelegatingExceptionProofRunnable that logs the exception but isn't propagating it (in order to continue scheduled execution).

Parameters:
delegate - the Runnable implementation to delegate to

DelegatingExceptionProofRunnable

public DelegatingExceptionProofRunnable(Runnable delegate,
                                        boolean propagateException)
Create a new DelegatingExceptionProofRunnable.

Parameters:
delegate - the Runnable implementation to delegate to
propagateException - whether to propagate the exception after logging (note: this will typically cancel scheduled execution of the runnable)
Method Detail

getDelegate

public final Runnable getDelegate()
Return the wrapped Runnable implementation.


run

public void run()
Specified by:
run in interface Runnable


Copyright © 2002-2008 The Spring Framework.