Description
Current javadoc is following
/** * this will create the runtime the information required for running the component. They can depend an the given * <code>properties</code> parameter and the connector topology. The <code>connectorTopology</code> shall be one of * supported topologies returned by {@link #getSupportedConnectorTopologies()} * * @param engine the engine to get a runtime for. * @param properties may be used to compute the runtime dependencies or class, may be null. * @param connectorTopology the topology of connectors you want to get the Runtime from. * * @return the runtime information related to this component and <code>connectorTopology</code>. Should return null if the * <code>componentType</code> is not par of the supported types returned by {@link #getSupportedConnectorTopologies()} */
However suggested default implementation is following
@Override public RuntimeInfo getRuntimeInfo(ExecutionEngine engine, ComponentProperties properties, ConnectorTopology connectorTopology) { assertEngineCompatibility(engine); assertConnectorTopologyCompatibility(connectorTopology); return RuntimeInfoProvider.provideInputRuntimeInfo(); }
This implementation throws exception if wrong engine or connectorTopology is passed.
Example:
org.talend.daikon.exception.TalendRuntimeException: WRONG_CONNECTOR:{component=TableInput} at org.talend.daikon.exception.TalendRuntimeException$TalendRuntimeExceptionBuilder.create(TalendRuntimeException.java:304) at org.talend.daikon.exception.TalendRuntimeException$TalendRuntimeExceptionBuilder.throwIt(TalendRuntimeException.java:290) at org.talend.components.api.component.AbstractComponentDefinition.throwIncompatibleConnectorTopologyException(AbstractComponentDefinition.java:118) at org.talend.components.api.component.AbstractComponentDefinition.assertConnectorTopologyCompatibility(AbstractComponentDefinition.java:109) at org.talend.components.table.ttableinput.TableInputDefinition.getRuntimeInfo(TableInputDefinition.java:69) ...
It is supposed that client code calls
getSupportedConnectorTopologies()
getSupportedExecutionEngines()
before calling
getRuntimeInfo()
This issue is to decide which approach is correct and modify code according it.