Class MethodInvokingMessageSource

All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, MessageSource<Object>, IntegrationPattern, NamedComponent, IntegrationInboundManagement, IntegrationManagement, ManageableLifecycle

public class MethodInvokingMessageSource extends AbstractMessageSource<Object> implements ManageableLifecycle
A MessageSource implementation that invokes a no-argument method so that its return value may be sent to a channel.
  • Constructor Details

    • MethodInvokingMessageSource

      public MethodInvokingMessageSource()
  • Method Details

    • setObject

      public void setObject(Object object)
    • setMethod

      public void setMethod(Method method)
    • setMethodName

      public void setMethodName(String methodName)
    • getComponentType

      public String getComponentType()
      Specified by:
      getComponentType in interface NamedComponent
    • onInit

      protected void onInit()
      Overrides:
      onInit in class AbstractExpressionEvaluator
    • start

      public void start()
      Specified by:
      start in interface org.springframework.context.Lifecycle
      Specified by:
      start in interface ManageableLifecycle
    • stop

      public void stop()
      Specified by:
      stop in interface org.springframework.context.Lifecycle
      Specified by:
      stop in interface ManageableLifecycle
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface org.springframework.context.Lifecycle
      Specified by:
      isRunning in interface ManageableLifecycle
    • doReceive

      protected Object doReceive()
      Description copied from class: AbstractMessageSource
      Subclasses must implement this method. Typically the returned value will be the payload of type T, but the returned value may also be a Message instance whose payload is of type T; also can be AbstractIntegrationMessageBuilder which is used for additional headers population.
      Specified by:
      doReceive in class AbstractMessageSource<Object>
      Returns:
      The value returned.