Announcement Announcement Module
Collapse
No announcement yet.
Configure Flex using Java Configuration Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Configure Flex using Java Configuration

    Hi all,

    I would like to configure Spring-Flex using Java Configuration, however the 'MessageBroker' is always null.

    Here is my configuration class:

    Code:
    @Configuration
    public class SpringWebFlexConfig {
    
    	private static final Logger	LOG	= LoggerFactory.getLogger(SpringWebFlexConfig.class);
    
    	/**
    	 * 
    	 * @return
    	 */
    	@Bean
    	public HandlerMapping handlerMapping() {
    		return new SimpleUrlHandlerMapping();
    	}
    
    	@Bean
    	public MessageBroker messageBroker() {
    		LOG.debug("Creating new Bean 'messageBroker'");
    
    		try {
    			MessageBrokerFactoryBean messabeBrokerFactoryBean = new MessageBrokerFactoryBean();
    			MessageBroker messageBroker = messabeBrokerFactoryBean.getObject();
    
    			if (messageBroker == null)
    				LOG.error("Error, the 'messageBroker' bean is null!");
    
    			return messageBroker;
    		} catch (Exception e) {
    			LOG.error("Exception while creating the bean 'messageBroker'", e);
    		}
    		return null;
    	}
    
    	@Bean
    	public MessageBrokerHandlerAdapter messageBrokerHandlerAdapter() {
    		LOG.debug("Creating new Bean 'messageBrokerHandlerAdapter'");
    		return new MessageBrokerHandlerAdapter();
    	}
    
    }
    Am I missing some things here?
    Thanks!
    Paul
Working...
X