DisposeChannelCommand disposeCommand = channelGenerator.generateDispose(channel, deployable, PRODUCER); command.addDisposeChannelCommand(disposeCommand); channels.put(channel, disposeCommand.getDefinition().getDeliveryType()); BuildChannelCommand buildCommand = channelGenerator.generateBuild(channel, deployable, PRODUCER); command.addBuildChannelCommand(buildCommand); channels.put(channel, buildCommand.getDefinition().getDeliveryType());
DisposeChannelCommand disposeCommand = channelGenerator.generateDispose(channel, deployable, CONSUMER); command.addDisposeChannelCommand(disposeCommand); channels.put(channel, disposeCommand.getDefinition().getDeliveryType()); BuildChannelCommand buildCommand = channelGenerator.generateBuild(channel, deployable, CONSUMER); command.addBuildChannelCommand(buildCommand); channels.put(channel, buildCommand.getDefinition().getDeliveryType());
@SuppressWarnings({"unchecked"}) private PhysicalChannelDefinition generateChannelDefinition(LogicalChannel channel, QName deployable, Direction direction) throws GenerationException { LogicalBinding<?> binding = channel.getBinding(); String type = channel.getDefinition().getType(); ChannelGenerator generator = channelGenerators.get(type); if (generator == null) { throw new GenerationException("Channel generator not found: " + type); } PhysicalChannelDefinition definition = generator.generate(channel, deployable); if (!channel.getBindings().isEmpty()) { // generate binding information if (!(binding.getDefinition() instanceof SCABinding)) { // avoid generating SCABinding ConnectionBindingGenerator bindingGenerator = getGenerator(binding); ChannelDeliveryType deliveryType = definition.getDeliveryType(); PhysicalChannelBindingDefinition bindingDefinition = bindingGenerator.generateChannelBinding(binding, deliveryType); definition.setBindingDefinition(bindingDefinition); definition.setChannelSide(Direction.CONSUMER == direction ? ChannelSide.CONSUMER : ChannelSide.PRODUCER); } else { definition.setChannelSide(ChannelSide.COLLOCATED); } } else { definition.setChannelSide(ChannelSide.COLLOCATED); } return definition; }