
com.indeed.status.core.CheckMethod Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of status-core Show documentation
Show all versions of status-core Show documentation
Basic core functionality for status checking of app dependencies
package com.indeed.status.core;
import javax.annotation.Nonnull;
/**
* The CheckMethod
represents a combination between a Callable<CheckResult> and a
* Function<Dependency, CheckResult>. Implementers of this interface are responsible for performing some
* method to evaluate the availability of the given dependency. The dependency itself is passed to the
* execution to allow the metadata associated with the dependency to be added to the resulting CheckResult.
*
* CheckMethod instances are typically passed to a {@link SimpleDependency} builder for execution during scheduled
* health checks.
*
* The checkMethod implementation may be triggered by multiple threads simultaneously and thus must be
* implemented in a thread-safe manner. No synchronization is performed by the healthcheck framework;
* any areas of the code that must be guarded must be explicitly locked by the implementation itself.
*
* @see SimpleDependency
*/
public interface CheckMethod {
/**
* @param dependency The dependency being executed. Effectively a metadata provider so that the ID, description,
* et cetera, can be recorded on the CheckResult
*/
@Nonnull
CheckResult call(@Nonnull Dependency dependency) throws Exception;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy