Module spiralcraft-main

Used to launch Spiralcraft applications from the command line or other host shell.

This module supplies an executable spiralcraft-main.jar, which is normally invoked in the following form:

java -jar <some-path>/lib/spiralcraft-main.jar ...

This module loads the spiralcraft-core module in its own isolated ClassLoader, and hands over control to the spiralcraft.loader subsystem. This allows the loader mechanism to run applications which may depend on different versions of the spiralcraft-core library, as may be the case in multi-tenant web servers and other applications with multiple classloading contexts.

Resolution process

  • The spiralcraft.main.Spiralcraft class is the entry point for the executable .jar file.
  • The System property "spiralcraft.home" is used to indicate where the loader is installed. This is usually some directory that contains a lib/ directory that has Spiralcraft module .jar files, specifically lib/spiralcraft-core.jar.
    • (Standard scenario) If "spiralcraft.home" is not pre-set, it will be set by doing the following:
      • (Standard scenario) Look in the system classpath and use the parent directory of lib/spiralcraft-main.jar, if present.
      • Attempt to use the startup directory.
      • (Not implemented yet) Try to use an external environment variable
    • "spiralcraft.home" can be pre-set by defining the system property as a VM argument: eg. java -Dspiralcraft.home=/opt/spiralcraft
    • "spiralcraft.home" can be pre-set by including it as a main argument: eg. java -jar .../spiralcraft-main.jar -spiralcraft.home /opt/spiralcraft