org.springframework.flex.messaging
Class MessageBrokerFactoryBean
java.lang.Object
org.springframework.flex.messaging.MessageBrokerFactoryBean
- All Implemented Interfaces:
- org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.ResourceLoaderAware, org.springframework.web.context.ServletContextAware
public class MessageBrokerFactoryBean
- extends java.lang.Object
- implements org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanNameAware, org.springframework.context.ResourceLoaderAware, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean, org.springframework.web.context.ServletContextAware
FactoryBean that creates a local MessageBroker instance
within a Spring web application context. The resulting Spring-managed
MessageBroker can be used to export Spring beans for direct remoting from a
Flex client.
By default, this FactoryBean will look for a BlazeDS config file at
/WEB-INF/flex/services-config.xml. This location may be overridden using the
servicesConfigPath property. Spring's ResourceLoader abstraction is
used to load the config resources, so the location may be specified using
ant-style paths.
The initialization of the MessageBroker logically consists of two phases:
-
Parsing the BlazeDS XML configuration files and applying their settings to a newly
created MessageBroker
-
Starting the MessageBroker and its services
Further custom configuration of the MessageBroker can be achieved through registering
custom MessageBrokerConfigProcessor instances with this FactoryBean via the
configProcessors property.
Http-based messages should be routed to the MessageBroker using the
DispatcherServlet in combination with the
MessageBrokerHandlerAdapter.
- Author:
- Jeremy Grelle
- See Also:
MessageBrokerHandlerAdapter,
MessageBrokerConfigProcessor
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MessageBrokerFactoryBean
public MessageBrokerFactoryBean()
getObject
public java.lang.Object getObject()
throws java.lang.Exception
- Return the singleton MessageBroker.
- Specified by:
getObject in interface org.springframework.beans.factory.FactoryBean
- Throws:
java.lang.Exception
getObjectType
public java.lang.Class<? extends flex.messaging.MessageBroker> getObjectType()
- Specified by:
getObjectType in interface org.springframework.beans.factory.FactoryBean
getConfigProcessors
public java.util.Set<MessageBrokerConfigProcessor> getConfigProcessors()
isSingleton
public boolean isSingleton()
- Specified by:
isSingleton in interface org.springframework.beans.factory.FactoryBean
setBeanClassLoader
public void setBeanClassLoader(java.lang.ClassLoader classLoader)
- Specified by:
setBeanClassLoader in interface org.springframework.beans.factory.BeanClassLoaderAware
setBeanName
public void setBeanName(java.lang.String name)
- Specified by:
setBeanName in interface org.springframework.beans.factory.BeanNameAware
setConfigurationManager
public void setConfigurationManager(flex.messaging.config.ConfigurationManager configurationManager)
setResourceLoader
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
- Specified by:
setResourceLoader in interface org.springframework.context.ResourceLoaderAware
setServicesConfigPath
public void setServicesConfigPath(java.lang.String servicesConfigPath)
setServletContext
public void setServletContext(javax.servlet.ServletContext servletContext)
- Specified by:
setServletContext in interface org.springframework.web.context.ServletContextAware
setConfigProcessors
public void setConfigProcessors(java.util.Set<MessageBrokerConfigProcessor> startupProcessors)
afterPropertiesSet
public void afterPropertiesSet()
throws java.lang.Exception
- Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
- Throws:
java.lang.Exception
destroy
public void destroy()
throws java.lang.Exception
- Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
- Throws:
java.lang.Exception