接口的使用
org.springframework.messaging.MessageChannel
使用MessageChannel的程序包 程序包 说明 org.springframework.messaging Support for working with messaging APIs and protocols.org.springframework.messaging.core Defines interfaces and implementation classes for messaging templates.org.springframework.messaging.simp Generic support for Simple Messaging Protocols including protocols such as STOMP.org.springframework.messaging.simp.annotation.support Support classes for handling messages from simple messaging protocols (like STOMP).org.springframework.messaging.simp.broker Provides a "simple" message broker implementation along with an abstract base class and other supporting types such as a registry for subscriptions.org.springframework.messaging.simp.config Configuration support for WebSocket messaging using higher level messaging protocols.org.springframework.messaging.simp.stomp Generic support for simple messaging protocols (like STOMP).org.springframework.messaging.support Provides implementations ofMessagealong with a MessageBuilder and MessageHeaderAccessor for building and working with messages and message headers, as well as variousMessageChannelimplementations and channel interceptor support.org.springframework.web.socket.messaging WebSocket integration for Spring's messaging module.org.springframework.messaging中MessageChannel的使用
org.springframework.messaging中MessageChannel的子接口 修饰符和类型 接口 说明 interfacePollableChannelAMessageChannelfrom which messages may be actively received through polling.interfaceSubscribableChannelAMessageChannelthat maintains a registry of subscribers and invokes them to handle messages sent through this channel.org.springframework.messaging.core中MessageChannel的使用
返回MessageChannel的org.springframework.messaging.core中的方法 修饰符和类型 方法 说明 MessageChannelBeanFactoryMessageChannelDestinationResolver. resolveDestination(String name)参数类型为MessageChannel的org.springframework.messaging.core中的方法 修饰符和类型 方法 说明 protected Message<?>GenericMessagingTemplate. doReceive(MessageChannel channel)protected Message<?>GenericMessagingTemplate. doReceive(MessageChannel channel, long timeout)protected voidGenericMessagingTemplate. doSend(MessageChannel channel, Message<?> message)protected voidGenericMessagingTemplate. doSend(MessageChannel channel, Message<?> message, long timeout)protected Message<?>GenericMessagingTemplate. doSendAndReceive(MessageChannel channel, Message<?> requestMessage)org.springframework.messaging.simp中MessageChannel的使用
返回MessageChannel的org.springframework.messaging.simp中的方法 修饰符和类型 方法 说明 MessageChannelSimpMessagingTemplate. getMessageChannel()Return the configured message channel.参数类型为MessageChannel的org.springframework.messaging.simp中的构造器 构造器 说明 SimpMessagingTemplate(MessageChannel messageChannel)Create a newSimpMessagingTemplateinstance.org.springframework.messaging.simp.annotation.support中MessageChannel的使用
参数类型为MessageChannel的org.springframework.messaging.simp.annotation.support中的构造器 构造器 说明 SimpAnnotationMethodMessageHandler(SubscribableChannel clientInboundChannel, MessageChannel clientOutboundChannel, SimpMessageSendingOperations brokerTemplate)Create an instance of SimpAnnotationMethodMessageHandler with the given message channels and broker messaging template.org.springframework.messaging.simp.broker中MessageChannel的使用
返回MessageChannel的org.springframework.messaging.simp.broker中的方法 修饰符和类型 方法 说明 MessageChannelAbstractBrokerMessageHandler. getClientOutboundChannel()protected MessageChannelAbstractBrokerMessageHandler. getClientOutboundChannelForSession(String sessionId)Get the MessageChannel to use for sending messages to clients, possibly a per-session wrapper whenpreservePublishOrder=true.参数类型为MessageChannel的org.springframework.messaging.simp.broker中的构造器 构造器 说明 AbstractBrokerMessageHandler(SubscribableChannel inboundChannel, MessageChannel outboundChannel, SubscribableChannel brokerChannel)Constructor with no destination prefixes (matches all destinations).AbstractBrokerMessageHandler(SubscribableChannel inboundChannel, MessageChannel outboundChannel, SubscribableChannel brokerChannel, Collection<String> destinationPrefixes)Constructor with destination prefixes to match to destinations of messages.SimpleBrokerMessageHandler(SubscribableChannel clientInboundChannel, MessageChannel clientOutboundChannel, SubscribableChannel brokerChannel, Collection<String> destinationPrefixes)Create a SimpleBrokerMessageHandler instance with the given message channels and destination prefixes.org.springframework.messaging.simp.config中MessageChannel的使用
返回MessageChannel的org.springframework.messaging.simp.config中的方法 修饰符和类型 方法 说明 protected MessageChannelAbstractBrokerRegistration. getClientOutboundChannel()参数类型为MessageChannel的org.springframework.messaging.simp.config中的构造器 构造器 说明 AbstractBrokerRegistration(SubscribableChannel clientInboundChannel, MessageChannel clientOutboundChannel, String[] destinationPrefixes)MessageBrokerRegistry(SubscribableChannel clientInboundChannel, MessageChannel clientOutboundChannel)SimpleBrokerRegistration(SubscribableChannel inChannel, MessageChannel outChannel, String[] prefixes)StompBrokerRelayRegistration(SubscribableChannel clientInboundChannel, MessageChannel clientOutboundChannel, String[] destinationPrefixes)org.springframework.messaging.simp.stomp中MessageChannel的使用
参数类型为MessageChannel的org.springframework.messaging.simp.stomp中的构造器 构造器 说明 StompBrokerRelayMessageHandler(SubscribableChannel inboundChannel, MessageChannel outboundChannel, SubscribableChannel brokerChannel, Collection<String> destinationPrefixes)Create a StompBrokerRelayMessageHandler instance with the given message channels and destination prefixes.org.springframework.messaging.support中MessageChannel的使用
实现MessageChannel的org.springframework.messaging.support中的类 修饰符和类型 类 说明 classAbstractMessageChannelAbstract base class forMessageChannelimplementations.classAbstractSubscribableChannelAbstract base class forSubscribableChannelimplementations.classExecutorSubscribableChannelASubscribableChannelthat sends messages to each of its subscribers.参数类型为MessageChannel的org.springframework.messaging.support中的方法 修饰符和类型 方法 说明 default voidExecutorChannelInterceptor. afterMessageHandled(Message<?> message, MessageChannel channel, MessageHandler handler, Exception ex)Invoked inside theRunnablesubmitted to the Executor after calling the target MessageHandler regardless of the outcome (i.e.default voidChannelInterceptor. afterReceiveCompletion(Message<?> message, MessageChannel channel, Exception ex)Invoked after the completion of a receive regardless of any exception that have been raised thus allowing for proper resource cleanup.voidChannelInterceptorAdapter. afterReceiveCompletion(Message<?> message, MessageChannel channel, Exception ex)已过时。default voidChannelInterceptor. afterSendCompletion(Message<?> message, MessageChannel channel, boolean sent, Exception ex)Invoked after the completion of a send regardless of any exception that have been raised thus allowing for proper resource cleanup.voidChannelInterceptorAdapter. afterSendCompletion(Message<?> message, MessageChannel channel, boolean sent, Exception ex)已过时。Message<?>AbstractMessageChannel.ChannelInterceptorChain. applyPostReceive(Message<?> message, MessageChannel channel)voidAbstractMessageChannel.ChannelInterceptorChain. applyPostSend(Message<?> message, MessageChannel channel, boolean sent)booleanAbstractMessageChannel.ChannelInterceptorChain. applyPreReceive(MessageChannel channel)Message<?>AbstractMessageChannel.ChannelInterceptorChain. applyPreSend(Message<?> message, MessageChannel channel)default Message<?>ExecutorChannelInterceptor. beforeHandle(Message<?> message, MessageChannel channel, MessageHandler handler)Invoked inside theRunnablesubmitted to the Executor just before calling the target MessageHandler to handle the message.default Message<?>ChannelInterceptor. postReceive(Message<?> message, MessageChannel channel)Invoked immediately after a Message has been retrieved but before it is returned to the caller.Message<?>ChannelInterceptorAdapter. postReceive(Message<?> message, MessageChannel channel)已过时。default voidChannelInterceptor. postSend(Message<?> message, MessageChannel channel, boolean sent)Invoked immediately after the send invocation.voidChannelInterceptorAdapter. postSend(Message<?> message, MessageChannel channel, boolean sent)已过时。default booleanChannelInterceptor. preReceive(MessageChannel channel)Invoked as soon as receive is called and before a Message is actually retrieved.booleanChannelInterceptorAdapter. preReceive(MessageChannel channel)已过时。default Message<?>ChannelInterceptor. preSend(Message<?> message, MessageChannel channel)Invoked before the Message is actually sent to the channel.Message<?>ChannelInterceptorAdapter. preSend(Message<?> message, MessageChannel channel)已过时。Message<?>ImmutableMessageChannelInterceptor. preSend(Message<?> message, MessageChannel channel)MessageBuilder<T>MessageBuilder. setErrorChannel(MessageChannel errorChannel)voidMessageHeaderAccessor. setErrorChannel(MessageChannel errorChannel)MessageBuilder<T>MessageBuilder. setReplyChannel(MessageChannel replyChannel)voidMessageHeaderAccessor. setReplyChannel(MessageChannel replyChannel)voidAbstractMessageChannel.ChannelInterceptorChain. triggerAfterReceiveCompletion(Message<?> message, MessageChannel channel, Exception ex)voidAbstractMessageChannel.ChannelInterceptorChain. triggerAfterSendCompletion(Message<?> message, MessageChannel channel, boolean sent, Exception ex)org.springframework.web.socket.messaging中MessageChannel的使用
参数类型为MessageChannel的org.springframework.web.socket.messaging中的方法 修饰符和类型 方法 说明 voidStompSubProtocolHandler. afterSessionEnded(WebSocketSession session, CloseStatus closeStatus, MessageChannel outputChannel)voidSubProtocolHandler. afterSessionEnded(WebSocketSession session, CloseStatus closeStatus, MessageChannel outputChannel)Invoked after aWebSocketSessionhas ended.voidStompSubProtocolHandler. afterSessionStarted(WebSocketSession session, MessageChannel outputChannel)voidSubProtocolHandler. afterSessionStarted(WebSocketSession session, MessageChannel outputChannel)Invoked after aWebSocketSessionhas started.voidStompSubProtocolHandler. handleMessageFromClient(WebSocketSession session, WebSocketMessage<?> webSocketMessage, MessageChannel outputChannel)Handle incoming WebSocket messages from clients.voidSubProtocolHandler. handleMessageFromClient(WebSocketSession session, WebSocketMessage<?> message, MessageChannel outputChannel)Handle the givenWebSocketMessagereceived from a client.参数类型为MessageChannel的org.springframework.web.socket.messaging中的构造器 构造器 说明 SubProtocolWebSocketHandler(MessageChannel clientInboundChannel, SubscribableChannel clientOutboundChannel)Create a newSubProtocolWebSocketHandlerfor the given inbound and outbound channels.WebSocketAnnotationMethodMessageHandler(SubscribableChannel clientInChannel, MessageChannel clientOutChannel, SimpMessageSendingOperations brokerTemplate)