Class AbstractAsyncStandaloneMessageReceiver

All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle
Direct Known Subclasses:
MailMessageReceiver

public abstract class AbstractAsyncStandaloneMessageReceiver extends AbstractStandaloneMessageReceiver implements org.springframework.beans.factory.BeanNameAware
Abstract base class for asynchronous standalone, server-side transport objects. Contains a Spring TaskExecutor, and various lifecycle callbacks.
Author:
Arjen Poutsma
  • Field Details

    • DEFAULT_THREAD_NAME_PREFIX

      public final String DEFAULT_THREAD_NAME_PREFIX
      Default thread name prefix.
  • Constructor Details

    • AbstractAsyncStandaloneMessageReceiver

      public AbstractAsyncStandaloneMessageReceiver()
  • Method Details

    • setTaskExecutor

      public void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
      Set the Spring TaskExecutor to use for running the listener threads. Default is SimpleAsyncTaskExecutor, starting up a number of new threads.

      Specify an alternative task executor for integration with an existing thread pool, such as the org.springframework.scheduling.commonj.WorkManagerTaskExecutor to integrate with WebSphere or WebLogic.

    • setBeanName

      public void setBeanName(String beanName)
      Specified by:
      setBeanName in interface org.springframework.beans.factory.BeanNameAware
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Description copied from class: AbstractStandaloneMessageReceiver
      Calls AbstractStandaloneMessageReceiver.activate() when the BeanFactory initializes the receiver instance.
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Overrides:
      afterPropertiesSet in class AbstractStandaloneMessageReceiver
      Throws:
      Exception
    • createDefaultTaskExecutor

      protected org.springframework.core.task.TaskExecutor createDefaultTaskExecutor()
      Create a default TaskExecutor. Called if no explicit TaskExecutor has been specified.

      The default implementation builds a SimpleAsyncTaskExecutor with the specified bean name (or the class name, if no bean name specified) as thread name prefix.

      See Also:
      • SimpleAsyncTaskExecutor(String)
    • execute

      protected void execute(Runnable runnable)
      Executes the given Runnable via this receiver's TaskExecutor.
      See Also: