Interface EmbeddedDiffusion

All Known Implementing Classes:
DiffusionServer

public interface EmbeddedDiffusion
Represents an instance of the Diffusion Server.

When a server is instantiated it will attempt to load any XML configuration files that it finds on the classpath (or in the specified directory). If no XML files are found, the server will be loaded with default (empty) configuration and will have to be configured before starting it.

The server may be configured by getting the root configuration using the getConfig() and then configuring any aspects that are required.

Once the server has been started, most aspects of the configuration can no longer be changed.

Currently only one instance of the Diffusion Server can ever be instantiated in a VM. Once one has been instantiated another can not be. Once a server has been stopped it may not be restarted nor another instantiated. These restrictions may be removed at a future release.

Since:
5.6
  • Method Details

    • getConfig

      ServerConfig getConfig()
      Returns the root server configuration.

      This may be called before starting the server to configure it or provide further configuration over and above that loaded from any XML properties files found (either on the classpath or the specified directory).

      Returns:
      configuration root
    • isStarted

      boolean isStarted()
      Returns:
      whether or not the server has started
    • isStopped

      boolean isStopped()
      Returns:
      whether or not the server has stopped
    • start

      void start() throws APIException
      Starts the server.

      The server may only be started once.

      Throws:
      APIException - if unable to start
    • stop

      void stop()
      Stops the server.

    • addLifecycleListener

      void addLifecycleListener(EmbeddedDiffusion.LifecycleListener listener)
      Register for lifecycle events.
      Parameters:
      listener - that is called when a state transition occurs.
      Since:
      5.6
    • removeLifecycleListener

      void removeLifecycleListener(EmbeddedDiffusion.LifecycleListener listener)
      De-Register for lifecycle events.
      Parameters:
      listener - to be removed.
      Since:
      5.6