class ServiceRegistration {

    @Produces
    @AddReservationUrl
    public String getAddNewReservationUrl() {
        if (lastCheck.isBefore(now().minusMinutes(MINUTES_PER_CHECK))) {
            available = false;

            // this is obviously bad...but ok for our example
            LOGGER.info(() -> "Checking availability of " + ADD_NEW_RESERVATION_URL);
            SocketConfig socketConfig = copy(DEFAULT).setSoTimeout(2000).build();
            try (CloseableHttpClient client = HttpClientBuilder.create().setDefaultSocketConfig(socketConfig).build(); CloseableHttpResponse response = client.execute(HttpHost.create(HOST_URL), new HttpGet(ADD_NEW_RESERVATION_URL))) {
                available = SC_OK == response.getStatusLine().getStatusCode();

                if (SC_OK != response.getStatusLine().getStatusCode()) {
                    LOGGER.log(WARNING, () -> "Cannot access url for new reservations!");
                }
            } catch (IOException e) {
                LOGGER.log(SEVERE, e, () -> "Cannot access url for new reservations!");
            }
        }

        return available ? ADD_NEW_RESERVATION_URL : null;
    }

}