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 HandlerMapping
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 | Class and Description |
---|---|
private static class |
MessageBrokerBeanDefinitionParser.DecoratingFactoryBean |
Modifier and Type | Field and Description |
---|---|
private static int |
DEFAULT_MAPPING_ORDER |
private static boolean |
jackson2Present |
static java.lang.String |
SCHEDULER_BEAN_NAME |
static java.lang.String |
SOCKJS_SCHEDULER_BEAN_NAME |
static java.lang.String |
WEB_SOCKET_HANDLER_BEAN_NAME |
Constructor and Description |
---|
MessageBrokerBeanDefinitionParser() |
Modifier and Type | Method and Description |
---|---|
private ManagedList<java.lang.Object> |
extractBeanSubElements(org.w3c.dom.Element parentElement,
ParserContext parserContext) |
private RootBeanDefinition |
getDefaultExecutorBeanDefinition(java.lang.String channelName) |
private RuntimeBeanReference |
getMessageChannel(java.lang.String name,
org.w3c.dom.Element element,
ParserContext context,
java.lang.Object source) |
BeanDefinition |
parse(org.w3c.dom.Element element,
ParserContext context)
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 inChannel,
RuntimeBeanReference outChannel,
RuntimeBeanReference converter,
RuntimeBeanReference messagingTemplate,
ParserContext context,
java.lang.Object source) |
private static java.lang.String |
registerBeanDef(RootBeanDefinition beanDef,
ParserContext context,
java.lang.Object source) |
private static void |
registerBeanDefByName(java.lang.String name,
RootBeanDefinition beanDef,
ParserContext context,
java.lang.Object source) |
private ManagedMap<java.lang.String,java.lang.Object> |
registerHandlerMapping(org.w3c.dom.Element element,
ParserContext context,
java.lang.Object source) |
private RootBeanDefinition |
registerMessageBroker(org.w3c.dom.Element brokerElement,
RuntimeBeanReference inChannel,
RuntimeBeanReference outChannel,
RuntimeBeanReference brokerChannel,
java.lang.Object userDestHandler,
RuntimeBeanReference brokerTemplate,
RuntimeBeanReference userRegistry,
ParserContext context,
java.lang.Object source) |
private RuntimeBeanReference |
registerMessageConverter(org.w3c.dom.Element element,
ParserContext context,
java.lang.Object source) |
private RuntimeBeanReference |
registerMessagingTemplate(org.w3c.dom.Element element,
RuntimeBeanReference brokerChannel,
RuntimeBeanReference messageConverter,
ParserContext context,
java.lang.Object source) |
private RuntimeBeanReference |
registerRequestHandler(org.w3c.dom.Element element,
RuntimeBeanReference subProtoHandler,
ParserContext context,
java.lang.Object source) |
private RuntimeBeanReference |
registerStompHandler(org.w3c.dom.Element element,
RuntimeBeanReference inChannel,
RuntimeBeanReference outChannel,
ParserContext context,
java.lang.Object source) |
private RuntimeBeanReference |
registerUserDestHandler(org.w3c.dom.Element brokerElem,
RuntimeBeanReference userRegistry,
RuntimeBeanReference inChannel,
RuntimeBeanReference brokerChannel,
ParserContext context,
java.lang.Object source) |
private RuntimeBeanReference |
registerUserDestResolver(org.w3c.dom.Element brokerElem,
RuntimeBeanReference userRegistry,
ParserContext context,
java.lang.Object source) |
private RuntimeBeanReference |
registerUserRegistry(org.w3c.dom.Element element,
ParserContext context,
java.lang.Object source) |
private RuntimeBeanReference |
registerUserRegistryMessageHandler(RuntimeBeanReference userRegistry,
RuntimeBeanReference brokerTemplate,
java.lang.String destination,
ParserContext context,
java.lang.Object source) |
private void |
registerWebSocketMessageBrokerStats(RootBeanDefinition broker,
RuntimeBeanReference inChannel,
RuntimeBeanReference outChannel,
ParserContext context,
java.lang.Object source) |
public static final java.lang.String WEB_SOCKET_HANDLER_BEAN_NAME
public static final java.lang.String SCHEDULER_BEAN_NAME
public 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 context)
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
context
- the object encapsulating the current state of the parsing process;
provides access to a BeanDefinitionRegistry
BeanDefinition
private RuntimeBeanReference registerUserRegistry(org.w3c.dom.Element element, ParserContext context, java.lang.Object source)
private ManagedMap<java.lang.String,java.lang.Object> registerHandlerMapping(org.w3c.dom.Element element, ParserContext context, java.lang.Object source)
private RuntimeBeanReference getMessageChannel(java.lang.String name, org.w3c.dom.Element element, ParserContext context, java.lang.Object source)
private RootBeanDefinition getDefaultExecutorBeanDefinition(java.lang.String channelName)
private RuntimeBeanReference registerStompHandler(org.w3c.dom.Element element, RuntimeBeanReference inChannel, RuntimeBeanReference outChannel, ParserContext context, java.lang.Object source)
private RuntimeBeanReference registerRequestHandler(org.w3c.dom.Element element, RuntimeBeanReference subProtoHandler, ParserContext context, java.lang.Object source)
private RootBeanDefinition registerMessageBroker(org.w3c.dom.Element brokerElement, RuntimeBeanReference inChannel, RuntimeBeanReference outChannel, RuntimeBeanReference brokerChannel, java.lang.Object userDestHandler, RuntimeBeanReference brokerTemplate, RuntimeBeanReference userRegistry, ParserContext context, java.lang.Object source)
private RuntimeBeanReference registerUserRegistryMessageHandler(RuntimeBeanReference userRegistry, RuntimeBeanReference brokerTemplate, java.lang.String destination, ParserContext context, java.lang.Object source)
private RuntimeBeanReference registerMessageConverter(org.w3c.dom.Element element, ParserContext context, java.lang.Object source)
private RuntimeBeanReference registerMessagingTemplate(org.w3c.dom.Element element, RuntimeBeanReference brokerChannel, RuntimeBeanReference messageConverter, ParserContext context, java.lang.Object source)
private void registerAnnotationMethodMessageHandler(org.w3c.dom.Element messageBrokerElement, RuntimeBeanReference inChannel, RuntimeBeanReference outChannel, RuntimeBeanReference converter, RuntimeBeanReference messagingTemplate, ParserContext context, java.lang.Object source)
private ManagedList<java.lang.Object> extractBeanSubElements(org.w3c.dom.Element parentElement, ParserContext parserContext)
private RuntimeBeanReference registerUserDestResolver(org.w3c.dom.Element brokerElem, RuntimeBeanReference userRegistry, ParserContext context, java.lang.Object source)
private RuntimeBeanReference registerUserDestHandler(org.w3c.dom.Element brokerElem, RuntimeBeanReference userRegistry, RuntimeBeanReference inChannel, RuntimeBeanReference brokerChannel, ParserContext context, java.lang.Object source)
private void registerWebSocketMessageBrokerStats(RootBeanDefinition broker, RuntimeBeanReference inChannel, RuntimeBeanReference outChannel, ParserContext context, java.lang.Object source)
private static java.lang.String registerBeanDef(RootBeanDefinition beanDef, ParserContext context, java.lang.Object source)
private static void registerBeanDefByName(java.lang.String name, RootBeanDefinition beanDef, ParserContext context, java.lang.Object source)