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.
package org.asteriskjava.manager.internal;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
class ProtocolIdentifierWrapper
{
private 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;
}
void countDown()
{
latch.countDown();
}
public void setValue(String identifier)
{
value = identifier;
}
}