/** * Start the notification publisher. Upon this point, the user will be able * to push notifications. * * @throws IOException * if the notification publisher cannot connect to the broker * used by the specified Collector configuration */ public void start() throws IOException { LOGGER.info("Starting notification publisher for {}...",this.configuration.getInstance()); try { this.controller.connect(); LOGGER.info("Notification publisher for {} started",this.configuration.getInstance()); } catch (final ControllerException e) { LOGGER.warn("Could not start publisher using {}. Full stacktrace follows",this.configuration,e); throw new IOException("Could not start publisher using "+this.configuration,e); } }
private CollectorController startController(final CollectorConfiguration collector, final String queueName) throws ControllerException { final CollectorController controller = CollectorController.createNamedReceiver(collector,queueName,this.notificationQueue); LOGGER.info("Connecting controller for collector {}...",collector.getInstance()); try { controller.connect(); return controller; } catch (final ControllerException e) { LOGGER.warn("Could not connect controller for collector {}. Full stacktrace follows",collector.getInstance(),e); shutdownGracefully(); throw e; } }