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

org.asteriskjava.manager.internal.ProtocolIdentifierWrapper Maven / Gradle / Ivy

The newest version!
package org.asteriskjava.manager.internal;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

class ProtocolIdentifierWrapper {
    private volatile CountDownLatch latch = new CountDownLatch(1);
    private String value;

    void reset() {
        value = null;
        latch = new CountDownLatch(1);
    }

    boolean await(long timeout) throws InterruptedException {
        return latch.await(timeout, TimeUnit.MILLISECONDS);
    }

    String getValue() {
        return value;
    }

    public void setValue(String identifier) {
        value = identifier;
        latch.countDown();

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy