LibreOffice Module ridljar (master) 1
Public Member Functions | Static Public Member Functions | Static Private Member Functions | List of all members
com.sun.star.lib.unoloader.UnoClassLoader Class Reference

The root UNO class loader. More...

Inheritance diagram for com.sun.star.lib.unoloader.UnoClassLoader:
[legend]
Collaboration diagram for com.sun.star.lib.unoloader.UnoClassLoader:
[legend]

Public Member Functions

 UnoClassLoader (URL base, URL[] classPath, ClassLoader parent) throws MalformedURLException
 Instantiates the root UNO class loader. More...
 
ClassLoader getClassLoader (URL jar, Attributes mainAttributes) throws MalformedURLException
 Obtains a class loader for a UNO JAR. More...
 
void execute (URL jar, String[] arguments) throws IOException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException
 Executes a UNO JAR. More...
 

Static Public Member Functions

static Attributes getJarMainAttributes (URL jar) throws IOException
 Obtains the main section of the manifest of a JAR. More...
 

Static Private Member Functions

static URL[] createUrls (URL base, URL[] classPath) throws MalformedURLException
 

Detailed Description

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, addURL may be necessary).

This is an internal, unstable class of the Uno Runtime Environment; it should not be used by client code.

Available since: \n UDK 3.2.0

Definition at line 47 of file UnoClassLoader.java.

Constructor & Destructor Documentation

◆ UnoClassLoader()

com.sun.star.lib.unoloader.UnoClassLoader.UnoClassLoader ( URL  base,
URL[]  classPath,
ClassLoader  parent 
) throws MalformedURLException
inline

Instantiates the root UNO class loader.

Parameters
basea base URL relative to which the URE JARs (java_uno.jar and libreoffice.jar) can be found; must not be null.
classPathan array of URLs that form the class path of this class loader; may be null, which is the same as an empty array. The URLs are interpreted in the same way as the arguments of a URLClassLoader.
parentthe parent class loader for delegation.
Exceptions
MalformedURLExceptionif the given base URL is malformed.

Definition at line 65 of file UnoClassLoader.java.

References base, and com.sun.star.lib.unoloader.UnoClassLoader.createUrls().

Member Function Documentation

◆ createUrls()

static URL[] com.sun.star.lib.unoloader.UnoClassLoader.createUrls ( URL  base,
URL[]  classPath 
) throws MalformedURLException
inlinestaticprivate

Definition at line 191 of file UnoClassLoader.java.

References base, System, and URL.

Referenced by com.sun.star.lib.unoloader.UnoClassLoader.UnoClassLoader().

◆ execute()

void com.sun.star.lib.unoloader.UnoClassLoader.execute ( URL  jar,
String[]  arguments 
) throws IOException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException
inline

Executes a UNO JAR.

Parameters
jarthe URL of a UNO JAR that specifies a Main-Class; must not be null.
argumentsany arguments passed to the main method of the specified Main-Class of the given JAR jar; must not be null.
Exceptions
IOExceptionif there are any problems processing the given JAR jar.
ClassNotFoundExceptionif the given JAR jar does not specify a Main-Class, or if the specified Main-Class cannot be found.
NoSuchMethodExceptionif the specified Main-Class of the given JAR jar does not have an appropriate main method.
InvocationTargetExceptionif an exception occurs while executing the main method of the specified Main-Class of the given JAR jar.

Definition at line 148 of file UnoClassLoader.java.

References Class, com.sun.star.lib.unoloader.UnoClassLoader.getClassLoader(), com.sun.star.lib.unoloader.UnoClassLoader.getJarMainAttributes(), invoke(), name, Object, and String.

Referenced by com.sun.star.lib.unoloader.UnoLoader.execute().

◆ getClassLoader()

ClassLoader com.sun.star.lib.unoloader.UnoClassLoader.getClassLoader ( URL  jar,
Attributes  mainAttributes 
) throws MalformedURLException
inline

Obtains a class loader for a UNO JAR.

Parameters
jarthe URL of a UNO JAR; must not be null.
mainAttributesrepresents 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.)
Returns
an appropriate class loader; will never be null.
Exceptions
MalformedURLExceptionif the given jar URL or any of the UNO-Type-Path URLs specified in the given JAR are malformed.

Definition at line 87 of file UnoClassLoader.java.

References i, String, and URL.

Referenced by com.sun.star.lib.unoloader.UnoClassLoader.execute().

◆ getJarMainAttributes()

static Attributes com.sun.star.lib.unoloader.UnoClassLoader.getJarMainAttributes ( URL  jar) throws IOException
inlinestatic

Obtains the main section of the manifest of a JAR.

Parameters
jarthe URL of a JAR; must not be null.
Returns
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.
Exceptions
IOExceptionif there are any problems processing the given JAR jar.

Definition at line 180 of file UnoClassLoader.java.

Referenced by com.sun.star.lib.unoloader.UnoClassLoader.execute().


The documentation for this class was generated from the following file: