private LogicalChannel getChannel(String name) throws Fabric3Exception { LogicalCompositeComponent domainComponent = lcm.getDomainComposite(); String domainRoot = domainComponent.getUri().toString(); URI channelUri = URI.create(domainRoot + "/" + name); LogicalChannel logicalChannel = domainComponent.getChannel(channelUri); if (logicalChannel == null) { throw new NotFoundException("Channel not found: " + name); } return logicalChannel; }
private LogicalChannel getChannel(String name) throws ResolverException { LogicalCompositeComponent domainComponent = lcm.getRootComponent(); String domainRoot = domainComponent.getUri().toString(); URI channelUri = URI.create(domainRoot + "/" + name); LogicalChannel logicalChannel = domainComponent.getChannel(channelUri); if (logicalChannel == null) { throw new NotFoundException("Channel not found: " + name); } return logicalChannel; }
private LogicalChannel getChannel(String name) throws Fabric3Exception { LogicalCompositeComponent domainComponent = lcm.getDomainComposite(); String domainRoot = domainComponent.getUri().toString(); URI channelUri = URI.create(domainRoot + "/" + name); LogicalChannel logicalChannel = domainComponent.getChannel(channelUri); if (logicalChannel == null) { throw new NotFoundException("Channel not found: " + name); } return logicalChannel; }
/** * 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 void instantiateChannels(Composite composite, LogicalCompositeComponent parent, InstantiationContext context) { for (ChannelDefinition definition : composite.getChannels().values()) { URI uri = URI.create(parent.getUri() + "/" + definition.getName()); if (parent.getChannel(uri) != null) { DuplicateChannel error = new DuplicateChannel(uri, parent); context.addError(error); continue; } LogicalChannel channel = new LogicalChannel(uri, definition, parent); for (BindingDefinition binding : definition.getBindings()) { LogicalBinding<BindingDefinition> logicalBinding = new LogicalBinding<BindingDefinition>(binding, channel); channel.addBinding(logicalBinding); } channel.setDeployable(composite.getName()); parent.addChannel(channel); } }
public void instantiateChannels(Composite composite, LogicalCompositeComponent parent, InstantiationContext context) { for (Channel definition : composite.getChannels().values()) { URI uri = URI.create(parent.getUri() + "/" + definition.getName()); if (parent.getChannel(uri) != null) { DuplicateChannel error = new DuplicateChannel(uri, parent); context.addError(error); continue; } LogicalChannel channel = new LogicalChannel(uri, definition, parent); for (Binding binding : definition.getBindings()) { LogicalBinding<Binding> logicalBinding = new LogicalBinding<>(binding, channel); channel.addBinding(logicalBinding); } channel.setDeployable(composite.getName()); parent.addChannel(channel); } }
public void instantiateChannels(Composite composite, LogicalCompositeComponent parent, InstantiationContext context) { for (Channel definition : composite.getChannels().values()) { URI uri = URI.create(parent.getUri() + "/" + definition.getName()); if (parent.getChannel(uri) != null) { DuplicateChannel error = new DuplicateChannel(uri, parent); context.addError(error); continue; } LogicalChannel channel = new LogicalChannel(uri, definition, parent); for (Binding binding : definition.getBindings()) { LogicalBinding<Binding> logicalBinding = new LogicalBinding<>(binding, channel); channel.addBinding(logicalBinding); } channel.setDeployable(composite.getName()); parent.addChannel(channel); } }