private PhysicalChannelConnection generateLocalConnection(LogicalProducer producer, Class<?> type, LogicalChannel channel, PhysicalConnectionSource source, ClassLoader classLoader) { URI uri = channel.getUri(); PhysicalConnectionTarget target = new ChannelTarget(uri, ChannelSide.PRODUCER); target.setClassLoader(classLoader); boolean bound = channel.isBound(); return new PhysicalChannelConnection(uri, producer.getUri(), source, target, type, bound); }
private PhysicalChannelConnection generateLocalConnection(LogicalProducer producer, Class<?> type, LogicalChannel channel, PhysicalConnectionSource source, ClassLoader classLoader) { URI uri = channel.getUri(); PhysicalConnectionTarget target = new ChannelTarget(uri, ChannelSide.PRODUCER); target.setClassLoader(classLoader); boolean bound = channel.isBound(); return new PhysicalChannelConnection(uri, producer.getUri(), source, target, type, bound); }
@SuppressWarnings({"unchecked"}) private PhysicalChannelConnection generateDirectBoundConnection(LogicalProducer producer, LogicalChannel channel, DeliveryType deliveryType, ClassLoader classLoader, PhysicalConnectionSource source) { LogicalBinding<?> binding = channel.getBinding(); ConnectionBindingGenerator bindingGenerator = getGenerator(binding); PhysicalConnectionTarget target = bindingGenerator.generateConnectionTarget(producer, binding, deliveryType); target.setClassLoader(classLoader); URI uri = channel.getUri(); Class<?> type = producer.getDefinition().getServiceContract().getInterfaceClass(); // the type is the producer interface since it is direct return new PhysicalChannelConnection(uri, producer.getUri(), source, target, type, true); }
@SuppressWarnings({"unchecked"}) private PhysicalChannelConnection generateDirectBoundConnection(LogicalProducer producer, LogicalChannel channel, DeliveryType deliveryType, ClassLoader classLoader, PhysicalConnectionSource source) { LogicalBinding<?> binding = channel.getBinding(); ConnectionBindingGenerator bindingGenerator = getGenerator(binding); PhysicalConnectionTarget target = bindingGenerator.generateConnectionTarget(producer, binding, deliveryType); target.setClassLoader(classLoader); URI uri = channel.getUri(); Class<?> type = producer.getDefinition().getServiceContract().getInterfaceClass(); // the type is the producer interface since it is direct return new PhysicalChannelConnection(uri, producer.getUri(), source, target, type, true); }
public List<PhysicalChannelConnection> generateConsumer(LogicalConsumer consumer, Map<LogicalChannel, DeliveryType> channels) { LogicalComponent<?> component = consumer.getParent(); ComponentGenerator<?> generator = getGenerator(component); PhysicalConnectionTarget target = generator.generateConnectionTarget(consumer); URI classLoaderId = component.getDefinition().getContributionUri(); ClassLoader classLoader = classLoaderRegistry.getClassLoader(classLoaderId); target.setClassLoader(classLoader); if (isDirect(consumer, channels)) { target.setDirectConnection(true); return generateDirectConnections(consumer, channels, target, classLoader); } else { return generateConnections(consumer, channels, target, classLoader); } }
public List<PhysicalChannelConnection> generateConsumer(LogicalConsumer consumer, Map<LogicalChannel, DeliveryType> channels) { LogicalComponent<?> component = consumer.getParent(); ComponentGenerator<?> generator = getGenerator(component); PhysicalConnectionTarget target = generator.generateConnectionTarget(consumer); URI classLoaderId = component.getDefinition().getContributionUri(); ClassLoader classLoader = classLoaderRegistry.getClassLoader(classLoaderId); target.setClassLoader(classLoader); if (isDirect(consumer, channels)) { target.setDirectConnection(true); return generateDirectConnections(consumer, channels, target, classLoader); } else { return generateConnections(consumer, channels, target, classLoader); } }
@SuppressWarnings({"unchecked"}) private PhysicalChannelConnection generateBoundConnection(LogicalProducer producer, LogicalChannel channel, DeliveryType deliveryType, ClassLoader classLoader) { LogicalBinding<?> binding = channel.getBinding(); ConnectionBindingGenerator bindingGenerator = getGenerator(binding); PhysicalConnectionTarget target = bindingGenerator.generateConnectionTarget(producer, binding, deliveryType); target.setClassLoader(classLoader); URI uri = channel.getUri(); ChannelSource source = new ChannelSource(uri, ChannelSide.PRODUCER); source.setClassLoader(classLoader); boolean bound = channel.isBound(); Class<?> type = getType(producer); return new PhysicalChannelConnection(uri, producer.getUri(), source, target, type, bound); }
@SuppressWarnings({"unchecked"}) private PhysicalChannelConnection generateBoundConnection(LogicalProducer producer, LogicalChannel channel, DeliveryType deliveryType, ClassLoader classLoader) { LogicalBinding<?> binding = channel.getBinding(); ConnectionBindingGenerator bindingGenerator = getGenerator(binding); PhysicalConnectionTarget target = bindingGenerator.generateConnectionTarget(producer, binding, deliveryType); target.setClassLoader(classLoader); URI uri = channel.getUri(); ChannelSource source = new ChannelSource(uri, ChannelSide.PRODUCER); source.setClassLoader(classLoader); boolean bound = channel.isBound(); Class<?> type = getType(producer); return new PhysicalChannelConnection(uri, producer.getUri(), source, target, type, bound); }