Search in sources :

Example 1 with POCloseLink

use of com.swiftmq.amqp.v100.client.po.POCloseLink in project swiftmq-client by iitsoftware.

the class Link method remoteDetach.

protected void remoteDetach(Error error) {
    this.error = error;
    mySession.detach(this);
    cancel();
    POCloseLink po = new POCloseLink(null, this);
    mySession.getSessionDispatcher().dispatch(po);
}
Also used : POCloseLink(com.swiftmq.amqp.v100.client.po.POCloseLink)

Example 2 with POCloseLink

use of com.swiftmq.amqp.v100.client.po.POCloseLink in project swiftmq-client by iitsoftware.

the class Link method close.

/**
 * Close this link.
 *
 * @throws AMQPException on error
 */
public void close() throws AMQPException {
    if (closed)
        return;
    Semaphore sem = new Semaphore();
    POCloseLink po = new POCloseLink(sem, this);
    mySession.getSessionDispatcher().dispatch(po);
    sem.waitHere();
    mySession.detach(this);
    closed = true;
    if (!po.isSuccess())
        throw new AMQPException(po.getException());
}
Also used : Semaphore(com.swiftmq.tools.concurrent.Semaphore) POCloseLink(com.swiftmq.amqp.v100.client.po.POCloseLink)

Aggregations

POCloseLink (com.swiftmq.amqp.v100.client.po.POCloseLink)2 Semaphore (com.swiftmq.tools.concurrent.Semaphore)1