Class AbstractServer

java.lang.Object
org.citrusframework.endpoint.AbstractEndpoint
org.citrusframework.server.AbstractServer
All Implemented Interfaces:
Runnable, InitializingPhase, Named, ShutdownPhase, Endpoint, Server, ReferenceResolverAware

public abstract class AbstractServer extends AbstractEndpoint implements Server, InitializingPhase, ShutdownPhase, ReferenceResolverAware
Abstract base class for Server implementations.
  • Field Details

    • DEFAULT_CHANNEL_ID_SUFFIX

      public static final String DEFAULT_CHANNEL_ID_SUFFIX
      Default in memory queue suffix
      See Also:
  • Constructor Details

    • AbstractServer

      public AbstractServer()
      Default constructor using endpoint configuration.
  • Method Details

    • start

      public void start()
      Specified by:
      start in interface Server
    • stop

      public void stop()
      Specified by:
      stop in interface Server
    • run

      public void run()
      Subclasses may overwrite this method in order to add special execution logic.
      Specified by:
      run in interface Runnable
    • startup

      protected abstract void startup()
      Subclasses must implement this method called on server startup.
    • shutdown

      protected abstract void shutdown()
      Subclasses must implement this method called on server shutdown.
    • initialize

      public void initialize()
      Specified by:
      initialize in interface InitializingPhase
    • destroy

      public void destroy()
      Specified by:
      destroy in interface ShutdownPhase
    • join

      public void join()
      Join server thread.
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface Server
    • getEndpointConfiguration

      public EndpointConfiguration getEndpointConfiguration()
      Specified by:
      getEndpointConfiguration in interface Endpoint
      Overrides:
      getEndpointConfiguration in class AbstractEndpoint
    • createConsumer

      public Consumer createConsumer()
      Specified by:
      createConsumer in interface Endpoint
    • createProducer

      public Producer createProducer()
      Specified by:
      createProducer in interface Endpoint
    • setAutoStart

      public void setAutoStart(boolean autoStart)
      Enable/disable server auto start
      Parameters:
      autoStart - the autoStart to set
    • isAutoStart

      public boolean isAutoStart()
      Gets the autoStart.
      Returns:
      the autoStart
    • setRunning

      public void setRunning(boolean running)
      Sets the running.
      Parameters:
      running - the running to set
    • getReferenceResolver

      public ReferenceResolver getReferenceResolver()
    • setReferenceResolver

      public void setReferenceResolver(ReferenceResolver referenceResolver)
      Specified by:
      setReferenceResolver in interface ReferenceResolverAware
    • getEndpointAdapter

      public EndpointAdapter getEndpointAdapter()
      Gets the message endpoint adapter.
      Returns:
    • setEndpointAdapter

      public void setEndpointAdapter(EndpointAdapter endpointAdapter)
      Sets the message endpoint adapter.
      Parameters:
      endpointAdapter -
    • getInterceptors

      public List<Object> getInterceptors()
      Gets the handler interceptors.
      Returns:
    • setInterceptors

      public void setInterceptors(List<Object> interceptors)
      Sets the handler interceptors.
      Parameters:
      interceptors -
    • getDefaultTimeout

      public long getDefaultTimeout()
      Gets the defaultTimeout for sending and receiving messages.
      Returns:
    • setDefaultTimeout

      public void setDefaultTimeout(long defaultTimeout)
      Sets the defaultTimeout for sending and receiving messages..
      Parameters:
      defaultTimeout -
    • setDebugLogging

      public void setDebugLogging(boolean debugLogging)
      Sets the debugLogging.
      Parameters:
      debugLogging -
    • isDebugLogging

      public boolean isDebugLogging()
      Gets the debugLogging.
      Returns: