org.gcube.data.streams.handlers
Class CountingHandler
java.lang.Object
org.gcube.data.streams.handlers.CountingHandler
- All Implemented Interfaces:
- FaultHandler
public abstract class CountingHandler
- extends Object
- implements FaultHandler
A partial implementation for FaultHandler that count failures and keep track of the last observed failure.
- Author:
- Fabio Simeoni
|
Method Summary |
protected abstract void |
handle(Exception failure,
Exception lastFailure,
int failureCount)
Indicates whether iteration should continue or stop the iteration on the occurrence of an iteration failure. |
void |
handle(RuntimeException failure)
Indicates whether iteration should continue or stop the iteration on the occurrence of an iteration failure. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CountingHandler
public CountingHandler()
handle
public final void handle(RuntimeException failure)
- Description copied from interface:
FaultHandler
- Indicates whether iteration should continue or stop the iteration on the occurrence of an iteration failure.
- Specified by:
handle in interface FaultHandler
- Parameters:
failure - the failure
handle
protected abstract void handle(Exception failure,
Exception lastFailure,
int failureCount)
- Indicates whether iteration should continue or stop the iteration on the occurrence of an iteration failure.
- Parameters:
failure - the failurelastFailure - the failure observed previously, or null if this is the first observed failurefailureCount - the number of failures counted so far, 0 if this is the first observed failure
- Throws:
RuntimeException - if no element can be yielded from the input element
Copyright © 2012. All Rights Reserved.