/** * Safely end bridge loop. This routine should only be called from the shutdown hook thread in the main part of a * server. In other cases it will result in strange runtime errors. * * @throws ConnectorDataTransmissionException * An error occurred during data transmission and in this particular case while closing the data * transmission. */ public void shutdown() throws ConnectorDataTransmissionException { this.active = false; this.respawn = false; this.service.close(); this.kiekerMonitoringController.terminateMonitoring(); }
do { this.updateState("Starting service container."); this.service.initialize(); this.active = true; while (this.active) { try { this.kiekerMonitoringController.newMonitoringRecord(this.service.deserializeNextRecord()); this.numRecordsReceived++; if ((this.numRecordsReceived % this.listenerUpdateInterval) == 0) { this.service.close(); } while (this.respawn);
/** * Initialize a service connector and trigger a failure on error. */ protected void initialize() { try { LOGGER.info("Initialize connector {}", this.connector.getClass().toString()); this.connector.initialize(); } catch (final ConnectorDataTransmissionException e) { Assert.fail("Connector initialization failed: " + e.getMessage()); } }
LOGGER.debug("Receive record {}", i); try { final OperationExecutionRecord record = (OperationExecutionRecord) this.connector.deserializeNextRecord(); Assert.assertEquals("Tin is not equal", ConfigurationParameters.TEST_TIN, record.getTin()); Assert.assertEquals("Tout is not equal", ConfigurationParameters.TEST_TOUT, record.getTout());
do { this.updateState("Starting service container."); this.service.initialize(); this.active = true; while (this.active) { try { this.kiekerMonitoringController.newMonitoringRecord(this.service.deserializeNextRecord()); this.numRecordsReceived++; if ((this.numRecordsReceived % this.listenerUpdateInterval) == 0) { this.service.close(); } while (this.respawn);
/** * Safely end bridge loop. This routine should only be called from the shutdown hook thread in the main part of a * server. In other cases it will result in strange runtime errors. * * @throws ConnectorDataTransmissionException * An error occurred during data transmission and in this particular case while closing the data * transmission. */ public void shutdown() throws ConnectorDataTransmissionException { this.active = false; this.respawn = false; this.service.close(); this.kiekerMonitoringController.terminateMonitoring(); }
/** * Close a service connector and trigger a failure on errors. * * @param numberOfRecords * number of expected records */ protected void close(final int numberOfRecords) { try { LOGGER.info("Terminate connector {}", this.connector.getClass().toString()); this.connector.close(); } catch (final ConnectorDataTransmissionException e) { Assert.fail("Connector termination failed: " + e.getMessage()); } Assert.assertEquals("Number of send records is not equal to number of received records", numberOfRecords, this.getRecordCount()); }