Example usage for org.springframework.integration.endpoint EventDrivenConsumer setBeanFactory

List of usage examples for org.springframework.integration.endpoint EventDrivenConsumer setBeanFactory

Introduction

In this page you can find the example usage for org.springframework.integration.endpoint EventDrivenConsumer setBeanFactory.

Prototype

@Override
    public void setBeanFactory(BeanFactory beanFactory) 

Source Link

Usage

From source file:io.jmnarloch.spring.cloud.stream.binder.hermes.HermesClientBinder.java

private EventDrivenConsumer createConsumer(String name, SubscribableChannel channel, MessageHandler handler) {
    EventDrivenConsumer consumer = new EventDrivenConsumer(channel, handler);
    consumer.setBeanFactory(getBeanFactory());
    consumer.setBeanName(String.format(BEAN_NAME_TEMPLATE, name));
    consumer.afterPropertiesSet();//from  ww w .  ja  v  a  2s.  c om
    return consumer;
}

From source file:org.springframework.xd.dirt.integration.bus.MessageBusSupport.java

private void bindProducerDirectly(String name, SubscribableChannel producerChannel,
        MessageChannel consumerChannel, AbstractBusPropertiesAccessor properties) {
    DirectHandler handler = new DirectHandler(consumerChannel);
    EventDrivenConsumer consumer = new EventDrivenConsumer(producerChannel, handler);
    consumer.setBeanFactory(getBeanFactory());
    consumer.setBeanName("outbound." + name);
    consumer.afterPropertiesSet();/*w  w w.ja  va 2s  .c  o m*/
    Binding binding = Binding.forDirectProducer(name, producerChannel, consumer, properties);
    addBinding(binding);
    binding.start();
    if (logger.isInfoEnabled()) {
        logger.info("Producer bound directly: " + binding);
    }
}

From source file:org.springframework.xd.dirt.integration.rabbit.RabbitMessageBus.java

private void doRegisterProducer(final String name, MessageChannel moduleOutputChannel,
        AmqpOutboundEndpoint delegate, String replyTo, RabbitPropertiesAccessor properties) {
    Assert.isInstanceOf(SubscribableChannel.class, moduleOutputChannel);
    MessageHandler handler = new SendingHandler(delegate, replyTo, properties);
    EventDrivenConsumer consumer = new EventDrivenConsumer((SubscribableChannel) moduleOutputChannel, handler);
    consumer.setBeanFactory(getBeanFactory());
    consumer.setBeanName("outbound." + name);
    consumer.afterPropertiesSet();/*ww  w.  j  a  va  2 s  .  c om*/
    Binding producerBinding = Binding.forProducer(name, moduleOutputChannel, consumer, properties);
    addBinding(producerBinding);
    producerBinding.start();
}