Installation and Using Simple Java Thread Management (SJT.Mgmt)

INSTALLATION

Follow these 3 simple steps.
1. Download the latest sjt.mgmt-*.zip file from sourceforge.net.
2. Unzip the file which contains the library in .jar format, Javadocs, makefiles, and Readme.
3. Update your CLASSPATH with SJT.Mgmt.jar

If you wish to compile the library or testing the library, continue with 2 more steps.
4. Update your CLASSPATH with JUnit.
5. Run the test case with Junit.

Detailed installation instructions just below.

USING THE LIBRARY WITHIN YOUR OWN APPLICATION

SJT.Mgmt is very easy to add into your existing application.

1. Construct an instance of a work manager object.
2. Implement a Runnable interface, containing executable code in the run() method.
3. Pass the Runnable object to the work manager.

Detailed usage instructions further below .


DETAILED INSTALLATION

1. DOWNLOAD THE LIBRARY:

You have two choices for downloading the library, the easiest is the FTP method.

FTP.
FTP from sourceforge

Or CVS on the commandline.
cvs -d:pserver:anonymous@cvs.simplethread.sourceforge.net:/cvsroot/simplethread login
cvs -z3 -d:pserver:anonymous@cvs.simplethread.sourceforge.net:/cvsroot/simplethread co .

2. UNZIP THE FILE

Unzip the sjt.mgmt.-*.zip file into a library directory.

3. UPDATE YOUR CLASSPATH:

Your classpath variable should include the SJT.Mgmt.jar file.

Example:
CLASSPATH=.:{LIBRARY_DIRECTORY}/SJT.Mgmt.jar

You are done! If you want to recompile or test the library read on.

4. UPDATE YOUR CLASSPATH WITH JUNIT:

If you are recompling or testing the library, your classpath must include the Junit jar file.

Example:
CLASSPATH=.:{LIBRARY_DIRECTORY}/SJT.Mgmt.jar:{LIBRARY_DIRECTORY}/junit.jar

4. RUN THE TEST CASE WITH JUNIT: 

Test case(s) are included in the {LIBRARY_DIRECTORY}/src directory in order to ensure a smooth run in your environment.
In order to use the Junit java GUI application just execute the class, junit.ui.TestRunner.

Example:

unix $java junit.ui.TestRunner sjt.mgmt.ThreadTest
windows c:\java junit.ui.TestRunner sjt.mgmt.ThreadTest
 

UNIX MAKEFILE

Unix has a makefile for standard compilation, testing and cleaning.

make build, will compile the library from the source.
make test, will execute jrun and the test case
make clean, will remove all .class files from your directory


USING THE LIBRARY WITHIN YOUR OWN APPLICATIONS

SJT.Mgmt is very easy to add into your existing application. Follow the three step procedure:

1. Construct an instance of a work manager object.

        new SimpleWorkManager()

2. Implement a Runnable interface, containing executable code in the run method().

        class MyWork implements Runnable {
                public void run() {
                            //some sort of executable code
                }
        }

3. Pass the Runnable object to the work manager.

        workManager.addWork(myWork)
 

See the src/README.java source file for a typical implementation of SJT.Mgmt.

Happy computing.