Class DiffusionServer

java.lang.Object
com.pushtechnology.diffusion.api.server.DiffusionServer
All Implemented Interfaces:
EmbeddedDiffusion

public class DiffusionServer extends Object implements 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 then 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 then 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:
4.4
  • Constructor Details

    • DiffusionServer

      public DiffusionServer() throws ConfigException
      Constructor. Creates a Diffusion Server with default configuration. Equivalent to calling DiffusionServer(Properties) with the system properties.
      Throws:
      ConfigException - If the configuration is invalid.
    • DiffusionServer

      public DiffusionServer(Properties bootstrapProps) throws ConfigException
      Constructor. Creates a Diffusion Server which loads xml properties from a directory specified by the provided bootstrap properties
      Parameters:
      bootstrapProps - The bootstrap properties to be used for configuration
      Throws:
      ConfigException - If the configuration is invalid.
    • DiffusionServer

      public DiffusionServer(String propertiesDirectory, boolean embedded) throws ConfigException
      Constructor.
      Parameters:
      propertiesDirectory - The properties directory from which xml properties will be loaded. If null, the default directory will be used.
      embedded - If true, do not register a JVM shutdown hook, and do not exit the JVM after stopping.
      Throws:
      ConfigException - If the configuration is invalid.
      Since:
      5.0.0
    • DiffusionServer

      public DiffusionServer(Properties bootstrapProps, boolean embedded) throws ConfigException
      Constructor.

      Creates a Diffusion Server which loads xml properties from a directory specified by the provided bootstrap properties

      Parameters:
      bootstrapProps - The bootstrap properties to be used for configuration
      embedded - If true, do not register a JVM shutdown hook, and do not exit the JVM after stopping.
      Throws:
      ConfigException - If the configuration is invalid.
      Since:
      5.0.0
  • Method Details