Package de.mid.innovator.ui
Class InnovatorApplicationDefault
java.lang.Object
de.mid.innovator.ui.InnovatorApplicationDefault
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterRun()A callback method can be overloaded; the method is called after the application is successfully run.voidA callback method can be overloaded; the method is called before running the application.static InnovatorApplicationcreate(Class<? extends InnovatorApplication> cls, Property[] props, String[] args) This method should be called in your static main method.Returns the value of the environment variable INODIR.Returns the value of the environment variable INOHOME.voidfinal voidRecords program activity with INFO level.final voidLogs program activity (this is done by using theLoggerclass).final voidDisplays a language-specific message which must be specified according to the rules defined inInoNls.voidonExit()A callback method can be overloaded; the method is called before exiting the application.voidonInit()A callback method can be overloaded; the method is called upon application initialization.final voidThe method delivers a warning message to the user.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.mid.innovator.ui.InnovatorApplication
run, Usage
-
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 InnovatorApplicationprops- a list of valid properties/arguments which the application can handleargs- the arguments received from the static main method- Returns:
- the created instance upon successful execution
- Throws:
Exception
-
log
Logs program activity (this is done by using theLoggerclass).- Specified by:
login interfaceInnovatorApplication- Parameters:
l- the logging levelmsg- a message that can contain message format variablesvargs- the arguments for the message format- See Also:
-
info
Records program activity with INFO level.- Specified by:
infoin interfaceInnovatorApplication- Parameters:
msg- a message that can contain message format variablesvargs- the arguments for the message format- See Also:
-
msg
Displays a language-specific message which must be specified according to the rules defined inInoNls.- Specified by:
msgin interfaceInnovatorApplication- Parameters:
key- a property file's message keyvargs- the arguments for the message format- See Also:
-
warning
The method delivers a warning message to the user. Error conditions should be triggered using exceptions.- Specified by:
warningin interfaceInnovatorApplication- Parameters:
key- a property file's message keyvargs- 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:
onInitin interfaceInnovatorApplication
-
onExit
public void onExit()A callback method can be overloaded; the method is called before exiting the application.- Specified by:
onExitin interfaceInnovatorApplication
-
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
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
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
-