Examples of HealthCheck


Examples of netflix.karyon.examples.hellonoss.common.health.HealthCheck

* @author Nitesh Kant
*/
public class MyApplicationRunner {

    public static void main(String[] args) {
        HealthCheck healthCheckHandler = new HealthCheck();
        Karyon.forRequestHandler(8888,
                                 new RxNettyHandler("/healthcheck",
                                                    new HealthCheckEndpoint(healthCheckHandler)),
                                 new KaryonBootstrapSuite(healthCheckHandler),
                                 new ArchaiusSuite("hello-netflix-oss"),
View Full Code Here

Examples of org.apache.sling.hc.api.HealthCheck

        if ( refs != null ) {
            final List<ServiceReference> sortedRefs = Arrays.asList(refs);
            Collections.sort(sortedRefs);

            for(final ServiceReference ref : sortedRefs) {
                final HealthCheck hc = (HealthCheck)bundleContext.getService(ref);
                log.debug("Selected HealthCheck service {}", hc);
                if ( hc != null ) {
                    this.usedReferences.add(ref);
                    result.add(hc);
                }
View Full Code Here

Examples of org.apache.sling.hc.api.HealthCheck

                final StopWatch stopWatch = new StopWatch();
                stopWatch.start();
                Result resultFromHealthCheck = null;
                ExecutionResult executionResult = null;

                final HealthCheck healthCheck = (HealthCheck) bundleContext.getService(metadata.getServiceReference());

                try {
                    if (healthCheck != null) {
                        resultFromHealthCheck = healthCheck.execute();
                    } else {
                        throw new IllegalStateException("Service for " + metadata + " is gone");
                    }

                } catch (final Exception e) {
View Full Code Here

Examples of org.apache.sling.hc.api.HealthCheck

            if(OSGiFilter.contains(key)) {
                final HcLogSetter hls = LOG_SETTERS.get(key);
                final ServiceReference ref = Mockito.mock(ServiceReference.class);
                Mockito.when(ref.getProperty(Constants.SERVICE_ID)).thenReturn(random.nextLong());
                Mockito.when(ref.getProperty(HealthCheck.NAME)).thenReturn("someTest");
                final HealthCheck hc = new HealthCheck() {
                    @Override
                    public Result execute() {
                        final FormattingResultLog log = new FormattingResultLog();
                        return new Result(hls.setLog(log));
                    }
View Full Code Here

Examples of org.apache.sling.hc.api.HealthCheck

    @Test
    public void testAsyncHealthCheck() throws InterruptedException {
        final String id = UUID.randomUUID().toString();
        final AtomicInteger counter = new AtomicInteger(Integer.MIN_VALUE);
        final HealthCheck hc = new HealthCheck() {
            @Override
            public Result execute() {
                final int v = counter.incrementAndGet();
                return new Result(Result.Status.OK, "counter is now " + v);
            }
View Full Code Here

Examples of org.fenixedu.bennu.core.rest.Healthcheck

        final String TWILIO_STOKEN = FenixEduAcademicConfiguration.getConfiguration().getTwilioStoken();
        final String URL = "/" + TwilioRestClient.DEFAULT_VERSION + "/Accounts/" + TWILIO_SID + ".json";
        TWILIO_FROM_NUMBER = FenixEduAcademicConfiguration.getConfiguration().getTwilioFromNumber();
        if (!StringUtils.isEmpty(TWILIO_SID) && !StringUtils.isEmpty(TWILIO_STOKEN) && !StringUtils.isEmpty(TWILIO_FROM_NUMBER)) {
            TWILIO_CLIENT = new TwilioRestClient(TWILIO_SID, TWILIO_STOKEN);
            SystemResource.registerHealthcheck(new Healthcheck() {
                private final Gson gson = new GsonBuilder().setPrettyPrinting().create();

                @Override
                public String getName() {
                    return "Twilio";
View Full Code Here

Examples of org.fenixedu.bennu.core.rest.Healthcheck

        logger.info("Fenix initialized successfully");
    }

    private void registerHealthchecks() {
        SystemResource.registerHealthcheck(new Healthcheck() {
            @Override
            public String getName() {
                return "SMTP";
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.