Interface SuspendableService

All Superinterfaces:
AutoCloseable, Service
All Known Subinterfaces:
BacklogDebugger, StatefulService
All Known Implementing Classes:
ServiceSupport, Transformer, Validator

public interface SuspendableService extends Service
A Service which is also capable of suspending and resuming.

This is useable for services which needs more fine grained control at runtime supporting suspension. Other services may select to mimic suspending by just stopping the service.

For example this is use by the JmsConsumer which suspends the Spring JMS listener instead of stopping the consumer totally.

Important: The service should also implement the Suspendable marker interface to indicate the service supports suspension using custom code logic.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Tests whether the service is suspended or not.
    void
    Resumes the service.
    void
    Suspends the service.

    Methods inherited from interface org.apache.camel.Service

    build, close, init, start, stop
  • Method Details

    • suspend

      void suspend()
      Suspends the service.
      Throws:
      RuntimeCamelException - is thrown if suspending failed
    • resume

      void resume()
      Resumes the service.
      Throws:
      RuntimeCamelException - is thrown if resuming failed
    • isSuspended

      boolean isSuspended()
      Tests whether the service is suspended or not.
      Returns:
      true if suspended