Top Description Fields Constructors Methods
org.springframework.scheduling.support

public Class DelegatingErrorHandlingRunnable

extends Object
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable
Known Direct Subclasses
org.springframework.scheduling.concurrent.ReschedulingRunnable
Imports
java.lang.reflect.UndeclaredThrowableException, org.springframework.util.Assert, .ErrorHandler

Runnable wrapper that catches any exception or error thrown from its delegate Runnable and allows an ErrorHandler to handle it.
Authors
Juergen Hoeller, Mark Fisher
Since
3.0

Field Summary

Modifier and TypeField and Description
private final Runnable
private final ErrorHandler

Constructor Summary

AccessConstructor and Description
public
DelegatingErrorHandlingRunnable(Runnable
the Runnable implementation to delegate to
delegate
,
ErrorHandler
the ErrorHandler for handling any exceptions
errorHandler
)

Create a new DelegatingErrorHandlingRunnable.

Method Summary

Modifier and TypeMethod and Description
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

delegateback to summary
private final Runnable delegate
errorHandlerback to summary
private final ErrorHandler errorHandler

Constructor Detail

DelegatingErrorHandlingRunnableback to summary
public DelegatingErrorHandlingRunnable(Runnable delegate, ErrorHandler errorHandler)

Create a new DelegatingErrorHandlingRunnable.

Parameters
delegate:Runnable

the Runnable implementation to delegate to

errorHandler:ErrorHandler

the ErrorHandler for handling any exceptions

Method Detail

runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override