com.sun.star.lib.unoloader
Class UnoClassLoader
URLClassLoader
com.sun.star.lib.unoloader.UnoClassLoader
public final class UnoClassLoader
extends URLClassLoader
The root UNO class loader.
This class loader is able to load all published URE classes, including the
classes representing the published URE UNO types. For consistency, it is
important that within each Java UNO environment there is one instance of this
class loader that is the defining class loader of all published URE classes
(and hence of all unpublished URE classes, too) and of all classes
representing UNO types (the published URE UNO types, any unpublished URE UNO
types, and any additional UNO types introduced by components; for the latter,
UnoClassLoader
may be necessary).
This class is not yet stable.
- UDK 3.2.0
UnoClassLoader(URL base, ClassLoader parent) - Instantiates the root UNO class loader.
|
UnoClassLoader(URL base, ClassLoader parent, URL[] extraTypes) - Instantiates the root UNO class loader, passing it locations of
additional UNO types.
|
void | execute(URL jar, String[] arguments) - Executes a UNO JAR.
|
ClassLoader | getClassLoader(URL jar, Attributes mainAttributes) - Obtains a class loader for a UNO JAR.
|
static Attributes | getJarMainAttributes(URL jar) - Obtains the main section of the manifest of a JAR.
|
UnoClassLoader
public UnoClassLoader(URL base,
ClassLoader parent)
throws MalformedURLException
Instantiates the root UNO class loader.
base
- a base URL relative to which the URE JARs
(java_uno.jar
, juh.jar
, jurt.jar
,
ridl.jar
) can be found; must not be null
.parent
- the parent class loader for delegation.
UnoClassLoader
public UnoClassLoader(URL base,
ClassLoader parent,
URL[] extraTypes)
throws MalformedURLException
Instantiates the root UNO class loader, passing it locations of
additional UNO types.
base
- a base URL relative to which the URE JARs
(java_uno.jar
, juh.jar
, jurt.jar
,
ridl.jar
) can be found; must not be null
.parent
- the parent class loader for delegation.extraTypes
- a (possibly empty) array of URLs through which Java
classes representing additional UNO types can be found; must not be
null
.
- UDK 3.2.2
execute
public void execute(URL jar,
String[] arguments)
throws IOException,
ClassNotFoundException,
NoSuchMethodException,
InvocationTargetException
Executes a UNO JAR.
jar
- the URL of a UNO JAR that specifies a Main-Class; must not be
null
.arguments
- any arguments passed to the main
method of
the specified Main-Class of the given JAR jar
; must not be
null
.
getClassLoader
public ClassLoader getClassLoader(URL jar,
Attributes mainAttributes)
throws MalformedURLException
Obtains a class loader for a UNO JAR.
jar
- the URL of a UNO JAR; must not be null
.mainAttributes
- represents the main section of the manifest of the
given JAR jar
; null
if the given JAR does not
have a manifest. (This redundant parameter is there for performance
reasons, as typically the caller of this method already has this
information available.)
- an appropriate class loader; will never be
null
.
getJarMainAttributes
public static Attributes getJarMainAttributes(URL jar)
throws IOException
Obtains the main section of the manifest of a JAR.
jar
- the URL of a JAR; must not be null
.
- the representation of the main section of the manifest of the
given JAR
jar
, or null
if the given JAR does
not have a manifest.