/** * initialize the agent server here. * * @param context */ protected void activate(ComponentContext context) { String disableReceiver = System.getProperty(DISABLE_RECEIVER); if (disableReceiver != null && Boolean.parseBoolean(disableReceiver)) { log.info("Receiver disabled."); return; } binaryDataReceiver = new BinaryDataReceiver( new BinaryDataReceiverConfiguration(dataBridgeReceiverService.getInitialConfig()), dataBridgeReceiverService); try { binaryDataReceiver.start(); } catch (IOException e) { log.error("Error while starting binary data receiver ", e); } catch (DataBridgeException e) { log.error("Error while starting binary data receiver ", e); } }
protected void deactivate(ComponentContext context) { log.info("Binary Data Receiver server shutting down..."); binaryDataReceiver.stop(); }