@SuppressWarnings("unchecked") public PhysicalChannel generate(LogicalChannel channel, URI contributionUri, ChannelDirection direction) { String type = channel.getDefinition().getType(); ChannelGeneratorExtension generator = extensions.get(type); if (generator == null) { throw new Fabric3Exception("Channel generator not found: " + type); } PhysicalChannel physicalChannel = generator.generate(channel, contributionUri); if (!channel.getBindings().isEmpty()) { // generate binding information physicalChannel.setBound(true); physicalChannel.setChannelSide(ChannelDirection.CONSUMER == direction ? ChannelSide.CONSUMER : ChannelSide.PRODUCER); } else { physicalChannel.setChannelSide(ChannelSide.COLLOCATED); } return physicalChannel; }
@SuppressWarnings("unchecked") public PhysicalChannel generate(LogicalChannel channel, URI contributionUri, ChannelDirection direction) { String type = channel.getDefinition().getType(); ChannelGeneratorExtension generator = extensions.get(type); if (generator == null) { throw new Fabric3Exception("Channel generator not found: " + type); } PhysicalChannel physicalChannel = generator.generate(channel, contributionUri); if (!channel.getBindings().isEmpty()) { // generate binding information physicalChannel.setBound(true); physicalChannel.setChannelSide(ChannelDirection.CONSUMER == direction ? ChannelSide.CONSUMER : ChannelSide.PRODUCER); } else { physicalChannel.setChannelSide(ChannelSide.COLLOCATED); } return physicalChannel; }