com.netflix.karyon.server.eureka
Interface HealthCheckInvocationStrategy

All Known Implementing Classes:
AsyncHealthCheckInvocationStrategy, SyncHealthCheckInvocationStrategy

public interface HealthCheckInvocationStrategy

A strategy to make application specific healthchecks. Since, the application health checks can be poorly implemented and hence take a long time to complete, in some cases, it is wise to have an SLA around the health check response times.

The default health check strategy AsyncHealthCheckInvocationStrategy can be overridden by providing the strategy class name in the property PropertyNames.HEALTH_CHECK_STRATEGY which should implement this interface.
There is a 1:1 mapping between a strategy instance and a HealthCheckHandler instance and hence it is assumed that the strategy already knows about the handler instance.


Method Summary
 HealthCheckHandler getHandler()
          Returns the instance of HealthCheckHandler associated with this strategy.
 int invokeCheck()
          Invokes the handler associated with this strategy and returns the response.
 

Method Detail

invokeCheck

int invokeCheck()
                throws java.util.concurrent.TimeoutException
Invokes the handler associated with this strategy and returns the response. This method may block waiting for results.
If this strategy supports timeouts, this call must not wait more than the timeout value.

Returns:
The health check result.
Throws:
java.util.concurrent.TimeoutException - If the healthcheck did not return after the stipulated time (governed entirely by this strategy implementation)

getHandler

HealthCheckHandler getHandler()
Returns the instance of HealthCheckHandler associated with this strategy.

Returns:
The instance of HealthCheckHandler associated with this strategy.