Top Description Fields Constructors Methods
org.springframework.messaging.simp.config

public Class ChannelRegistration

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Arrays, .List, java.util.function.Consumer, .Supplier, org.springframework.core.task.TaskExecutor, org.springframework.lang.Nullable, org.springframework.messaging.support.ChannelInterceptor, org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor

A registration class for customizing the configuration for a org.springframework.messaging.MessageChannel.
Authors
Rossen Stoyanchev, Stephane Nicoll
Since
4.0

Field Summary

Modifier and TypeField and Description
private TaskExecutor
private final List<ChannelInterceptor>
private TaskExecutorRegistration

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ChannelRegistration
executor(TaskExecutor
the task executor to use
taskExecutor
)

Configure the given TaskExecutor for this message channel, taking precedence over a task executor registration if any.

protected List<ChannelInterceptor>
protected TaskExecutor

Returns:

the task executor to use
getTaskExecutor
(Supplier<TaskExecutor>
a supplier of a fallback task executor in case none is configured
fallback
,
Consumer<TaskExecutor>
further customizations
customizer
)

Return the TaskExecutor to use.

protected boolean
protected boolean
public ChannelRegistration
interceptors(ChannelInterceptor... interceptors)

Configure the given interceptors for this message channel, adding them to the channel's current list of interceptors.

public TaskExecutorRegistration
taskExecutor()

Configure the thread pool backing this message channel.

public TaskExecutorRegistration
taskExecutor(ThreadPoolTaskExecutor
the executor to use (or null for a default executor)
taskExecutor
)

Deprecated as a consequence of ThreadPoolTaskExecutor being deprecated.
Configure the thread pool backing this message channel using a custom ThreadPoolTaskExecutor.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

executorback to summary
private TaskExecutor executor
Annotations
@Nullable
interceptorsback to summary
private final List<ChannelInterceptor> interceptors
registrationback to summary
private TaskExecutorRegistration registration
Annotations
@Nullable

Constructor Detail

ChannelRegistrationback to summary
public ChannelRegistration()

Method Detail

executorback to summary
public ChannelRegistration executor(TaskExecutor taskExecutor)

Configure the given TaskExecutor for this message channel, taking precedence over a task executor registration if any.

Parameters
taskExecutor:TaskExecutor

the task executor to use

Since
6.1.4
getInterceptorsback to summary
protected List<ChannelInterceptor> getInterceptors()
getTaskExecutorback to summary
protected TaskExecutor getTaskExecutor(Supplier<TaskExecutor> fallback, Consumer<TaskExecutor> customizer)

Return the TaskExecutor to use. If no task executor has been configured, the fallback supplier is used to provide a fallback instance.

If the TaskExecutor to use is suitable for further customizations, the customizer consumer is invoked.

Parameters
fallback:Supplier<TaskExecutor>

a supplier of a fallback task executor in case none is configured

customizer:Consumer<TaskExecutor>

further customizations

Returns:TaskExecutor

the task executor to use

Since
6.1.4
hasInterceptorsback to summary
protected boolean hasInterceptors()
hasTaskExecutorback to summary
protected boolean hasTaskExecutor()
interceptorsback to summary
public ChannelRegistration interceptors(ChannelInterceptor... interceptors)

Configure the given interceptors for this message channel, adding them to the channel's current list of interceptors.

Since
4.3.12
taskExecutorback to summary
public TaskExecutorRegistration taskExecutor()

Configure the thread pool backing this message channel.

taskExecutorback to summary
public TaskExecutorRegistration taskExecutor(ThreadPoolTaskExecutor taskExecutor)

Deprecated

as a consequence of ThreadPoolTaskExecutor being deprecated. See corresponding docs for further information.

Configure the thread pool backing this message channel using a custom ThreadPoolTaskExecutor.

Parameters
taskExecutor:ThreadPoolTaskExecutor

the executor to use (or null for a default executor)