All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.wizards.builder.ArchiveClassLoader

java.lang.Object
   |
   +----java.lang.ClassLoader
           |
           +----com.sun.wizards.builder.ArchiveClassLoader

public final class ArchiveClassLoader
extends ClassLoader
ArchiveClassLoader is a class loader that can resolve classes from the wizard archive.

This class file is meant to be the head of the wizard archive. The wizard archive will contain classes that comprise the wizard runtime classes and images as well as initialization data for the wizard.

Classes are submitted to this class loader from the ArchiveReader.

This class cannot be subclassed.


Variable Index

 o CONSTANT_Class
The tag value for a class or an interface.
 o CONSTANT_Double
The tag value for a constant double.
 o CONSTANT_Fieldref
The tag value for a class field.
 o CONSTANT_Float
The tag value for a constant float.
 o CONSTANT_Integer
The tag value for a constant integer.
 o CONSTANT_InterfaceMethodref
The tag value for an interface method.
 o CONSTANT_Long
The tag value for a constant long.
 o CONSTANT_Methodref
The tag value for a class method.
 o CONSTANT_NameAndType
The tag value for a field or method that does not indicate affiliation with a specific class or interface.
 o CONSTANT_String
The tag value for a java.lang.String object.
 o CONSTANT_Utf8
The tag value for a constant string.

Constructor Index

 o ArchiveClassLoader()
Creates an ArchiveClassLoader object.

Method Index

 o exit(int)
Exits the server virtual machine with the specified exit code.
 o getAttributeOffset(RandomAccessFile, String)
This method returns the offset within the class bytes where the specified attribute can be found.
 o getClassBytes(String)
Retrieves the byte[] representation of the named class
 o getSectionInputStream(FileInputStream)
This method returns an input stream for a section in the wizard archive.
 o isClassRegistered(String)
Find out if the specified class is already registered with this class loader.
 o loadClass(String, boolean)
loadClass fulfills the responsibility of a subclass of ClassLoader.
 o main(String[])
The main method facilitates running this class as an application.
 o registerClass(String, byte[])
Register the specified class with the class loader.

Variables

 o CONSTANT_Utf8
 public static final byte CONSTANT_Utf8
The tag value for a constant string.

 o CONSTANT_Integer
 public static final byte CONSTANT_Integer
The tag value for a constant integer.

 o CONSTANT_Float
 public static final byte CONSTANT_Float
The tag value for a constant float.

 o CONSTANT_Long
 public static final byte CONSTANT_Long
The tag value for a constant long.

 o CONSTANT_Double
 public static final byte CONSTANT_Double
The tag value for a constant double.

 o CONSTANT_Class
 public static final byte CONSTANT_Class
The tag value for a class or an interface.

 o CONSTANT_String
 public static final byte CONSTANT_String
The tag value for a java.lang.String object.

 o CONSTANT_Fieldref
 public static final byte CONSTANT_Fieldref
The tag value for a class field.

 o CONSTANT_Methodref
 public static final byte CONSTANT_Methodref
The tag value for a class method.

 o CONSTANT_InterfaceMethodref
 public static final byte CONSTANT_InterfaceMethodref
The tag value for an interface method.

 o CONSTANT_NameAndType
 public static final byte CONSTANT_NameAndType
The tag value for a field or method that does not indicate affiliation with a specific class or interface.

Constructors

 o ArchiveClassLoader
 public ArchiveClassLoader()
Creates an ArchiveClassLoader object. This constructor can only be called on an archive. An archive is a copy of the ArchiveClassLoader class bytes with an attribute appended that contains class bytes and initialization data. The attribute gets appended by running a wizard builder, subclassed from ArchiveWriter.

See Also:
writeArchive

Methods

 o 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.
 o isClassRegistered
 public synchronized Boolean isClassRegistered(String classname)
Find out if the specified class is already registered with this class loader.

Parameters:
classname - The fully qualified name of the class.
Returns:
true if the class is already registered. false if the class has not been registered.
 o registerClass
 public synchronized void registerClass(String classname,
                                        byte classBytes[])
Register the specified class with the class loader. This must be done for all of the classes that originate within the archive.

Parameters:
classname - The fully qualified name of the class to register.
classBytes - The bytes representing the specified class.
 o loadClass
 public synchronized Class loadClass(String name,
                                     boolean resolve)
loadClass fulfills the responsibility of a subclass of ClassLoader. This method will load classes either from the system or from the hashtables within this class.

Parameters:
name - The name of the desired Class.
resolve - true if the Class needs to be resolved.
Returns:
the resulting Class, or null if it was not found.
Overrides:
loadClass in class ClassLoader
 o getClassBytes
 public synchronized byte[] getClassBytes(String name)
Retrieves the byte[] representation of the named class

Parameters:
name - The fully qualified name of the class to retrieve
Returns:
The bytes representing the named class
 o main
 public static void main(String args[])
The main method facilitates running this class as an application. This is the entry point into the wizard.

 o exit
 public void exit(int exitStatus)
Exits the server virtual machine with the specified exit code.

Parameters:
exitStatus - The exit code.
 o getAttributeOffset
 public static long getAttributeOffset(RandomAccessFile in,
                                       String attributeName)
This method returns the offset within the class bytes where the specified attribute can be found.

Parameters:
in - The input file from which the class bytes can be found.
attributeName - The name of the class attribute to locate.
Returns:
The offset of the specified attribute.

All Packages  Class Hierarchy  This Package  Previous  Next  Index