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");
}
Aggregations