Search in sources :

Example 1 with POClose

use of com.swiftmq.impl.streams.processor.po.POClose in project swiftmq-ce by iitsoftware.

the class StreamController method stop.

private synchronized void stop() {
    if (ctx.traceSpace.enabled)
        ctx.traceSpace.trace(ctx.streamsSwiftlet.getName(), toString() + "/stop ...");
    if (!started)
        return;
    try {
        ctx.streamsSwiftlet.stopDependencies(fqn);
    } catch (Exception e) {
        e.printStackTrace();
    }
    ctx.logSwiftlet.logInformation(ctx.streamsSwiftlet.getName(), "Stopping Stream: " + fqn);
    started = false;
    Semaphore sem = new Semaphore();
    streamContext.streamProcessor.dispatch(new POClose(sem));
    sem.waitHere(5000);
    try {
        ctx.usageList.removeEntity(streamContext.usage);
    } catch (EntityRemoveException e) {
    }
    if (ctx.traceSpace.enabled)
        ctx.traceSpace.trace(ctx.streamsSwiftlet.getName(), toString() + "/stop done");
}
Also used : Semaphore(com.swiftmq.tools.concurrent.Semaphore) POClose(com.swiftmq.impl.streams.processor.po.POClose) MalformedURLException(java.net.MalformedURLException)

Aggregations

POClose (com.swiftmq.impl.streams.processor.po.POClose)1 Semaphore (com.swiftmq.tools.concurrent.Semaphore)1 MalformedURLException (java.net.MalformedURLException)1