public void register(Channel channel) throws Fabric3Exception { if (started) { channel.start(); } ChannelSide channelSide = channel.getChannelSide(); if (ChannelSide.COLLOCATED == channelSide) { checkAndPut(channel, collocatedChannels); } else if (ChannelSide.CONSUMER == channelSide) { checkAndPut(channel, consumerChannels); } else if (ChannelSide.PRODUCER == channelSide) { checkAndPut(channel, producerChannels); } }
private void doStop(URI uri, Map<URI, Holder> map) { map.values().stream().filter(holder -> uri.equals(holder.channel.getContributionUri())).forEach(holder -> holder.channel.stop()); started = false; }
private void checkAndPut(Channel channel, Map<URI, Holder> map) throws Fabric3Exception { URI uri = channel.getUri(); if (map.put(uri, new Holder(channel)) != null) { throw new Fabric3Exception("Channel already exists: " + uri); } }
private void doStart(URI uri, Map<URI, Holder> map) { started = true; map.values().stream().filter(holder -> uri.equals(holder.channel.getContributionUri())).forEach(holder -> holder.channel.start()); }
public void attach(ChannelSource source, PhysicalConnectionTarget target, ChannelConnection connection) throws Fabric3Exception { connection.setCloseable(() -> { // no-op }); if (target.isDirectConnection()) { // no event stream to attach since this is a direct connection return; } URI uri = source.getUri(); Channel channel = getChannel(uri, source.getChannelSide()); URI targetUri = target.getUri(); channel.subscribe(targetUri, connection); }
public void attach(PhysicalConnectionSource source, ChannelTarget target, ChannelConnection connection) { if (source.isDirectConnection()) { // no event stream to attach since this is a direct connection return; } URI uri = target.getUri(); Channel channel = getChannel(uri, target.getChannelSide()); channel.attach(connection); connection.setCloseable(() -> { // no-op }); }
public void detach(ChannelSource source, PhysicalConnectionTarget target) throws Fabric3Exception { if (target.isDirectConnection()) { // no event stream to attach since this is a direct connection return; } URI uri = source.getUri(); Channel channel = getChannel(uri, source.getChannelSide()); URI targetUri = target.getUri(); channel.unsubscribe(targetUri, target.getTopic()); }
throw new Fabric3Exception("Channel not found: " + channelUri); supplier = () -> channel.getDirectConnection(topic);
private void doStart(URI uri, Map<URI, Holder> map) { started = true; map.values().stream().filter(holder -> uri.equals(holder.channel.getContributionUri())).forEach(holder -> holder.channel.start()); }
public void attach(ChannelSource source, PhysicalConnectionTarget target, ChannelConnection connection) throws Fabric3Exception { connection.setCloseable(() -> { // no-op }); if (target.isDirectConnection()) { // no event stream to attach since this is a direct connection return; } URI uri = source.getUri(); Channel channel = getChannel(uri, source.getChannelSide()); URI targetUri = target.getUri(); channel.subscribe(targetUri, connection); }
public void attach(PhysicalConnectionSource source, ChannelTarget target, ChannelConnection connection) { if (source.isDirectConnection()) { // no event stream to attach since this is a direct connection return; } URI uri = target.getUri(); Channel channel = getChannel(uri, target.getChannelSide()); channel.attach(connection); connection.setCloseable(() -> { // no-op }); }
public void detach(ChannelSource source, PhysicalConnectionTarget target) throws Fabric3Exception { if (target.isDirectConnection()) { // no event stream to attach since this is a direct connection return; } URI uri = source.getUri(); Channel channel = getChannel(uri, source.getChannelSide()); URI targetUri = target.getUri(); channel.unsubscribe(targetUri, target.getTopic()); }
throw new Fabric3Exception("Channel not found: " + channelUri); supplier = () -> channel.getDirectConnection(topic);
private void doStop(URI uri, Map<URI, Holder> map) { map.values().stream().filter(holder -> uri.equals(holder.channel.getContributionUri())).forEach(holder -> holder.channel.stop()); started = false; }
public void register(Channel channel) throws Fabric3Exception { if (started) { channel.start(); } ChannelSide channelSide = channel.getChannelSide(); if (ChannelSide.COLLOCATED == channelSide) { checkAndPut(channel, collocatedChannels); } else if (ChannelSide.CONSUMER == channelSide) { checkAndPut(channel, consumerChannels); } else if (ChannelSide.PRODUCER == channelSide) { checkAndPut(channel, producerChannels); } }
private void checkAndPut(Channel channel, Map<URI, Holder> map) throws Fabric3Exception { URI uri = channel.getUri(); if (map.put(uri, new Holder(channel)) != null) { throw new Fabric3Exception("Channel already exists: " + uri); } }