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

fixed compilation problem

parent 92d53a75
No related branches found
No related tags found
No related merge requests found
/**
* Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://christianwulf.github.io/teetime)
*
* 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.basic.distributor.dynamic;
import teetime.framework.DynamicOutputPort;
......
......@@ -31,11 +31,6 @@ public class RemovePortAction<T> implements PortAction<DynamicDistributor<T>> {
@Override
public void execute(final DynamicDistributor<T> dynamicDistributor) {
DynamicOutputPort<T> realOutputPort = outputPort;
if (outputPort instanceof PortContainer) { // BETTER replace test-specific code and abstract appropriately
realOutputPort = ((PortContainer<T>) outputPort).getPort();
}
dynamicDistributor.removeDynamicPort(realOutputPort);
dynamicDistributor.removeDynamicPort(outputPort);
}
}
/**
* Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://christianwulf.github.io/teetime)
*
* 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.util.framework.port;
import java.util.ArrayList;
......
/**
* Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://christianwulf.github.io/teetime)
*
* 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.util.framework.port;
import teetime.framework.AbstractPort;
......
......@@ -87,11 +87,11 @@ public class DynamicDistributorTest {
final PortContainer<Integer> portContainer2 = new PortContainer<Integer>();
inputActions[0] = createPortCreateAction(portContainer0);
inputActions[1] = new RemovePortAction<Integer>(portContainer0);
inputActions[1] = new RemovePortActionDelegation<Integer>(portContainer0);
inputActions[2] = createPortCreateAction(portContainer1);
inputActions[3] = createPortCreateAction(portContainer2);
inputActions[4] = new RemovePortAction<Integer>(portContainer1);
inputActions[5] = new RemovePortAction<Integer>(portContainer2);
inputActions[4] = new RemovePortActionDelegation<Integer>(portContainer1);
inputActions[5] = new RemovePortActionDelegation<Integer>(portContainer2);
DynamicDistributorTestConfig<Integer> config = new DynamicDistributorTestConfig<Integer>(inputNumbers, Arrays.asList(inputActions));
Execution<DynamicDistributorTestConfig<Integer>> analysis = new Execution<DynamicDistributorTestConfig<Integer>>(config);
......
/**
* Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://christianwulf.github.io/teetime)
*
* 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.basic.distributor.dynamic;
import teetime.framework.DynamicOutputPort;
......@@ -9,18 +24,11 @@ import teetime.framework.DynamicOutputPort;
*
* @param <T>
*/
class PortContainer<T> extends DynamicOutputPort<T> {
final class PortContainer<T> {
private DynamicOutputPort<T> port;
PortContainer() {
super(null, null, -1);
}
@Override
public int getIndex() {
return port.getIndex();
}
PortContainer() {}
public void setPort(final DynamicOutputPort<T> port) {
this.port = port;
......
/**
* Copyright (C) 2015 Christian Wulf, Nelson Tavares de Sousa (http://christianwulf.github.io/teetime)
*
* 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.basic.distributor.dynamic;
import teetime.framework.DynamicOutputPort;
import teetime.util.framework.port.PortAction;
/**
* Simulates a {@link RemovePortAction} by means of a {@link PortContainer} instead of an {@link DynamicOutputPort}.
*
* @author Christian Wulf
*
* @param <T>
*/
public class RemovePortActionDelegation<T> implements PortAction<DynamicDistributor<T>> {
private final PortContainer<T> portContainer;
public RemovePortActionDelegation(final PortContainer<T> portContainer) {
this.portContainer = portContainer;
}
@Override
public void execute(final DynamicDistributor<T> dynamicDistributor) {
DynamicOutputPort<?> dynamicOutputPort = portContainer.getPort();
dynamicDistributor.removeDynamicPort(dynamicOutputPort);
}
}
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