A wizard builder superclass exists that contains all of the code to write the wizard archive. This class is called the ArchiveWriter. A subclass of ArchiveWriter must be created which overrides the createClientTree method to build the client tree panel structure. This method can also set data into the WizardState, as well as create Sequences.
The builder can create an archive with any classname that is legal with Java. The classname is set by assigning the string archiveName to the desired name. The ".class" extension should not be appended to the name.
The archive can have all of its sections compressed or not. The default behavior is to not compress the sections. Make the choice to compress the archive sections by setting the useCompression class variable to true. If the useCompression flag is true, the ArchiveWriter uses a DeflatorOutputStream object to compress the data written into the archive.
The ArchiveWriter takes care of:
The ArchiveWriter also is responsible for creating the class attribute that stores all of this information within the ArchiveClassLoader class.
A resource collection mechanism is built into Tasks and client panels to ensure that all of the required supporting Java class files are written into the archive. The mechanism works because each subclass of Task and each subclass of WizardComponent overrides the addRuntimeResources method to specify its dependencies. This method adds each supporting classname to the vector that is passed in. The ArchiveWriter collects all of the resources into a vector. The vector is reduced to remove all duplicate entries. This vector is used to determine which class files should be added to the archive.
It is important to cooperate with the resource collection mechanism when writing Task subclasses and panels. If a supporting class is not added to the wizard archive, the result will be a wizard that throws a ClassNotFound exception.
Data can be put into the Custom Archive Resources section of the wizard archive by writing an object of interface ResourceWriter. ResourceWriter has only one method that is used to put data into the archive. That method is called writeResource. Each ResourceWriter object should be set into the builder through a call to the addResource method, which accepts a type and the ResourceWriter object.
After creating the wizard client tree and initializing the WizardState with data and Sequences, the archive is written through a call to writeArchive.
Last modified: Fri Nov 25 16:48 PDT