class MessageBrokerBeanDefinitionParser extends java.lang.Object implements BeanDefinitionParser
BeanDefinitionParser
that provides the configuration for the
<websocket:message-broker/>
XML namespace element.
Registers a Spring MVC SimpleUrlHandlerMapping
with order=1 to map HTTP WebSocket handshake requests from STOMP/WebSocket clients.
Registers the following MessageChannel
s:
Registers one of the following based on the selected message broker options:
SimpleBrokerMessageHandler
if the StompBrokerRelayMessageHandler
if the
Registers a UserDestinationMessageHandler
for handling user destinations.
Modifier and Type | Field and Description |
---|---|
private static int |
DEFAULT_MAPPING_ORDER |
private static boolean |
jackson2Present |
protected static java.lang.String |
SOCKJS_SCHEDULER_BEAN_NAME |
Constructor and Description |
---|
MessageBrokerBeanDefinitionParser() |
Modifier and Type | Method and Description |
---|---|
private RootBeanDefinition |
getDefaultExecutorBeanDefinition(java.lang.String channelName) |
private RuntimeBeanReference |
getMessageChannel(java.lang.String channelName,
org.w3c.dom.Element channelElement,
ParserContext parserCxt,
java.lang.Object source) |
BeanDefinition |
parse(org.w3c.dom.Element element,
ParserContext parserCxt)
Parse the specified
Element and register the resulting
BeanDefinition(s) with the
BeanDefinitionRegistry
embedded in the supplied ParserContext . |
private void |
registerAnnotationMethodMessageHandler(org.w3c.dom.Element messageBrokerElement,
RuntimeBeanReference clientInChannelDef,
RuntimeBeanReference clientOutChannelDef,
RuntimeBeanReference brokerMessageConverterRef,
RuntimeBeanReference brokerMessagingTemplateRef,
ParserContext parserCxt,
java.lang.Object source) |
private static java.lang.String |
registerBeanDef(RootBeanDefinition beanDef,
ParserContext parserCxt,
java.lang.Object source) |
private static void |
registerBeanDefByName(java.lang.String beanName,
RootBeanDefinition beanDef,
ParserContext parserCxt,
java.lang.Object source) |
private RuntimeBeanReference |
registerBrokerMessageConverter(org.w3c.dom.Element element,
ParserContext parserCxt,
java.lang.Object source) |
private RuntimeBeanReference |
registerBrokerMessagingTemplate(org.w3c.dom.Element element,
RuntimeBeanReference brokerChannelDef,
RuntimeBeanReference messageConverterRef,
ParserContext parserCxt,
java.lang.Object source) |
private RuntimeBeanReference |
registerHttpRequestHandler(org.w3c.dom.Element stompEndpointElement,
RuntimeBeanReference subProtocolWebSocketHandler,
ParserContext parserCxt,
java.lang.Object source) |
private void |
registerMessageBroker(org.w3c.dom.Element messageBrokerElement,
RuntimeBeanReference clientInChannelDef,
RuntimeBeanReference clientOutChannelDef,
RuntimeBeanReference brokerChannelDef,
ParserContext parserCxt,
java.lang.Object source) |
private RuntimeBeanReference |
registerSubProtocolWebSocketHandler(org.w3c.dom.Element element,
RuntimeBeanReference clientInChannel,
RuntimeBeanReference clientOutChannel,
RuntimeBeanReference userSessionRegistry,
ParserContext parserCxt,
java.lang.Object source) |
private RuntimeBeanReference |
registerUserDestinationMessageHandler(RuntimeBeanReference clientInChannelDef,
RuntimeBeanReference clientOutChannelDef,
RuntimeBeanReference brokerChannelDef,
RuntimeBeanReference userDestinationResolverRef,
ParserContext parserCxt,
java.lang.Object source) |
private RuntimeBeanReference |
registerUserDestinationResolver(org.w3c.dom.Element messageBrokerElement,
RuntimeBeanReference userSessionRegistry,
ParserContext parserCxt,
java.lang.Object source) |
protected static final java.lang.String SOCKJS_SCHEDULER_BEAN_NAME
private static final int DEFAULT_MAPPING_ORDER
private static final boolean jackson2Present
public BeanDefinition parse(org.w3c.dom.Element element, ParserContext parserCxt)
BeanDefinitionParser
Element
and register the resulting
BeanDefinition(s)
with the
BeanDefinitionRegistry
embedded in the supplied ParserContext
.
Implementations must return the primary BeanDefinition
that results
from the parse if they will ever be used in a nested fashion (for example as
an inner tag in a <property/>
tag). Implementations may return
null
if they will not be used in a nested fashion.
parse
in interface BeanDefinitionParser
element
- the element that is to be parsed into one or more BeanDefinitions
parserCxt
- the object encapsulating the current state of the parsing process;
provides access to a BeanDefinitionRegistry
BeanDefinition
private RuntimeBeanReference getMessageChannel(java.lang.String channelName, org.w3c.dom.Element channelElement, ParserContext parserCxt, java.lang.Object source)
private RootBeanDefinition getDefaultExecutorBeanDefinition(java.lang.String channelName)
private RuntimeBeanReference registerSubProtocolWebSocketHandler(org.w3c.dom.Element element, RuntimeBeanReference clientInChannel, RuntimeBeanReference clientOutChannel, RuntimeBeanReference userSessionRegistry, ParserContext parserCxt, java.lang.Object source)
private RuntimeBeanReference registerHttpRequestHandler(org.w3c.dom.Element stompEndpointElement, RuntimeBeanReference subProtocolWebSocketHandler, ParserContext parserCxt, java.lang.Object source)
private void registerMessageBroker(org.w3c.dom.Element messageBrokerElement, RuntimeBeanReference clientInChannelDef, RuntimeBeanReference clientOutChannelDef, RuntimeBeanReference brokerChannelDef, ParserContext parserCxt, java.lang.Object source)
private RuntimeBeanReference registerBrokerMessageConverter(org.w3c.dom.Element element, ParserContext parserCxt, java.lang.Object source)
private RuntimeBeanReference registerBrokerMessagingTemplate(org.w3c.dom.Element element, RuntimeBeanReference brokerChannelDef, RuntimeBeanReference messageConverterRef, ParserContext parserCxt, java.lang.Object source)
private void registerAnnotationMethodMessageHandler(org.w3c.dom.Element messageBrokerElement, RuntimeBeanReference clientInChannelDef, RuntimeBeanReference clientOutChannelDef, RuntimeBeanReference brokerMessageConverterRef, RuntimeBeanReference brokerMessagingTemplateRef, ParserContext parserCxt, java.lang.Object source)
private RuntimeBeanReference registerUserDestinationResolver(org.w3c.dom.Element messageBrokerElement, RuntimeBeanReference userSessionRegistry, ParserContext parserCxt, java.lang.Object source)
private RuntimeBeanReference registerUserDestinationMessageHandler(RuntimeBeanReference clientInChannelDef, RuntimeBeanReference clientOutChannelDef, RuntimeBeanReference brokerChannelDef, RuntimeBeanReference userDestinationResolverRef, ParserContext parserCxt, java.lang.Object source)
private static java.lang.String registerBeanDef(RootBeanDefinition beanDef, ParserContext parserCxt, java.lang.Object source)
private static void registerBeanDefByName(java.lang.String beanName, RootBeanDefinition beanDef, ParserContext parserCxt, java.lang.Object source)