/** * Returns the channel in the invocable hierarchy. * * @param channelUri the channel uri * @param invocable the invocable * @return the channel * @throws Fabric3Exception if the channel is not found */ public static LogicalChannel getChannelInHierarchy(URI channelUri, LogicalInvocable invocable) throws Fabric3Exception { LogicalChannel channel = null; LogicalCompositeComponent parent = invocable.getParent().getParent(); while (true) { if (parent != null) { channel = parent.getChannel(channelUri); if (channel != null) { break; } parent = parent.getParent(); } else { break; } } if (channel == null) { throw new Fabric3Exception("Channel not found: " + channelUri); } return channel; }
/** * Returns the channel in the invocable hierarchy. * * @param channelUri the channel uri * @param invocable the invocable * @return the channel * @throws ChannelNotFoundException if the channel is not found */ public static LogicalChannel getChannelInHierarchy(URI channelUri, LogicalInvocable invocable) throws ChannelNotFoundException { LogicalChannel channel = null; LogicalCompositeComponent parent = invocable.getParent().getParent(); while (true) { if (parent != null) { channel = parent.getChannel(channelUri); if (channel != null) { break; } parent = parent.getParent(); } else { break; } } if (channel == null) { throw new ChannelNotFoundException("Channel not found: " + channelUri); } return channel; }
/** * Returns the channel in the invocable hierarchy. * * @param channelUri the channel uri * @param invocable the invocable * @return the channel * @throws Fabric3Exception if the channel is not found */ public static LogicalChannel getChannelInHierarchy(URI channelUri, LogicalInvocable invocable) throws Fabric3Exception { LogicalChannel channel = null; LogicalCompositeComponent parent = invocable.getParent().getParent(); while (true) { if (parent != null) { channel = parent.getChannel(channelUri); if (channel != null) { break; } parent = parent.getParent(); } else { break; } } if (channel == null) { throw new Fabric3Exception("Channel not found: " + channelUri); } return channel; }
public LogicalOperation resolve(LogicalOperation source, List<LogicalOperation> targets) { Operation sourceDefinition = source.getDefinition(); for (LogicalOperation target : targets) { Operation targetDefinition = target.getDefinition(); if (sourceDefinition.getName().equals(targetDefinition.getName())) { List<DataType> sourceInputTypes = sourceDefinition.getInputTypes(); DataType sourceOutputType = sourceDefinition.getOutputType(); DataType targetOutputType = targetDefinition.getOutputType(); if (sourceOutputType.equals(targetOutputType) && sourceInputTypes.equals(targetDefinition.getInputTypes())) { return target; } } } LogicalInvocable parent = source.getParent(); if (parent != null) { String sourceComponent = parent.getParent().getUri().toString(); throw new Fabric3Exception("Target operation not found for " + sourceDefinition.getName() + " on source component " + sourceComponent); } else { throw new Fabric3Exception("Target operation not found for " + sourceDefinition.getName()); } }
public LogicalOperation resolve(LogicalOperation source, List<LogicalOperation> targets) { Operation sourceDefinition = source.getDefinition(); for (LogicalOperation target : targets) { Operation targetDefinition = target.getDefinition(); if (sourceDefinition.getName().equals(targetDefinition.getName())) { List<DataType> sourceInputTypes = sourceDefinition.getInputTypes(); DataType sourceOutputType = sourceDefinition.getOutputType(); DataType targetOutputType = targetDefinition.getOutputType(); if (sourceOutputType.equals(targetOutputType) && sourceInputTypes.equals(targetDefinition.getInputTypes())) { return target; } } } LogicalInvocable parent = source.getParent(); if (parent != null) { String sourceComponent = parent.getParent().getUri().toString(); throw new Fabric3Exception("Target operation not found for " + sourceDefinition.getName() + " on source component " + sourceComponent); } else { throw new Fabric3Exception("Target operation not found for " + sourceDefinition.getName()); } }