README for LOGICFENCE

System Requirements:

Platform: Linux, Windows
MySQL5 with default database mysql.
JVM
Perl

Before going through the steps below make sure you copy all xml files and the application programs in the  directory LogicFence_Ver2.

Steps to run an application under LogicFence framework:

1. Write the .xml files in the format as specified in the examples.
configuration.xml contains the IP address of the machine having the MySQL server.

2. Specify the start states of all the application in the file StartStates.txt and specify the start state of a single application in FirstState.txt. 

3. Specify the hostname, username and password of MySQL in the file 'pwd.txt' separated by comma(,). Do not hit enter after the password. If password is an empty string then just put the comma(,) after the username.

4. Specify in the file SleepTime.txt the interval in milliseconds after which the programs check if transition is valid or not.

4. Start the MySQL server. [By default in Windows it starts when the OS boots]

5. Compile and execute CreateDB.java.

6. Create the execution monitor as follows:
Windows: Execute the gencode.bat file by double clicking on it or write "gencode" at the command prompt and hit Enter.
Linux: Execute the gencode.sh file by the command "sh gencode.sh" at the command prompt.
A Java file called ChkStSpace.java is created in both Windows and Linux along with a text file called stateVars.txt.

7. Compile the file MonitorExe4.java.

8. Register the applications with LogicFence framework as follows:
Windows: Command prompt:
> run <class1> <class2> ...
Linux: Shell
> sh run.sh <class1> <class2> ...
The arguments <class1> <class2> etc. are the class file names of the application program. Do not put the .class extension at the end. Before this step, please make sure that the application program class files are generated using javac.
Register different applications separately if different applications have separate start states. Write the start state of an application in FirstState.txt and register the application.

9. Compile a few java files as follows:
Windows: Command prompt:
> compile
Linux: Shell
> sh compile.sh

10. Start the application instances as separate JVMs.

To generate log files for different applications for each instance of the applicatons, create a directory and copy the java files IdList.java and Settings.java and ChkStSpace.java along with the com dirctory. Compile the three java files as described in step 9.

Please make sure that all modified class files of the application are also present in each of the newly created directories.