cleaned up cleanup procedure
This commit is contained in:
@@ -45,6 +45,8 @@ public class ExecutionJob implements Runnable {
|
||||
private final String trackingId;
|
||||
private final EDescriptor edescriptor;
|
||||
|
||||
private EventBus ebus;
|
||||
|
||||
public ExecutionJob(ChannelService cService, ZMQDataService zmqService, String trackingId, EDescriptor edescriptor) {
|
||||
this.zmqService = zmqService;
|
||||
this.cService = cService;
|
||||
@@ -60,13 +62,15 @@ public class ExecutionJob implements Runnable {
|
||||
|
||||
logger.info("Execute ----" + trackingId);
|
||||
|
||||
EventBus ebus = new EventBus();
|
||||
ebus = new EventBus();
|
||||
|
||||
// Configure ZMQ streaming service and attach it to event bus
|
||||
zmqService.setTrackingId(trackingId);
|
||||
// TODO e.g. set some filters on what is streamed
|
||||
// TODO stream a metadata message on what is streamed via the zmq service
|
||||
ebus.register(zmqService);
|
||||
|
||||
// Post visualization configuration
|
||||
// ebus.post(edescriptor.getVisualization());
|
||||
|
||||
|
||||
Injector injector = Guice.createInjector(new InjectionModule(cService));
|
||||
|
||||
ServiceLoader<EContainerFactory> factories = ServiceLoader.load(EContainerFactory.class);
|
||||
@@ -78,15 +82,13 @@ public class ExecutionJob implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
econtainer.initialize();
|
||||
econtainer.execute();
|
||||
econtainer.destroy();
|
||||
econtainer.initialize();
|
||||
econtainer.execute();
|
||||
|
||||
logger.info("" + trackingId + " done");
|
||||
logger.info("Done ----" + trackingId);
|
||||
|
||||
// Cleanup
|
||||
ebus.unregister(zmqService);
|
||||
} finally {
|
||||
ebus.unregister(zmqService);
|
||||
if(econtainer!=null){
|
||||
econtainer.destroy();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user