@MessageMapping
and @SubscribeMapping annotated methods.
Supports Ant-style path patterns with template variables.
| Modifier and Type | Field and Description |
|---|---|
| private final SimpMessageSendingOperations | |
| private final SubscribableChannel | |
| private final SimpMessageSendingOperations | |
| private ConversionService | |
| private MessageHeaderInitializer | |
| private final Object | |
| private MessageConverter | |
| private PathMatcher | |
| private Integer | |
| private static final boolean | |
| private volatile boolean | |
| private boolean | |
| private Validator | |
| private StringValueResolver |
| Access | Constructor and Description |
|---|---|
| public | SimpAnnotationMethodMessageHandler(SubscribableChannel
the channel for receiving messages from clients (e.g. WebSocket clients) clientInboundChannel, MessageChannel the channel for messages to clients (e.g. WebSocket clients) clientOutboundChannel, SimpMessageSendingOperations a messaging template to send application messages to the broker brokerTemplate)Create an instance of SimpAnnotationMethodMessageHandler with the given message channels and broker messaging template. |
| Modifier and Type | Method and Description |
|---|---|
| private static Collection | |
| protected AbstractExceptionHandlerMethodResolver | |
| private SimpMessageMappingInfo | |
| private SimpMessageMappingInfo | |
| public ConversionService | |
| protected String | getDestination(Message<?> message)
Implements abstract org. |
| protected Set | getDirectLookupDestinations(SimpMessageMappingInfo mapping)
Implements abstract org. |
| protected Log | getHandlerMethodLogger()
Overrides org. InvocableHandlerMethod.
|
| public MessageHeaderInitializer | |
| protected String | getLookupDestination(String destination)
Overrides org. |
| protected Comparator | getMappingComparator(final Message<?>
the current Message message)Implements abstract org. |
| protected SimpMessageMappingInfo | getMappingForMethod(Method
the method to provide a mapping for method, Class<?> the handler type, possibly a subtype of the method's declaring class handlerType)Implements abstract org. |
| protected SimpMessageMappingInfo | getMatchingMapping(SimpMessageMappingInfo
the mapping to get a match for mapping, Message<?> the message being handled message)Implements abstract org. |
| public MessageConverter | |
| public PathMatcher | |
| public int | getPhase()
Overrides default org. The default implementation returns |
| protected Log | |
| public Validator | |
| protected void | handleMatch(SimpMessageMappingInfo mapping, HandlerMethod handlerMethod, String lookupDestination, Message<?> message)
Overrides org. |
| protected List | initArgumentResolvers()
Implements abstract org. |
| protected List | initReturnValueHandlers()
Implements abstract org. |
| protected boolean | isHandler(Class<?> beanType)
Implements abstract org. |
| public final boolean | isRunning()
Implements org. |
| protected String[] | Returns: a new array with updated destinationsResolve placeholder values in the given array of destinations. |
| public void | setConversionService(ConversionService conversionService)
Configure a |
| public void | setDestinationPrefixes(Collection<String> prefixes)
Overrides org. |
| public void | setEmbeddedValueResolver(StringValueResolver resolver)
Implements org. |
| public void | setHeaderInitializer(MessageHeaderInitializer headerInitializer)
Configure a |
| public void | setMessageConverter(MessageConverter converter)
Configure a |
| public void | setPathMatcher(PathMatcher pathMatcher)
Set the PathMatcher implementation to use for matching destinations against configured destination patterns. |
| public void | setPhase(int phase)
Set the phase that this handler should run in. By default, this is |
| public void | |
| public final void | |
| public final void | stop()
Implements org. |
| public final void | stop(Runnable callback)
Overrides default org. |
| brokerTemplate | back to summary |
|---|---|
| private final SimpMessageSendingOperations brokerTemplate | |
| clientInboundChannel | back to summary |
|---|---|
| private final SubscribableChannel clientInboundChannel | |
| clientMessagingTemplate | back to summary |
|---|---|
| private final SimpMessageSendingOperations clientMessagingTemplate | |
| conversionService | back to summary |
|---|---|
| private ConversionService conversionService | |
| headerInitializer | back to summary |
|---|---|
| private MessageHeaderInitializer headerInitializer
| |
| lifecycleMonitor | back to summary |
|---|---|
| private final Object lifecycleMonitor | |
| messageConverter | back to summary |
|---|---|
| private MessageConverter messageConverter | |
| pathMatcher | back to summary |
|---|---|
| private PathMatcher pathMatcher | |
| phase | back to summary |
|---|---|
| private Integer phase
| |
| reactorPresent | back to summary |
|---|---|
| private static final boolean reactorPresent | |
| running | back to summary |
|---|---|
| private volatile boolean running | |
| slashPathSeparator | back to summary |
|---|---|
| private boolean slashPathSeparator | |
| validator | back to summary |
|---|---|
| private Validator validator
| |
| valueResolver | back to summary |
|---|---|
| private StringValueResolver valueResolver
| |
| SimpAnnotationMethodMessageHandler | back to summary |
|---|---|
| public SimpAnnotationMethodMessageHandler(SubscribableChannel clientInboundChannel, MessageChannel clientOutboundChannel, SimpMessageSendingOperations brokerTemplate) Create an instance of SimpAnnotationMethodMessageHandler with the given message channels and broker messaging template.
| |
| appendSlashes | back to summary |
|---|---|
private static Collection
| |
| createExceptionHandlerMethodResolverFor | back to summary |
|---|---|
| protected AbstractExceptionHandlerMethodResolver createExceptionHandlerMethodResolverFor(Class<?> beanType) Implements abstract org.
| |
| createMessageMappingCondition | back to summary |
|---|---|
| private SimpMessageMappingInfo createMessageMappingCondition(String[] destinations) | |
| createSubscribeMappingCondition | back to summary |
|---|---|
| private SimpMessageMappingInfo createSubscribeMappingCondition(String[] destinations) | |
| getConversionService | back to summary |
|---|---|
| public ConversionService getConversionService() Return the configured | |
| getDestination | back to summary |
|---|---|
| protected String getDestination(Message<?> message) Implements abstract org. | |
| getDirectLookupDestinations | back to summary |
|---|---|
| protected Set Implements abstract org. Return destinations contained in the mapping that are not patterns and are therefore suitable for direct lookups.
| |
| getHandlerMethodLogger | back to summary |
|---|---|
| protected Log getHandlerMethodLogger() Overrides org. Doc from org. Return a logger to set on
| |
| getHeaderInitializer | back to summary |
|---|---|
| public MessageHeaderInitializer getHeaderInitializer() Return the configured header initializer.
| |
| getLookupDestination | back to summary |
|---|---|
| protected String getLookupDestination(String destination) Overrides org. Doc from org. Check whether the given destination (of an incoming message) matches to one of the configured destination prefixes and if so return the remaining portion of the destination after the matched prefix. If there are no matching prefixes, return If there are no destination prefixes, return the destination as is.
| |
| getMappingComparator | back to summary |
|---|---|
| protected Comparator Implements abstract org. Doc from org. Return a comparator for sorting matching mappings. The returned comparator should sort 'better' matches higher.
| |
| getMappingForMethod | back to summary |
|---|---|
| protected SimpMessageMappingInfo getMappingForMethod(Method method, Class<?> handlerType) Implements abstract org. Doc from org. Provide the mapping for a handler method.
| |
| getMatchingMapping | back to summary |
|---|---|
| protected SimpMessageMappingInfo getMatchingMapping(SimpMessageMappingInfo mapping, Message<?> message) Implements abstract org. Doc from org. Check if a mapping matches the current message and return a possibly new mapping with conditions relevant to the current request.
| |
| getMessageConverter | back to summary |
|---|---|
| public MessageConverter getMessageConverter() Return the configured | |
| getPathMatcher | back to summary |
|---|---|
| public PathMatcher getPathMatcher() Return the PathMatcher implementation to use for matching destinations. | |
| getPhase | back to summary |
|---|---|
| public int getPhase() Overrides default org. Doc from org. Return the phase that this lifecycle object is supposed to run in. The default implementation returns
| |
| getReturnValueHandlerLogger | back to summary |
|---|---|
| protected Log getReturnValueHandlerLogger() Return a logger to set on
| |
| getValidator | back to summary |
|---|---|
| public Validator getValidator() Return the configured Validator instance.
| |
| handleMatch | back to summary |
|---|---|
| protected void handleMatch(SimpMessageMappingInfo mapping, HandlerMethod handlerMethod, String lookupDestination, Message<?> message) Overrides org.
| |
| initArgumentResolvers | back to summary |
|---|---|
| protected List Implements abstract org. Doc from org. Return the list of argument resolvers to use. Invoked only if the resolvers
have not already been set via Subclasses should also take into account custom argument types configured via
| |
| initReturnValueHandlers | back to summary |
|---|---|
| protected List Implements abstract org. Return the list of return value handlers to use. Invoked only if the return
value handlers have not already been set via Subclasses should also take into account custom return value types configured
via
| |
| isHandler | back to summary |
|---|---|
| protected boolean isHandler(Class<?> beanType) Implements abstract org. Doc from org. Whether the given bean type should be introspected for messaging handling methods.
| |
| isRunning | back to summary |
|---|---|
| public final boolean isRunning() Implements org. Doc from org. Check whether this component is currently running. In the case of a container, this will return
| |
| resolveEmbeddedValuesInDestinations | back to summary |
|---|---|
| protected String[] resolveEmbeddedValuesInDestinations(String[] destinations) Resolve placeholder values in the given array of destinations.
| |
| setConversionService | back to summary |
|---|---|
| public void setConversionService(ConversionService conversionService) Configure a By default, | |
| setDestinationPrefixes | back to summary |
|---|---|
| public void setDestinationPrefixes(Collection<String> prefixes) Overrides org. Doc from org. When this property is configured only messages to destinations matching one of the configured prefixes are eligible for handling. When there is a match the prefix is removed and only the remaining part of the destination is used for method-mapping purposes. By default, no prefixes are configured in which case all messages are eligible for handling. Destination prefixes are expected to be slash-separated Strings and therefore a slash is automatically appended where missing to ensure a proper prefix-based match (i.e. matching complete segments). Note however that the remaining portion of a destination after the
prefix may use a different separator (e.g. commonly "." in messaging)
depending on the configured
| |
| setEmbeddedValueResolver | back to summary |
|---|---|
| public void setEmbeddedValueResolver(StringValueResolver resolver) Implements org. Doc from org. Set the StringValueResolver to use for resolving embedded definition values.
| |
| setHeaderInitializer | back to summary |
|---|---|
| public void setHeaderInitializer(MessageHeaderInitializer headerInitializer) Configure a By default, this property is not set. | |
| setMessageConverter | back to summary |
|---|---|
| public void setMessageConverter(MessageConverter converter) Configure a
| |
| setPathMatcher | back to summary |
|---|---|
| public void setPathMatcher(PathMatcher pathMatcher) Set the PathMatcher implementation to use for matching destinations against configured destination patterns. By default, | |
| setPhase | back to summary |
|---|---|
| public void setPhase(int phase) Set the phase that this handler should run in. By default, this is
| |
| setValidator | back to summary |
|---|---|
| public void setValidator(Validator validator) Set the Validator instance used for validating | |
| start | back to summary |
|---|---|
| public final void start() Implements org. Doc from org. Start this component. Should not throw an exception if the component is already running. In the case of a container, this will propagate the start signal to all components that apply.
| |
| stop | back to summary |
|---|---|
| public final void stop() Implements org. Doc from org. Stop this component, typically in a synchronous fashion, such that the component is
fully stopped upon return of this method. Consider implementing Note that this stop notification is not guaranteed to come before destruction:
On regular shutdown, Should not throw an exception if the component is not running (not started yet). In the case of a container, this will propagate the stop signal to all components that apply.
| |
| stop | back to summary |
|---|---|
| public final void stop(Runnable callback) Overrides default org. Doc from org. Indicates that a Lifecycle component must stop if it is currently running. The provided callback is used by the The The default implementation delegates to
| |