Class ChannelRegistration
java.lang.Object
org.springframework.messaging.simp.config.ChannelRegistration
A registration class for customizing the configuration for a
MessageChannel.- Since:
- 4.0
- Author:
- Rossen Stoyanchev, Stephane Nicoll
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecutor(org.springframework.core.task.TaskExecutor taskExecutor) Configure the givenTaskExecutorfor this message channel, taking precedence over a task executor registration if any.protected List<ChannelInterceptor>protected org.springframework.core.task.TaskExecutorgetTaskExecutor(Supplier<org.springframework.core.task.TaskExecutor> fallback, Consumer<org.springframework.core.task.TaskExecutor> customizer) Return theTaskExecutorto use.protected booleanprotected booleaninterceptors(ChannelInterceptor... interceptors) Configure the given interceptors for this message channel, adding them to the channel's current list of interceptors.Configure the thread pool backing this message channel.taskExecutor(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor taskExecutor) Configure the thread pool backing this message channel using a custom ThreadPoolTaskExecutor.
-
Constructor Details
-
ChannelRegistration
public ChannelRegistration()
-
-
Method Details
-
taskExecutor
Configure the thread pool backing this message channel. -
taskExecutor
public TaskExecutorRegistration taskExecutor(@Nullable org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor taskExecutor) Configure the thread pool backing this message channel using a custom ThreadPoolTaskExecutor.- Parameters:
taskExecutor- the executor to use (ornullfor a default executor)
-
executor
Configure the givenTaskExecutorfor this message channel, taking precedence over a task executor registration if any.- Parameters:
taskExecutor- the task executor to use- Since:
- 6.1.4
-
interceptors
Configure the given interceptors for this message channel, adding them to the channel's current list of interceptors.- Since:
- 4.3.12
-
hasTaskExecutor
protected boolean hasTaskExecutor() -
hasInterceptors
protected boolean hasInterceptors() -
getTaskExecutor
protected org.springframework.core.task.TaskExecutor getTaskExecutor(Supplier<org.springframework.core.task.TaskExecutor> fallback, Consumer<org.springframework.core.task.TaskExecutor> customizer) Return theTaskExecutorto use. If no task executor has been configured, thefallbacksupplier is used to provide a fallback instance.If the
TaskExecutorto use is suitable for further customizations, thecustomizerconsumer is invoked.- Parameters:
fallback- a supplier of a fallback task executor in case none is configuredcustomizer- further customizations- Returns:
- the task executor to use
- Since:
- 6.1.4
-
getInterceptors
-