use of com.swiftmq.tools.concurrent.Semaphore in project swiftmq-ce by iitsoftware.
the class Consumer method consume.
public void consume() {
sem = new Semaphore();
sem.waitHere();
if (exception != null)
failFast("failed: " + exception);
}
use of com.swiftmq.tools.concurrent.Semaphore in project swiftmq-ce by iitsoftware.
the class Listener method receive.
public void receive() {
try {
sem = new Semaphore();
subscriber.setMessageListener(this);
sem.waitHere();
if (exception != null)
throw exception;
verifier.verify();
} catch (Exception e) {
failFast("test failed: " + e);
}
}
use of com.swiftmq.tools.concurrent.Semaphore in project swiftmq-ce by iitsoftware.
the class Listener method receive.
public void receive() {
try {
Semaphore sem1 = new Semaphore();
subscriber.setMessageListener(new MyListener("testtopic-dur", new MsgNoVerifier(this, nMsgs, "no"), sem1));
Semaphore sem2 = new Semaphore();
subscriber1.setMessageListener(new MyListener("testtopic-dur1", new MsgNoVerifier(this, nMsgs, "no"), sem2));
Semaphore sem3 = new Semaphore();
subscriber2.setMessageListener(new MyListener("testtopic-dur2", new MsgNoVerifier(this, nMsgs, "no"), sem3));
sem1.waitHere();
sem2.waitHere();
sem3.waitHere();
if (exception != null)
throw exception;
} catch (Exception e) {
failFast("test failed: " + e);
}
}
use of com.swiftmq.tools.concurrent.Semaphore in project swiftmq-ce by iitsoftware.
the class Listener method receive.
public void receive() {
try {
Semaphore sem1 = new Semaphore();
subscriber.setMessageListener(new MyListener(ts, new MsgNoVerifier(this, nMsgs, "no"), sem1));
Semaphore sem2 = new Semaphore();
subscriber1.setMessageListener(new MyListener(session1, new MsgNoVerifier(this, nMsgs, "no"), sem2));
Semaphore sem3 = new Semaphore();
subscriber2.setMessageListener(new MyListener(session2, new MsgNoVerifier(this, nMsgs, "no"), sem3));
sem1.waitHere();
sem2.waitHere();
sem3.waitHere();
if (exception != null)
throw exception;
} catch (Exception e) {
failFast("test failed: " + e);
}
}
use of com.swiftmq.tools.concurrent.Semaphore in project swiftmq-ce by iitsoftware.
the class Listener method receive.
public void receive() {
try {
sem = new Semaphore();
subscriber.setMessageListener(this);
sem.waitHere();
if (exception != null)
throw exception;
verifier.verify();
} catch (Exception e) {
failFast("test failed: " + e);
}
}
Aggregations