public void introspect(Channel channel) { channel.getBindings().forEach(b -> { if (b instanceof NATSBinding) { b.setConnectionTypes(Nats.class, Subscription.class); } }); } }
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); } }