All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.rbuck.retry.RetryEvent Maven / Gradle / Ivy

Go to download

Lets developers make their applications more resilient by adding robust transient fault handling logic. Transient faults are errors that occur because of some temporary condition such as network connectivity issues or service unavailability. Typically, if you retry the operation that resulted in a transient error a short time later, you find that the error has disappeared.

There is a newer version: 1.2
Show newest version
package com.github.rbuck.retry;

/**
 * Represents current retry state.
 *
 * @author Robert Buck ([email protected])
 */
public class RetryEvent extends java.util.EventObject {

    private final RetryState state;
    private final Exception cause;

    /**
     * Constructs a prototypical Event.
     *
     * @param source The object on which the Event initially occurred.
     * @param state  the retry state
     * @throws IllegalArgumentException if source is null.
     */
    public RetryEvent(Object source, RetryState state, Exception cause) {
        super(source);
        this.state = state;
        this.cause = cause;
    }

    @Override
    public Object getSource() {
        return super.getSource();
    }

    public int getRetryCount() {
        return state.getRetryCount();
    }

    public long getRetryDelay() {
        return state.getRetryDelay();
    }

    public Exception getCause() {
        return cause;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy