All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.wizards.core.ArchiveReader
java.lang.Object
|
+----com.sun.wizards.core.ArchiveReader
- public class ArchiveReader
- extends Object
ArchiveReader is responsible for reading the wizard archive
and submitting class byte descriptions to the ArchiveClassLoader.
NOTE: Any objects created or called from this class must be done
through reflection. When this object is created, the class
loader does not know about all of the classes within the
archive. Any use of non-core java classes in this class
will result in a resolution error when this class is
created.
-
offsetTable
- This is a table used to look up sections in the archive.
-
openStreams
- A lookup table for open streams.
-
systemInterface
- Class to be used at runtime to interact with the underlying
platform using platform-independent system interface calls.
-
wizardState
- The wizard state is the server side of the wizard.
-
ArchiveReader(Object, String, Boolean, Object)
- Creates an ArchiveReader with the specified class loader and
archive file name.
-
bind(Integer)
- Binds the wizardState to the rmi registry.
-
callObjectMethod(Object, String, String[], Object[])
- Call an object method through reflection.
-
cleanup()
- This method is called before exiting to remove temporary files,
including the native support.
-
closeNamedResourceStream(String)
- Close the stream currently accessing the named resource.
-
createObject(String, Class[], Object[])
- Create an object through reflection.
-
finalize()
- The finalizer is responsible for deleting temporary files created by this
object.
-
getArchiveFilename()
- Get the archive filename.
-
getArchivePath()
- Get the archive path.
-
getClassLoader()
- Get the class loader being used by this ArchiveReader object.
-
getID()
- Retrieves the WizardID of the wizard this ArchiveReader is reading from
-
getNamedResource(String, String)
- This method returns the bytes of the named resource of the
specified type.
-
getNamedResourceStream(String)
- This method returns the bytes of the named resource of the
specified type.
-
getSectionInputStream(FileInputStream)
- This method returns an input stream for a section in the wizard
archive.
-
getSectionInputStream(RandomAccessFile)
- This method returns an input stream for a section in the wizard
archive.
-
getVersion()
- Retrieves the API version used to build the wizard this ArchiveReader is reading from
-
getWizardManager()
- Returns the WizardTreeManager.
-
getWizardState()
- Get the WizardState object this ArchiveReader is working with.
-
getWizardTree(String)
- Get the data representing a client subtree.
-
loadOffsetTable()
- loadOffsetTable loads the archive offset table from the
archive.
-
readState()
-
-
registerClasses()
- This method registers the RuntimeClasses found in the archive with
the class loader.
-
registerTempFile(String)
- Register a temporary file that will be removed when the wizard
exits.
-
removeTempFile(String)
- Remove the specified temporary file now.
-
writeNativeComponents(String)
- Write the native support for this platform into the specified directory.
-
writeState()
- Writes the statefile for this wizard, and any child wizards present.
offsetTable
protected Hashtable offsetTable
- This is a table used to look up sections in the archive. This table
contains named offsets.
wizardState
protected Object wizardState
- The wizard state is the server side of the wizard. This object
is created by the ArchiveReader.
openStreams
protected Hashtable openStreams
- A lookup table for open streams. This table is used
to identify open streams and close them.
systemInterface
public static SystemInterface systemInterface
- Class to be used at runtime to interact with the underlying
platform using platform-independent system interface calls.
ArchiveReader
public ArchiveReader(Object classLoader,
String archiveFilename,
Boolean startGUI,
Object parent)
- Creates an ArchiveReader with the specified class loader and
archive file name. The archive file name should specify an
absolute path and filename for the archive file.
- Parameters:
- classLoader - The class loader to be used by this
ArchiveReader.
- archiveFilename - The absolute path and filename for
the archive this reader will read.
- startGUI - Indicates whether the graphical user
interface should be started.
- parent - The WizardState object that is the parent
of the wizard being instantiated by this
ArchiveReader object.
getVersion
public String getVersion()
- Retrieves the API version used to build the wizard this ArchiveReader is reading from
getID
public String getID()
- Retrieves the WizardID of the wizard this ArchiveReader is reading from
writeState
public void writeState()
- Writes the statefile for this wizard, and any child wizards present.
readState
public void readState()
getWizardState
public synchronized Object getWizardState()
- Get the WizardState object this ArchiveReader is working with.
- Returns:
- The WizardState.
getArchivePath
public synchronized String getArchivePath()
- Get the archive path.
- Returns:
- The path to this archive.
getArchiveFilename
public synchronized String getArchiveFilename()
- Get the archive filename.
- Returns:
- The filename of this archive, including the path.
getSectionInputStream
public DataInput getSectionInputStream(RandomAccessFile file)
- This method returns an input stream for a section in the wizard
archive. This method will determine from the archive section if
compression is being used, and return an appropriate input stream.
- Parameters:
- file - The file, correctly positioned to read the desired
archive section.
- Returns:
- An input stream that can read the archive section.
getSectionInputStream
public DataInput getSectionInputStream(FileInputStream file)
- This method returns an input stream for a section in the wizard
archive. This method will determine from the archive section if
compression is being used, and return an appropriate input stream.
- Parameters:
- file - The file, correctly positioned to read the desired
archive section.
- Returns:
- An input stream that can read the archive section.
getClassLoader
public synchronized Object getClassLoader()
- Get the class loader being used by this ArchiveReader object.
- Returns:
- The class loader.
bind
public Boolean bind(Integer rmiPort)
- Binds the wizardState to the rmi registry. The wizardState
should be a GenericRemoteWizardState. The only object to
call this method is the ArchiveClassLoader, and only if we
are running remote. We simply reflect to call into the
wizardState, which takes care of binding itself.
- Parameters:
- rmiPort - The desired port with which client proxy objects should
attempt to find exported GenericRemoteWizardStates on.
- Returns:
- Whether the binding was successful or not
getNamedResource
public byte[] getNamedResource(String type,
String name)
- This method returns the bytes of the named resource of the
specified type.
- Parameters:
- type - The type of resource.
- name - The name of the resource.
- Returns:
- The byte array representing the requested resource.
getNamedResourceStream
public ResourceSection getNamedResourceStream(String name)
- This method returns the bytes of the named resource of the
specified type.
- Parameters:
- name - The name of the resource.
- Returns:
- The requested resource section.
closeNamedResourceStream
public void closeNamedResourceStream(String name)
- Close the stream currently accessing the named resource.
- Parameters:
- name - The name of the resource the stream is reading.
registerClasses
protected void registerClasses()
- This method registers the RuntimeClasses found in the archive with
the class loader.
loadOffsetTable
public synchronized void loadOffsetTable()
- loadOffsetTable loads the archive offset table from the
archive.
callObjectMethod
public Object callObjectMethod(Object target,
String methodName,
String argTypes[],
Object args[])
- Call an object method through reflection.
- Parameters:
- target - The object to call the method on.
- methodName - The name of the method to call.
- argTypes - The parameter list identifying the
correct method.
- args - The parameters to pass to the method.
- Returns:
- The method return value.
createObject
public Object createObject(String classname,
Class argTypes[],
Object args[])
- Create an object through reflection.
- Parameters:
- classname - The class name of the object to create.
- argTypes - The paramater list identifying the correct
constructor.
- args - The arguments to pass to the constructor.
- Returns:
- The created object.
getWizardTree
public synchronized byte[] getWizardTree(String subtreeName)
- Get the data representing a client subtree.
- Parameters:
- subtreeName - The name of the subtree, or null
for the entire client tree.
- Returns:
- The data representing the client tree.
writeNativeComponents
public synchronized void writeNativeComponents(String nativeLibDirectory)
- Write the native support for this platform into the specified directory.
- Parameters:
- nativeLibDirectory - The directory into which the native support should be written.
registerTempFile
public void registerTempFile(String filename)
- Register a temporary file that will be removed when the wizard
exits.
- Parameters:
- filename - The absolute path to the file to be removed.
removeTempFile
public void removeTempFile(String filename)
- Remove the specified temporary file now.
- Parameters:
- filename - The absolute path to the temporary file to be removed.
getWizardManager
public Object getWizardManager()
- Returns the WizardTreeManager.
finalize
protected void finalize() throws Throwable
- The finalizer is responsible for deleting temporary files created by this
object.
- Throws: Throwable
- If there are problems shutting down
the wizard or deleting any temporary files.
- Overrides:
- finalize in class Object
cleanup
public void cleanup()
- This method is called before exiting to remove temporary files,
including the native support.
All Packages Class Hierarchy This Package Previous Next Index