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

org.javabits.yar.guice.NoWaitBlockingSupplier Maven / Gradle / Ivy

package org.javabits.yar.guice;

import org.javabits.yar.*;

import java.lang.InterruptedException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

import static org.javabits.yar.Registry.DEFAULT_TIMEOUT;
import static org.javabits.yar.Registry.DEFAULT_TIME_UNIT;

/**
 * @author Romain Gilles
 *         Date: 5/31/13
 *         Time: 2:08 PM
 */
public class NoWaitBlockingSupplier extends BlockingSupplierImpl {

    public NoWaitBlockingSupplier(Id id, Supplier supplier) {
        super(id, supplier, DEFAULT_TIMEOUT, DEFAULT_TIME_UNIT);
    }

    @Override
    public T getSync() throws InterruptedException {
        return get();
    }

    @Override
    public T getSync(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException {
        return get();

    }

    @Override
    public String toString() {
        return "NoWaitBlockingSupplier{" +
                "super=" + super.toString() +
                '}';
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy