Search in sources :

Example 1 with POCloseObject

use of com.swiftmq.impl.routing.single.schedule.po.POCloseObject in project swiftmq-ce by iitsoftware.

the class DefaultScheduler method close.

public void close() {
    // debug    ctx.timerSwiftlet.removeTimerListener(tl);
    if (ctx.traceSpace.enabled)
        ctx.traceSpace.trace(ctx.routingSwiftlet.getName(), toString() + "/close ...");
    synchronized (this) {
        if (closed)
            return;
        for (Iterator iter = connections.iterator(); iter.hasNext(); ) {
            ConnectionEntry entry = (ConnectionEntry) iter.next();
            iter.remove();
            connectionRemoved(entry.getRoutingConnection());
        }
    }
    Semaphore sem = new Semaphore();
    enqueueClose(new POCloseObject(null, sem));
    sem.waitHere();
    if (ctx.traceSpace.enabled)
        ctx.traceSpace.trace(ctx.routingSwiftlet.getName(), toString() + "/close done");
}
Also used : POCloseObject(com.swiftmq.impl.routing.single.schedule.po.POCloseObject) Semaphore(com.swiftmq.tools.concurrent.Semaphore)

Aggregations

POCloseObject (com.swiftmq.impl.routing.single.schedule.po.POCloseObject)1 Semaphore (com.swiftmq.tools.concurrent.Semaphore)1