Example usage for org.springframework.integration.support.channel BeanFactoryChannelResolver BeanFactoryChannelResolver

List of usage examples for org.springframework.integration.support.channel BeanFactoryChannelResolver BeanFactoryChannelResolver

Introduction

In this page you can find the example usage for org.springframework.integration.support.channel BeanFactoryChannelResolver BeanFactoryChannelResolver.

Prototype

public BeanFactoryChannelResolver(BeanFactory beanFactory) 

Source Link

Document

Create a new instance of the BeanFactoryChannelResolver class.

Usage

From source file:rg.springframework.integration.samples.ws.WebServiceDemoTestApp.java

public static void main(String[] args) {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
            "/META-INF/spring/integration/temperatureConversion.xml");
    ChannelResolver channelResolver = new BeanFactoryChannelResolver(context);

    // Compose the XML message according to the server's schema
    String requestXml = "<FahrenheitToCelsius xmlns=\"http://tempuri.org/\">"
            + "    <Fahrenheit>90.0</Fahrenheit>" + "</FahrenheitToCelsius>";

    // Create the Message object
    Message<String> message = MessageBuilder.withPayload(requestXml).build();

    // Send the Message to the handler's input channel
    MessageChannel channel = channelResolver.resolveChannelName("fahrenheitChannel");
    channel.send(message);//w w  w  . j a v  a 2s . co m
}

From source file:org.grails.plugin.platform.events.registry.SpringIntegrationEventsRegistry.java

public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
    this.beanFactory = (ConfigurableBeanFactory) beanFactory;
    this.resolver = new BeanFactoryChannelResolver(beanFactory);
}

From source file:org.springframework.integration.channel.MessagePublishingErrorHandler.java

public void setBeanFactory(BeanFactory beanFactory) {
    Assert.notNull(beanFactory, "beanFactory must not be null");
    if (this.channelResolver == null) {
        this.channelResolver = new BeanFactoryChannelResolver(beanFactory);
    }//www  .  j  a v  a2s .c  om
}

From source file:org.springframework.integration.config.annotation.AbstractMethodAnnotationPostProcessor.java

@SuppressWarnings("unchecked")
public AbstractMethodAnnotationPostProcessor(ConfigurableListableBeanFactory beanFactory) {
    Assert.notNull(beanFactory, "'beanFactory' must not be null");
    this.messageHandlerAttributes.add(SEND_TIMEOUT_ATTRIBUTE);
    this.beanFactory = beanFactory;
    ConversionService conversionService = this.beanFactory.getConversionService();
    if (conversionService != null) {
        this.conversionService = conversionService;
    } else {/* ww  w . jav  a 2 s. c o m*/
        this.conversionService = DefaultConversionService.getSharedInstance();
    }
    this.channelResolver = new BeanFactoryChannelResolver(beanFactory);
    this.annotationType = (Class<T>) GenericTypeResolver.resolveTypeArgument(this.getClass(),
            MethodAnnotationPostProcessor.class);
}

From source file:org.springframework.integration.core.ErrorMessagePublisher.java

@Override
public void setBeanFactory(BeanFactory beanFactory) {
    Assert.notNull(beanFactory, "beanFactory must not be null");
    if (this.channelResolver == null) {
        this.channelResolver = new BeanFactoryChannelResolver(beanFactory);
    }/*w  w w. j a v  a2  s .c  om*/
}

From source file:org.springframework.integration.core.MessagingTemplate.java

public void setBeanFactory(BeanFactory beanFactory) {
    if (this.channelResolver == null && beanFactory != null) {
        this.channelResolver = new BeanFactoryChannelResolver(beanFactory);
    }/*w  ww.  ja v  a2 s. c o m*/
}

From source file:org.springframework.integration.handler.DelayHandler.java

protected void onInit() throws Exception {
    if (this.getTaskScheduler() instanceof ExecutorConfigurationSupport) {
        ((ExecutorConfigurationSupport) this.getTaskScheduler())
                .setWaitForTasksToCompleteOnShutdown(this.waitForTasksToCompleteOnShutdown);
    } else if (logger.isWarnEnabled()) {
        logger.warn(/*from   w  w  w . j  av  a2s. c o m*/
                "The 'waitForJobsToCompleteOnShutdown' property is not supported for TaskScheduler of type ["
                        + this.getTaskScheduler().getClass() + "]");
    }
    if (this.messageStore == null) {
        this.messageStore = new SimpleMessageStore();
    }
    if (this.getTaskScheduler() instanceof InitializingBean) {
        ((InitializingBean) this.getTaskScheduler()).afterPropertiesSet();
    }
    if (this.getBeanFactory() != null) {
        this.channelResolver = new BeanFactoryChannelResolver(this.getBeanFactory());
    }
}