Search in sources :

Example 1 with CloseStageQueueRequest

use of com.swiftmq.impl.routing.single.smqpr.CloseStageQueueRequest in project swiftmq-ce by iitsoftware.

the class StageQueue method process.

protected void process(Object[] bulk, int n) {
    if (ctx.traceSpace.enabled)
        ctx.traceSpace.trace(ctx.routingSwiftlet.getName(), "StageQueue/process, n=" + n);
    for (int i = 0; i < n; i++) {
        Request r = (Request) bulk[i];
        if (r.getDumpId() == SMQRFactory.CLOSE_STAGE_QUEUE_REQ) {
            if (ctx.traceSpace.enabled)
                ctx.traceSpace.trace(ctx.routingSwiftlet.getName(), "StageQueue/receiving: " + r);
            close();
            Semaphore sem = ((CloseStageQueueRequest) r).getSemaphore();
            if (sem != null)
                sem.notifySingleWaiter();
            return;
        }
        if (stage != null)
            stage.process((Request) bulk[i]);
    }
    if (ctx.traceSpace.enabled)
        ctx.traceSpace.trace(ctx.routingSwiftlet.getName(), "StageQueue/process, done");
}
Also used : CloseStageQueueRequest(com.swiftmq.impl.routing.single.smqpr.CloseStageQueueRequest) CloseStageQueueRequest(com.swiftmq.impl.routing.single.smqpr.CloseStageQueueRequest) Request(com.swiftmq.tools.requestreply.Request) Semaphore(com.swiftmq.tools.concurrent.Semaphore)

Aggregations

CloseStageQueueRequest (com.swiftmq.impl.routing.single.smqpr.CloseStageQueueRequest)1 Semaphore (com.swiftmq.tools.concurrent.Semaphore)1 Request (com.swiftmq.tools.requestreply.Request)1