use of org.springframework.integration.endpoint.MessageProducerSupport in project spring-integration by spring-projects.
the class IntegrationGraphServer method producers.
private void producers(Collection<IntegrationNode> nodes, Collection<LinkNode> links, Map<String, MessageChannelNode> channelNodes) {
Map<String, MessageProducerSupport> producers = this.applicationContext.getBeansOfType(MessageProducerSupport.class);
for (Entry<String, MessageProducerSupport> entry : producers.entrySet()) {
MessageProducerSupport producer = entry.getValue();
MessageProducerNode producerNode = this.nodeFactory.producerNode(entry.getKey(), producer);
nodes.add(producerNode);
producerLink(links, channelNodes, producerNode);
}
}
use of org.springframework.integration.endpoint.MessageProducerSupport in project spring-integration by spring-projects.
the class ManualFlowTests method testWithAnonymousMessageProducerSpecStart.
@Test
public void testWithAnonymousMessageProducerSpecStart() {
final AtomicBoolean started = new AtomicBoolean();
class MyProducer extends MessageProducerSupport {
@Override
protected void doStart() {
started.set(true);
super.doStart();
}
}
class MyProducerSpec extends MessageProducerSpec<MyProducerSpec, MyProducer> {
MyProducerSpec(MyProducer producer) {
super(producer);
}
}
MyProducerSpec spec = new MyProducerSpec(new MyProducer());
QueueChannel channel = new QueueChannel();
IntegrationFlow flow = IntegrationFlows.from(spec.id("foo")).channel(channel).get();
this.integrationFlowContext.registration(flow).register();
assertTrue(started.get());
}
use of org.springframework.integration.endpoint.MessageProducerSupport in project spring-integration by spring-projects.
the class ManualFlowTests method testWithAnonymousMessageProducerStart.
@Test
public void testWithAnonymousMessageProducerStart() {
final AtomicBoolean started = new AtomicBoolean();
MessageProducerSupport producer = new MessageProducerSupport() {
@Override
protected void doStart() {
started.set(true);
super.doStart();
}
};
QueueChannel channel = new QueueChannel();
IntegrationFlow flow = IntegrationFlows.from(producer).channel(channel).get();
this.integrationFlowContext.registration(flow).register();
assertTrue(started.get());
}
Aggregations