org.asteriskjava.manager.internal.ProtocolIdentifierWrapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of asterisk-java Show documentation
Show all versions of asterisk-java Show documentation
The free Java library for Asterisk PBX integration.
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();
}
}