Top Description Inners Fields Constructors Methods
org.springframework.messaging.support

public Class ExecutorSubscribableChannel

extends AbstractSubscribableChannel
Class Inheritance
Imports
java.util.ArrayList, .List, java.util.concurrent.Executor, .RejectedExecutionException, org.springframework.lang.Nullable, org.springframework.messaging.Message, .MessageDeliveryException, .MessageHandler, .MessagingException, .SubscribableChannel

A SubscribableChannel that sends messages to each of its subscribers.
Authors
Phillip Webb, Rossen Stoyanchev
Since
4.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
ExecutorSubscribableChannel.SendTask

Invoke a MessageHandler with ExecutorChannelInterceptors.

Field Summary

Modifier and TypeField and Description
private final Executor
private final List<ExecutorChannelInterceptor>

Constructor Summary

AccessConstructor and Description
public
ExecutorSubscribableChannel()

Create a new ExecutorSubscribableChannel instance where messages will be sent in the callers thread.

public
ExecutorSubscribableChannel(Executor
the executor used to send the message, or null to execute in the callers thread.
executor
)

Create a new ExecutorSubscribableChannel instance where messages will be sent via the specified executor.

Method Summary

Modifier and TypeMethod and Description
public void
public void
public Executor
public boolean
public void
private void
Inherited from org.springframework.messaging.support.AbstractSubscribableChannel:
getSubscribershasSubscriptionsubscribeunsubscribe

Field Detail

executorback to summary
private final Executor executor
Annotations
@Nullable
executorInterceptorsback to summary
private final List<ExecutorChannelInterceptor> executorInterceptors

Constructor Detail

ExecutorSubscribableChannelback to summary
public ExecutorSubscribableChannel()

Create a new ExecutorSubscribableChannel instance where messages will be sent in the callers thread.

ExecutorSubscribableChannelback to summary
public ExecutorSubscribableChannel(Executor executor)

Create a new ExecutorSubscribableChannel instance where messages will be sent via the specified executor.

Parameters
executor:Executor

the executor used to send the message, or null to execute in the callers thread.

Method Detail

addInterceptorback to summary
public void addInterceptor(ChannelInterceptor interceptor)

Overrides org.springframework.messaging.support.AbstractMessageChannel.addInterceptor.

Implements org.springframework.messaging.support.InterceptableChannel.addInterceptor.

Doc from org.springframework.messaging.support.InterceptableChannel.addInterceptor.

Add a channel interceptor to the end of the list.

Annotations
@Override
addInterceptorback to summary
public void addInterceptor(int index, ChannelInterceptor interceptor)

Overrides org.springframework.messaging.support.AbstractMessageChannel.addInterceptor.

Implements org.springframework.messaging.support.InterceptableChannel.addInterceptor.

Doc from org.springframework.messaging.support.InterceptableChannel.addInterceptor.

Add a channel interceptor at the specified index.

Annotations
@Override
getExecutorback to summary
public Executor getExecutor()
Annotations
@Nullable
sendInternalback to summary
public boolean sendInternal(Message<?> message, long timeout)

Implements abstract org.springframework.messaging.support.AbstractMessageChannel.sendInternal.

Annotations
@Override
setInterceptorsback to summary
public void setInterceptors(List<ChannelInterceptor> interceptors)

Overrides org.springframework.messaging.support.AbstractMessageChannel.setInterceptors.

Implements org.springframework.messaging.support.InterceptableChannel.setInterceptors.

Doc from org.springframework.messaging.support.InterceptableChannel.setInterceptors.

Set the list of channel interceptors clearing any existing interceptors.

Annotations
@Override
updateExecutorInterceptorsForback to summary
private void updateExecutorInterceptorsFor(ChannelInterceptor interceptor)
org.springframework.messaging.support back to summary

private Class ExecutorSubscribableChannel.SendTask

extends Object
implements MessageHandlingRunnable
Class Inheritance
  • java.lang.Object
  • org.springframework.messaging.support.ExecutorSubscribableChannel.SendTask
All Implemented Interfaces
org.springframework.messaging.support.MessageHandlingRunnable, java.lang.Runnable

Invoke a MessageHandler with ExecutorChannelInterceptors.

Field Summary

Modifier and TypeField and Description
private final Message<?>
private int
private final MessageHandler

Constructor Summary

AccessConstructor and Description
public
SendTask(Message<?> message, MessageHandler messageHandler)

Method Summary

Modifier and TypeMethod and Description
private Message<?>
public Message<?>
getMessage()

Implements org.springframework.messaging.support.MessageHandlingRunnable.getMessage.

Return the Message that will be handled.

public MessageHandler
getMessageHandler()

Implements org.springframework.messaging.support.MessageHandlingRunnable.getMessageHandler.

Return the MessageHandler that will be used to handle the message.

public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

inputMessageback to summary
private final Message<?> inputMessage
interceptorIndexback to summary
private int interceptorIndex
messageHandlerback to summary
private final MessageHandler messageHandler

Constructor Detail

SendTaskback to summary
public SendTask(Message<?> message, MessageHandler messageHandler)

Method Detail

applyBeforeHandleback to summary
private Message<?> applyBeforeHandle(Message<?> message)
Annotations
@Nullable
getMessageback to summary
public Message<?> getMessage()

Implements org.springframework.messaging.support.MessageHandlingRunnable.getMessage.

Doc from org.springframework.messaging.support.MessageHandlingRunnable.getMessage.

Return the Message that will be handled.

Annotations
@Override
getMessageHandlerback to summary
public MessageHandler getMessageHandler()

Implements org.springframework.messaging.support.MessageHandlingRunnable.getMessageHandler.

Doc from org.springframework.messaging.support.MessageHandlingRunnable.getMessageHandler.

Return the MessageHandler that will be used to handle the message.

Annotations
@Override
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
triggerAfterMessageHandledback to summary
private void triggerAfterMessageHandled(Message<?> message, Exception ex)