Packaging Your Java Classes

The jar JDK tool is used to work with Java Archive or JAR files. JAR files are compressed ZIP files and typically contain class, graphic images such as GIF or G3 format, html, and a manifest file. For more information on JAR files, see http://java.sun.com/docs/books/tutorial/jar/index.html.

The Agent Editor loads any classes it can identify as implementing AbleBeans from JAR files. Follow these steps to package your classes and create a FileWatch.jar file which can be read by the Agent Editor:

  1. Create a manifest file and list any class files that implement the AbleBean interface. All files in the jar need not be included, only those that need the Java-Bean property set to True. It can be created and edited with any text editor. Make sure there is a linefeed between each entity and that there are no trailing spaces - these can cause jars to be built incorrectly so your class is not identified as a JavaBean. Here is an example we'll call AbleFileWatcher.man:
            Manifest-Version: 1.0
     
            Name: com/ibm/able/examples/ablebean/AbleFileWatcher.class
            Java-Bean: True
    
            Name: com/ibm/able/examples/ablebean/AbleFileWatcherNew.class
            Java-Bean: True
    
  2. Build the jar file using the jar tool. Here is an example:
            C:\ableWorkDir\able>jar cfmv FileWatch.jar com/ibm/able/examples/ablebean/AbleFileWatcher.man com/ibm/able/examples/ablebean/AbleFileWatcher*.class com/ibm/able/examples/ablebean/AbleFileWatcher*.gif
            

Note that the file separator "/" is used by the jar JDK tool regardless of platform.

After this jar file has been created, classes that have been flagged in the manifest as being Java Beans can be plugged into the Agent Editor by loading the jar from the Tools menu.