Class InnovatorApplicationDefault

java.lang.Object
de.mid.innovator.ui.InnovatorApplicationDefault
All Implemented Interfaces:
InnovatorApplication

public abstract class InnovatorApplicationDefault extends Object implements InnovatorApplication
The class is a default implementation of the InnovatorApplication interface. It should facilitate coding for Java applications when connecting to an Innovator server. It uses an InnovatorBatchLoginDefault instance when the application is started from the command line.
Author:
borschet
See Also:
  • Constructor Details

    • InnovatorApplicationDefault

      public InnovatorApplicationDefault()
  • Method Details

    • ignoreBatchLogin

      public void ignoreBatchLogin()
    • create

      public static InnovatorApplication create(Class<? extends InnovatorApplication> cls, Property[] props, String[] args) throws Exception

      This method should be called in your static main method. All necessary steps to obtain a valid connection to a model are carried out. A user is logged-on by default. A run() is then called to run your specific application code. It also provides various methods for message logging and argument parsing. If an exception is raised in your code, it handles the output.

      Example:

      public static void main(String[] args) throws Exception {
      InnovatorApplicationDefault.create(TestMain.class, null, args);
      }

      Parameters:
      cls - your application instance's class to be created; it must implement InnovatorApplication
      props - a list of valid properties/arguments which the application can handle
      args - the arguments received from the static main method
      Returns:
      the created instance upon successful execution
      Throws:
      Exception
    • log

      public final void log(Level l, String msg, Object... vargs)
      Logs program activity (this is done by using the Logger class).
      Specified by:
      log in interface InnovatorApplication
      Parameters:
      l - the logging level
      msg - a message that can contain message format variables
      vargs - the arguments for the message format
      See Also:
    • info

      public final void info(String msg, Object... vargs)
      Records program activity with INFO level.
      Specified by:
      info in interface InnovatorApplication
      Parameters:
      msg - a message that can contain message format variables
      vargs - the arguments for the message format
      See Also:
    • msg

      public final void msg(String key, Object... vargs)
      Displays a language-specific message which must be specified according to the rules defined in InoNls.
      Specified by:
      msg in interface InnovatorApplication
      Parameters:
      key - a property file's message key
      vargs - the arguments for the message format
      See Also:
    • warning

      public final void warning(String key, Object... vargs)
      The method delivers a warning message to the user. Error conditions should be triggered using exceptions.
      Specified by:
      warning in interface InnovatorApplication
      Parameters:
      key - a property file's message key
      vargs - the arguments for the message format
    • onInit

      public void onInit()
      A callback method can be overloaded; the method is called upon application initialization.
      Specified by:
      onInit in interface InnovatorApplication
    • onExit

      public void onExit()
      A callback method can be overloaded; the method is called before exiting the application.
      Specified by:
      onExit in interface InnovatorApplication
    • beforeRun

      public void beforeRun()
      A callback method can be overloaded; the method is called before running the application.
    • afterRun

      public void afterRun()
      A callback method can be overloaded; the method is called after the application is successfully run.
    • getInoHome

      public String getInoHome()
      Returns the value of the environment variable INOHOME. This value is only available when started from Innovator Model Editor.
      Returns:
      Value of the environment variable INOHOME
    • getInoDir

      public String getInoDir()
      Returns the value of the environment variable INODIR. This value is only available when started from Innovator Model Editor.
      Returns:
      Value of the environment variable INODIR