Skip to content
Snippets Groups Projects
Commit 05e15f26 authored by Christian Wulf's avatar Christian Wulf
Browse files

added catch in RunnableStage;

reverted Recordfactory in TCPReader
parent 877e3e67
No related branches found
No related tags found
No related merge requests found
package teetime.variant.methodcallWithPorts.framework.core; package teetime.variant.methodcallWithPorts.framework.core;
import kieker.common.logging.Log;
import kieker.common.logging.LogFactory;
public class RunnableStage implements Runnable { public class RunnableStage implements Runnable {
private final StageWithPort<?, ?> stage; private final StageWithPort<?, ?> stage;
private final Log logger;
public RunnableStage(final StageWithPort<?, ?> stage) { public RunnableStage(final StageWithPort<?, ?> stage) {
this.stage = stage; this.stage = stage;
this.logger = LogFactory.getLog(stage.getClass());
} }
@Override @Override
public void run() { public void run() {
this.stage.onStart(); try {
this.stage.onStart();
do { do {
this.stage.executeWithPorts(); this.stage.executeWithPorts();
} while (this.stage.isReschedulable()); } while (this.stage.isReschedulable());
} catch (RuntimeException e) {
this.logger.error("Terminating thread due to the following exception: ", e);
throw e;
}
} }
} }
...@@ -58,7 +58,7 @@ public class EndStage<T> implements StageWithPort<T, T> { ...@@ -58,7 +58,7 @@ public class EndStage<T> implements StageWithPort<T, T> {
@Override @Override
public void executeWithPorts() { public void executeWithPorts() {
// this.getInputPort().receive(); // just consume this.getInputPort().receive(); // just consume
// do nothing // do nothing
// this.count++; // this.count++;
// Object r = this.closure.execute(null); // Object r = this.closure.execute(null);
......
...@@ -28,6 +28,7 @@ import teetime.variant.methodcallWithPorts.framework.core.ProducerStage; ...@@ -28,6 +28,7 @@ import teetime.variant.methodcallWithPorts.framework.core.ProducerStage;
import kieker.common.exception.MonitoringRecordException; import kieker.common.exception.MonitoringRecordException;
import kieker.common.logging.Log; import kieker.common.logging.Log;
import kieker.common.logging.LogFactory; import kieker.common.logging.LogFactory;
import kieker.common.record.AbstractMonitoringRecord;
import kieker.common.record.IMonitoringRecord; import kieker.common.record.IMonitoringRecord;
import kieker.common.record.flow.trace.TraceMetadata; import kieker.common.record.flow.trace.TraceMetadata;
import kieker.common.record.flow.trace.operation.AfterOperationEvent; import kieker.common.record.flow.trace.operation.AfterOperationEvent;
...@@ -150,8 +151,8 @@ public class TCPReader extends ProducerStage<Void, IMonitoringRecord> { ...@@ -150,8 +151,8 @@ public class TCPReader extends ProducerStage<Void, IMonitoringRecord> {
final long loggingTimestamp = buffer.getLong(); final long loggingTimestamp = buffer.getLong();
final IMonitoringRecord record; final IMonitoringRecord record;
try { // NOCS (Nested try-catch) try { // NOCS (Nested try-catch)
record = this.recordFactory.create(clazzid, buffer, this.stringRegistry); // record = this.recordFactory.create(clazzid, buffer, this.stringRegistry);
// record = AbstractMonitoringRecord.createFromByteBuffer(clazzid, buffer, this.stringRegistry); record = AbstractMonitoringRecord.createFromByteBuffer(clazzid, buffer, this.stringRegistry);
record.setLoggingTimestamp(loggingTimestamp); record.setLoggingTimestamp(loggingTimestamp);
this.send(record); this.send(record);
} catch (final MonitoringRecordException ex) { } catch (final MonitoringRecordException ex) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment