com.github.phantomthief.failover.SimpleFailover Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of simple-failover Show documentation
Show all versions of simple-failover Show documentation
A simple failover library for Java
package com.github.phantomthief.failover;
import java.util.Collection;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/**
* @author huangli
* Created on 2020-01-15
*/
public interface SimpleFailover {
default void success(@Nonnull T object) {
// default behavior: do nothing
}
void fail(@Nonnull T object);
void down(@Nonnull T object);
@Nullable
T getOneAvailable();
@Nullable
T getOneAvailableExclude(Collection exclusions);
}