Package rife.engine

Class Site


public class Site extends Router
The main site of your web application, which is also the top-level router.
Since:
1.0
  • Field Details

    • RND

      public final int RND
      A unique random number that's generated only once per web application deployment.
      Since:
      1.0
  • Constructor Details

    • Site

      public Site()
  • Method Details

    • createWorkflow

      public Workflow createWorkflow()
      Creates a new workflow instance with a default executor.

      Note that the site doesn't keep a reference to it, so make sure it's not garbage collected unexpectedly.

      Returns:
      the new workflow instance
      Since:
      1.0
    • createWorkflow

      public Workflow createWorkflow(ExecutorService executor)
      Creates a new workflow instance with a provided executor.

      Note that the site doesn't keep a reference to it, so make sure it's not garbage collected unexpectedly.

      Parameters:
      executor - the executor to use for running the work
      Returns:
      the new workflow instance
      Since:
      1.0
    • config

      public Config config()
      Returns this site's config instance.
      Returns:
      this site's config instance.
      Since:
      1.6.0
    • loadConfig

      public void loadConfig(String name)
      Looks for a named resource in the classpath, parses it as an XML Config file and sets it as this site's config instance.
      Parameters:
      name - the name of the resource to parse
      Throws:
      EngineException - when an error occurred during the parsing, or if the resource couldn't be found
      Since:
      1.6.0
    • loadConfig

      public void loadConfig(File file)
      Parses the provided file as an XML Config file and sets it as this site's config instance.
      Parameters:
      file - the file to parse
      Throws:
      EngineException - when an error occurred during the parsing, or if the resource couldn't be found
      Since:
      1.6.0