org.springframework.retry.listener
Class RetryListenerSupport

java.lang.Object
  extended by org.springframework.retry.listener.RetryListenerSupport
All Implemented Interfaces:
RetryListener

public class RetryListenerSupport
extends java.lang.Object
implements RetryListener

Empty method implementation of RetryListener.

Author:
Dave Syer

Constructor Summary
RetryListenerSupport()
           
 
Method Summary
<T> void
close(RetryContext context, RetryCallback<T> callback, java.lang.Throwable throwable)
          Called after the final attempt (successful or not).
<T> void
onError(RetryContext context, RetryCallback<T> callback, java.lang.Throwable throwable)
          Called after every unsuccessful attempt at a retry.
<T> boolean
open(RetryContext context, RetryCallback<T> callback)
          Called before the first attempt in a retry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RetryListenerSupport

public RetryListenerSupport()
Method Detail

close

public <T> void close(RetryContext context,
                      RetryCallback<T> callback,
                      java.lang.Throwable throwable)
Description copied from interface: RetryListener
Called after the final attempt (successful or not). Allow the interceptor to clean up any resource it is holding before control returns to the retry caller.

Specified by:
close in interface RetryListener
Parameters:
context - the current RetryContext.
callback - the current RetryCallback.
throwable - the last exception that was thrown by the callback.

onError

public <T> void onError(RetryContext context,
                        RetryCallback<T> callback,
                        java.lang.Throwable throwable)
Description copied from interface: RetryListener
Called after every unsuccessful attempt at a retry.

Specified by:
onError in interface RetryListener
Parameters:
context - the current RetryContext.
callback - the current RetryCallback.
throwable - the last exception that was thrown by the callback.

open

public <T> boolean open(RetryContext context,
                        RetryCallback<T> callback)
Description copied from interface: RetryListener
Called before the first attempt in a retry. For instance, implementers can set up state that is needed by the policies in the RetryOperations. The whole retry can be vetoed by returning false from this method, in which case a TerminatedRetryException will be thrown.

Specified by:
open in interface RetryListener
Parameters:
context - the current RetryContext.
callback - the current RetryCallback.
Returns:
true if the retry should proceed.


Copyright © 2011 SpringSource. All Rights Reserved.