|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
RJavaClassLoader
public class RJavaClassLoader
Class loader used internally by rJava The class manages the class paths and the native libraries (jri, ...)
| Field Summary | |
|---|---|
static RJavaClassLoader |
primaryLoader
singleton |
boolean |
useSystem
Should the system class loader be used to resolve classes as well as this class loader |
static boolean |
verbose
Print debug messages if is set to true |
| Constructor Summary | |
|---|---|
RJavaClassLoader(java.lang.String path,
java.lang.String libpath)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addClassPath(java.lang.String cp)
adds an entry to the class path |
void |
addClassPath(java.lang.String[] cp)
adds several entries to the class path |
void |
addRLibrary(java.lang.String name,
java.lang.String path)
add a library to path mapping for a native library |
void |
bootClass(java.lang.String cName,
java.lang.String mName,
java.lang.String[] args)
Boots the specified method of the specified class |
protected java.lang.Class |
findClass(java.lang.String name)
|
protected java.lang.String |
findLibrary(java.lang.String name)
|
java.net.URL |
findResource(java.lang.String name)
|
java.lang.String[] |
getClassPath()
|
static RJavaClassLoader |
getPrimaryLoader()
Returns the singleton instance of RJavaClassLoader |
static void |
main(java.lang.String[] args)
main method This uses the system properties: rjava.path : path of the rJava package
rjava.lib : lib sub directory of the rJava package
main.class : main class to "boot", assumes Main if not specified
rjava.class.path : set of paths to populate the initiate the class path
and boots the "main" method of the specified main.class,
passing the args down to the booted class
This makes sure R and rJava are known by the class loader |
static void |
setDebug(int level)
Set the debug level. |
static byte[] |
toByte(java.lang.Object object)
Serialize an object to a byte array. |
java.lang.Object |
toObject(byte[] byteArray)
Deserialize an object from a byte array. |
static java.lang.Object |
toObjectPL(byte[] byteArray)
converts the byte array into an Object using the primary RJavaClassLoader |
static java.lang.String |
u2w(java.lang.String fn)
Utility to convert paths for windows. |
| Methods inherited from class java.net.URLClassLoader |
|---|
addURL, definePackage, findResources, getPermissions, getURLs, newInstance, newInstance |
| Methods inherited from class java.security.SecureClassLoader |
|---|
defineClass, defineClass |
| Methods inherited from class java.lang.ClassLoader |
|---|
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static RJavaClassLoader primaryLoader
public static boolean verbose
true
public boolean useSystem
| Constructor Detail |
|---|
public RJavaClassLoader(java.lang.String path,
java.lang.String libpath)
path - path of the rJava packagelibpath - lib sub directory of the rJava package| Method Detail |
|---|
public static RJavaClassLoader getPrimaryLoader()
protected java.lang.Class findClass(java.lang.String name)
throws java.lang.ClassNotFoundException
findClass in class java.net.URLClassLoaderjava.lang.ClassNotFoundExceptionpublic java.net.URL findResource(java.lang.String name)
findResource in class java.net.URLClassLoader
public void addRLibrary(java.lang.String name,
java.lang.String path)
public void addClassPath(java.lang.String cp)
public void addClassPath(java.lang.String[] cp)
public java.lang.String[] getClassPath()
protected java.lang.String findLibrary(java.lang.String name)
findLibrary in class java.lang.ClassLoader
public void bootClass(java.lang.String cName,
java.lang.String mName,
java.lang.String[] args)
throws java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException,
java.lang.NoSuchMethodException,
java.lang.ClassNotFoundException
cName - class to bootmName - method to boot (typically main). The method must take a String[] as parameterargs - arguments to pass to the method
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodException
java.lang.ClassNotFoundExceptionpublic static void setDebug(int level)
level - debug level. verbose (>0), quiet otherwisepublic static java.lang.String u2w(java.lang.String fn)
fn - file namepublic static void main(java.lang.String[] args)
This uses the system properties:
rjava.path : path of the rJava packagerjava.lib : lib sub directory of the rJava packagemain.class : main class to "boot", assumes Main if not specifiedrjava.class.path : set of paths to populate the initiate the class pathand boots the "main" method of the specified main.class,
passing the args down to the booted class
This makes sure R and rJava are known by the class loader
public static byte[] toByte(java.lang.Object object)
throws java.lang.Exception
object - object to serialize
java.lang.Exception
public java.lang.Object toObject(byte[] byteArray)
throws java.lang.Exception
byteArray -
java.lang.Exception
public static java.lang.Object toObjectPL(byte[] byteArray)
throws java.lang.Exception
java.lang.Exception
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||