io.dropwizard.health.conf.response.HealthServletFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dropwizard-health Show documentation
Show all versions of dropwizard-health Show documentation
Provides a health check implementation that performs ongoing monitoring of an application's dependencies and includes
an endpoint that can be called by a load balancer to determine if the application is healthy and thus able to retrieve
traffic.
package io.dropwizard.health.conf.response;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import io.dropwizard.jackson.Discoverable;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.servlet.http.HttpServlet;
/**
* A factory for building an {@link HttpServlet} instance used for responding to health check requests.
*
* @see DefaultHealthServletFactory
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl = DefaultHealthServletFactory.class)
public interface HealthServletFactory extends Discoverable {
/**
* Build a servlet for responding to health check requests (e.g. from load balancer).
*
* @param isHealthy a flag indicating whether the application is healthy or not
* @return a {@link HttpServlet} that responds to health check requests
*/
HttpServlet build(final AtomicBoolean isHealthy);
}