All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.indeed.status.core.CallablePingMethod Maven / Gradle / Ivy

There is a newer version: 1.0.18
Show newest version
package com.indeed.status.core;

import javax.annotation.Nonnull;
import java.util.concurrent.Callable;
import java.util.concurrent.Executors;

/**
 * @author matts
 */
public class CallablePingMethod implements PingMethod {
    @Nonnull private final Callable delegate;

    public CallablePingMethod(@Nonnull final Callable delegate) {
        this.delegate = delegate;
    }

    public CallablePingMethod(@Nonnull final Runnable delegate) {
        this.delegate = Executors.callable(delegate, null);
    }

    @Override
    public void ping() throws Exception {
        delegate.call();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy