Top Description Methods
org.apache.derby.iapi.services.loader

public Interface ClassFactory

Known Direct Implementers
org.apache.derby.impl.services.reflect.DatabaseClasses
Imports
org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.util.ByteArray, java.io.ObjectStreamClass

A class factory module to handle application classes and generated classes.

Method Summary

Modifier and TypeMethod and Description
public ClassInspector

Returns:

the class inspector object
getClassInspector
()

Return a ClassInspector object

public int

Returns:

the version of the class loader
getClassLoaderVersion
()

Return the in-memory "version" of the class manager.

public boolean

Returns:

true if the class was loaded by a Derby class manager, false it is was loaded by the system class loader, or another class loader.
isApplicationClass
(Class<T>
The class in question
theClass
)

Was the passed in class loaded by a ClassManager.

public Class<T>

Returns:

the corresponding class object
loadApplicationClass
(String
The name of the class to load
className
)

Load an application class, or a class that is potentially an application class.

public Class<T>

Returns:

the corresponding class
loadApplicationClass
(ObjectStreamClass
Descriptor for class
classDescriptor
)

Load an application class, or a class that is potentially an application class.

public GeneratedClass

Returns:

the corresponding generated class
loadGeneratedClass
(String
Full name of the class
fullyQualifiedName
,
ByteArray
The byte code of the class
classDump
)

Add a generated class to the class manager's class repository.

public void
notifyModifyClasspath(String
The classpath being modified
classpath
)

Notify the class manager that the classpath has been modified.

public void
notifyModifyJar(boolean
Restart any attached class loader
reload
)

Notify the class manager that a jar file has been modified.

Method Detail

getClassInspectorback to summary
public ClassInspector getClassInspector()

Return a ClassInspector object

Returns:ClassInspector

the class inspector object

getClassLoaderVersionback to summary
public int getClassLoaderVersion()

Return the in-memory "version" of the class manager. The version is bumped everytime the classes are re-loaded.

Returns:int

the version of the class loader

isApplicationClassback to summary
public boolean isApplicationClass(Class<T> theClass)

Was the passed in class loaded by a ClassManager.

Parameters
theClass:Class<T>

The class in question

Returns:boolean

true if the class was loaded by a Derby class manager, false it is was loaded by the system class loader, or another class loader.

loadApplicationClassback to summary
public Class<T> loadApplicationClass(String className) throws ClassNotFoundException

Load an application class, or a class that is potentially an application class.

Parameters
className:String

The name of the class to load

Returns:Class<T>

the corresponding class object

Exceptions
ClassNotFoundException:
Class cannot be found, or a SecurityException or LinkageException was thrown loading the class.
loadApplicationClassback to summary
public Class<T> loadApplicationClass(ObjectStreamClass classDescriptor) throws ClassNotFoundException

Load an application class, or a class that is potentially an application class.

Parameters
classDescriptor:ObjectStreamClass

Descriptor for class

Returns:Class<T>

the corresponding class

Exceptions
ClassNotFoundException:
Class cannot be found, or a SecurityException or LinkageException was thrown loading the class.
loadGeneratedClassback to summary
public GeneratedClass loadGeneratedClass(String fullyQualifiedName, ByteArray classDump) throws StandardException

Add a generated class to the class manager's class repository.

Parameters
fullyQualifiedName:String

Full name of the class

classDump:ByteArray

The byte code of the class

Returns:GeneratedClass

the corresponding generated class

Exceptions
StandardException:
Standard Derby error policy
notifyModifyClasspathback to summary
public void notifyModifyClasspath(String classpath) throws StandardException

Notify the class manager that the classpath has been modified.

Parameters
classpath:String

The classpath being modified

Exceptions
StandardException:
thrown on error
notifyModifyJarback to summary
public void notifyModifyJar(boolean reload) throws StandardException

Notify the class manager that a jar file has been modified.

Parameters
reload:boolean

Restart any attached class loader

Exceptions
StandardException:
thrown on error