Skip to content
Snippets Groups Projects
Commit 9821b618 authored by Nelson Tavares de Sousa's avatar Nelson Tavares de Sousa
Browse files

Merge remote-tracking branch 'origin/master' into exception-handling

Conflicts:
	.classpath
	src/main/java/teetime/framework/AbstractRunnableStage.java
	src/main/java/teetime/framework/AbstractStage.java
	src/main/java/teetime/framework/AnalysisException.java
	src/main/java/teetime/framework/exceptionHandling/IgnoringStageListener.java
	src/main/java/teetime/framework/exceptionHandling/LoggingStageListener.java
	src/main/java/teetime/framework/exceptionHandling/StageException.java
	src/main/java/teetime/framework/exceptionHandling/StageExceptionHandler.java
	src/main/java/teetime/framework/exceptionHandling/TerminatingStageListener.java
	src/main/java/teetime/stage/PortTypeConfiguration.java
	src/main/java/teetime/stage/io/AbstractTcpReader.java
	src/performancetest/java/teetime/runtime/typeCheck/ConnectionTypeTest.java
	src/test/java/teetime/framework/ExceptionHandling.java
	src/test/java/teetime/framework/ExceptionTestConfiguration.java
	src/test/java/teetime/framework/ExceptionTestConsumerStage.java
	src/test/java/teetime/framework/ExceptionTestProducerStage.java
	src/test/java/teetime/framework/exceptionHandling/TestListener.java
parents 676e9be8 0f28daa7
No related branches found
No related tags found
No related merge requests found
......@@ -5,13 +5,13 @@ cleanup.add_missing_deprecated_annotations=true
cleanup.add_missing_methods=false
cleanup.add_missing_nls_tags=false
cleanup.add_missing_override_annotations=true
cleanup.add_missing_override_annotations_interface_methods=true
cleanup.add_missing_override_annotations_interface_methods=false
cleanup.add_serial_version_id=true
cleanup.always_use_blocks=true
cleanup.always_use_parentheses_in_expressions=true
cleanup.always_use_this_for_non_static_field_access=false
cleanup.always_use_this_for_non_static_method_access=false
cleanup.convert_functional_interfaces=true
cleanup.always_use_this_for_non_static_field_access=true
cleanup.always_use_this_for_non_static_method_access=true
cleanup.convert_functional_interfaces=false
cleanup.convert_to_enhanced_for_loop=true
cleanup.correct_indentation=true
cleanup.format_source_code=true
......@@ -51,15 +51,15 @@ cleanup.use_blocks_only_for_return_and_throw=false
cleanup.use_lambda=true
cleanup.use_parentheses_in_expressions=true
cleanup.use_this_for_non_static_field_access=true
cleanup.use_this_for_non_static_field_access_only_if_necessary=true
cleanup.use_this_for_non_static_field_access_only_if_necessary=false
cleanup.use_this_for_non_static_method_access=true
cleanup.use_this_for_non_static_method_access_only_if_necessary=true
cleanup.use_this_for_non_static_method_access_only_if_necessary=false
cleanup.use_type_arguments=false
cleanup_profile=_TeeTime - Clean Up
cleanup_settings_version=2
eclipse.preferences.version=1
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
formatter_profile=_TeeTime - Profile
formatter_profile=_TeeTime - Formatter
formatter_settings_version=12
org.eclipse.jdt.ui.ignorelowercasenames=true
org.eclipse.jdt.ui.importorder=java;javax;junit;org;com;kieker;kieker.test;
......
......@@ -26,7 +26,12 @@ public abstract class AbstractPort<T> {
* <i>Used to validate the connection between two ports at runtime.</i>
* </p>
*/
protected Class<T> type;
protected final Class<T> type;
public AbstractPort(final Class<T> type) {
super();
this.type = type;
}
public IPipe getPipe() {
return this.pipe;
......@@ -39,8 +44,4 @@ public abstract class AbstractPort<T> {
public Class<T> getType() {
return this.type;
}
public void setType(final Class<T> type) {
this.type = type;
}
}
......@@ -126,10 +126,23 @@ public abstract class AbstractStage extends Stage {
* Creates and adds an InputPort to the stage
*
* @return Newly added InputPort
*
*/
// * @deprecated Since 1.1. Use {@link #createInputPort(Class)} instead.
@SuppressWarnings("unchecked")
// @Deprecated
protected <T> InputPort<T> createInputPort() {
final InputPort<T> inputPort = new InputPort<T>(this);
// inputPort.setType(portType);
return (InputPort<T>) createInputPort(null);
}
/**
* Creates and adds an InputPort to the stage
*
* @param type
* @return Newly added InputPort
*/
protected <T> InputPort<T> createInputPort(final Class<T> type) {
final InputPort<T> inputPort = new InputPort<T>(type, this);
inputPorts = addElementToArray(inputPort, inputPorts);
return inputPort;
}
......@@ -138,10 +151,23 @@ public abstract class AbstractStage extends Stage {
* Creates and adds an OutputPort to the stage
*
* @return Newly added OutputPort
*
*/
// * @deprecated Since 1.1. Use {@link #createOutputPort(Class)} instead.
@SuppressWarnings("unchecked")
// @Deprecated
protected <T> OutputPort<T> createOutputPort() {
final OutputPort<T> outputPort = new OutputPort<T>();
// outputPort.setType(portType);
return (OutputPort<T>) createOutputPort(null);
}
/**
* Creates and adds an OutputPort to the stage
*
* @param type
* @return Newly added OutputPort
*/
protected <T> OutputPort<T> createOutputPort(final Class<T> type) {
final OutputPort<T> outputPort = new OutputPort<T>(type);
outputPorts = addElementToArray(outputPort, outputPorts);
return outputPort;
}
......
......@@ -19,8 +19,8 @@ public final class InputPort<T> extends AbstractPort<T> {
private final Stage owningStage;
InputPort(final Stage owningStage) {
super();
InputPort(final Class<T> type, final Stage owningStage) {
super(type);
this.owningStage = owningStage;
}
......
......@@ -29,8 +29,8 @@ import teetime.framework.signal.TerminatingSignal;
*/
public final class OutputPort<T> extends AbstractPort<T> {
OutputPort() {
super();
OutputPort(final Class<T> type) {
super(type);
}
/**
......
......@@ -18,8 +18,8 @@ package teetime.framework.exceptionHandling;
import teetime.framework.Stage;
/**
* Represents an Exception, which is thrown by stages in case of they throw exceptions.
* To get the original exception, which was thrown, call {@link #getCause()}. {@link #getThrowingStage()} returns the stage, which has thrown the original exception.
* Represents an Exception, which is thrown by stages in case of theyimport teetime.framework.Stage;
original exception, which was thrown, call {@link #getCause()}. {@link #getThrowingStage()} returns the stage, which has thrown the original exception.
*
* @since 1.1
*/
......
/**
* Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://teetime.sourceforge.net)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package teetime.stage;
import teetime.util.TimestampObject;
public class PortTypeConfiguration {
public static <T> void setPortTypes(final ObjectProducer<T> stage, final Class<T> clazz) {
stage.getOutputPort().setType(clazz);
}
public static <T> void setPortTypes(final CollectorSink<T> stage, final Class<T> clazz) {
stage.getInputPort().setType(clazz);
}
public static <T> void setPortTypes(final StartTimestampFilter stage) {
stage.getInputPort().setType(TimestampObject.class);
stage.getOutputPort().setType(TimestampObject.class);
}
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="12">
<profile kind="CodeFormatterProfile" name="TeeTime - Profile" version="12">
<profile kind="CodeFormatterProfile" name="TeeTime - Formatter" version="12">
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
......
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