Package sc.obj

Annotation Type MainSettings


  • @Target(METHOD)
    @Retention(RUNTIME)
    public @interface MainSettings
    This annotation is placed on a standard Java main method (i.e. a method with signature "public static void main(String[] args)"). It tells StrataCode when/how to execute that main method after compiling. StrataCode will also generate a start script if you specify the produceScript option or a package jar file if you set produceJar to true. You can control Java options required by the main method as well, or disable auto-execution.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean debug
      Include Java debug arguments for the Java start definition
      int debugPort  
      boolean debugSuspend
      When running with the -dbg option, should the script wait for the debugger to attach (i.e.
      java.lang.String defaultArgs
      Set this to a string to be put into the start script
      boolean disabled
      Set this to true to turn off automatic running of a main in a subsequent layer
      java.lang.String execBATTemplate
      When produceBAT is true, you can specify a template name for the bat file.
      java.lang.String execCommandTemplate
      When produceScript is true use execCommandTemplate to specify the type name of a template file to use for generating the exec script.
      java.lang.String execName  
      boolean includeDepsInJar
      If produceJar is true, should we also include dependent classes in the jar file (excluding system classes)
      java.lang.String jarFileName
      Specifies the name of the jar file to use when produceJar is true.
      int maxMemory
      Adjust java settings for the generated run script
      int minMemory  
      boolean produceBAT
      When produceBAT is true, a windows .bat file is produced
      boolean produceJar
      When true, a jar is created that contains the runtime files needed to run the application.
      boolean produceScript
      When true sc will produce a shell script to run the command using the execName.
      java.lang.String stopMethod
      The name of a static method on the same class to call when shutting down the process.
      boolean test
      Use this to mark main methods that are tests
      java.lang.String[] testCommands  
    • Element Detail

      • execName

        java.lang.String execName
        Default:
        ""
      • produceJar

        boolean produceJar
        When true, a jar is created that contains the runtime files needed to run the application. The name of the jar is based on the base name of the execName file (so for the command bin/sc it would be sc.jar)
        Default:
        false
      • jarFileName

        java.lang.String jarFileName
        Specifies the name of the jar file to use when produceJar is true. If not specified, the default is to produce a file called 'execName'.jar
        Default:
        ""
      • produceScript

        boolean produceScript
        When true sc will produce a shell script to run the command using the execName.
        Default:
        false
      • execCommandTemplate

        java.lang.String execCommandTemplate
        When produceScript is true use execCommandTemplate to specify the type name of a template file to use for generating the exec script. If this is not set a default template is used. The template is passed an instance of ExecCommandParameters to retrieve the command to run and type name
        Default:
        ""
      • produceBAT

        boolean produceBAT
        When produceBAT is true, a windows .bat file is produced
        Default:
        false
      • execBATTemplate

        java.lang.String execBATTemplate
        When produceBAT is true, you can specify a template name for the bat file.
        Default:
        ""
      • defaultArgs

        java.lang.String defaultArgs
        Set this to a string to be put into the start script
        Default:
        ""
      • disabled

        boolean disabled
        Set this to true to turn off automatic running of a main in a subsequent layer
        Default:
        false
      • maxMemory

        int maxMemory
        Adjust java settings for the generated run script
        Default:
        0
      • minMemory

        int minMemory
        Default:
        0
      • test

        boolean test
        Use this to mark main methods that are tests
        Default:
        false
      • testCommands

        java.lang.String[] testCommands
        Default:
        {}
      • debug

        boolean debug
        Include Java debug arguments for the Java start definition
        Default:
        false
      • debugPort

        int debugPort
        Default:
        5005
      • debugSuspend

        boolean debugSuspend
        When running with the -dbg option, should the script wait for the debugger to attach (i.e. the suspend=y option to the debugger)
        Default:
        true
      • includeDepsInJar

        boolean includeDepsInJar
        If produceJar is true, should we also include dependent classes in the jar file (excluding system classes)
        Default:
        true
      • stopMethod

        java.lang.String stopMethod
        The name of a static method on the same class to call when shutting down the process. You do not have to supply this method if live dynamic types are enabled for the main type and the type implements the IStoppable interface.
        Default:
        ""