Class AbstractStandaloneMessageReceiver

All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle
Direct Known Subclasses:
AbstractAsyncStandaloneMessageReceiver, XmppMessageReceiver

public abstract class AbstractStandaloneMessageReceiver extends SimpleWebServiceMessageReceiverObjectSupport implements org.springframework.context.Lifecycle, org.springframework.beans.factory.DisposableBean
Abstract base class for standalone, server-side transport objects. Provides a basic, thread-safe implementation of the Lifecycle interface, and various template methods to be implemented by concrete sub classes.
Since:
1.5.0
Author:
Arjen Poutsma
  • Constructor Details

    • AbstractStandaloneMessageReceiver

      public AbstractStandaloneMessageReceiver()
  • Method Details

    • isActive

      public final boolean isActive()
      Return whether this server is currently active, that is, whether it has been set up but not shut down yet.
    • isRunning

      public final boolean isRunning()
      Return whether this server is currently running, that is, whether it has been started and not stopped yet.
      Specified by:
      isRunning in interface org.springframework.context.Lifecycle
    • setAutoStartup

      public void setAutoStartup(boolean autoStartup)
      Set whether to automatically start the receiver after initialization.

      Default is true; set this to false to allow for manual startup.

    • afterPropertiesSet

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

      public void destroy()
      Calls shutdown() when the BeanFactory destroys the receiver instance.
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean
    • activate

      public final void activate() throws Exception
      Initialize this server. Starts the server if autoStartup hasn't been turned off.
      Throws:
      Exception
    • start

      public final void start()
      Start this server.
      Specified by:
      start in interface org.springframework.context.Lifecycle
    • stop

      public final void stop()
      Stop this server.
      Specified by:
      stop in interface org.springframework.context.Lifecycle
    • shutdown

      public final void shutdown()
      Shut down this server.
    • onActivate

      protected abstract void onActivate() throws Exception
      Template method invoked when activate() is invoked.
      Throws:
      Exception - in case of errors
    • onStart

      protected abstract void onStart()
      Template method invoked when start() is invoked.
    • onStop

      protected abstract void onStop()
      Template method invoked when stop() is invoked.
    • onShutdown

      protected abstract void onShutdown()
      Template method invoked when shutdown() is invoked.