use of com.swiftmq.impl.routing.single.jobs.JobRegistrar in project swiftmq-ce by iitsoftware.
the class RoutingSwiftletImpl method startup.
protected void startup(Configuration config) throws SwiftletException {
this.config = config;
root = config;
passwords = Collections.synchronizedMap(new HashMap());
connectionEntities = Collections.synchronizedMap(new HashMap());
connections = Collections.synchronizedSet(new HashSet());
ctx = createSwiftletContext(this, root);
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace(getName(), "startup ...");
acceptor = new Acceptor();
createRoutingQueues();
createStaticRoutes((EntityList) root.getEntity("static-routes"));
createListeners((EntityList) root.getEntity("listeners"));
createConnectors((EntityList) root.getEntity("connectors"));
SwiftletManager.getInstance().addSwiftletManagerListener("sys$scheduler", new SwiftletManagerAdapter() {
public void swiftletStarted(SwiftletManagerEvent event) {
ctx.schedulerSwiftlet = (SchedulerSwiftlet) SwiftletManager.getInstance().getSwiftlet("sys$scheduler");
jobRegistrar = new JobRegistrar(ctx);
jobRegistrar.register();
}
public void swiftletStopInitiated(SwiftletManagerEvent event) {
jobRegistrar.unregister();
}
});
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace(getName(), "startup done");
}
Aggregations