Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions
org.mozilla.xpcom.internal.JavaXPCOMMethods Class Reference
Inheritance diagram for org.mozilla.xpcom.internal.JavaXPCOMMethods:
Inheritance graph
[legend]
Collaboration diagram for org.mozilla.xpcom.internal.JavaXPCOMMethods:
Collaboration graph
[legend]

List of all members.

Public Member Functions

native long wrapJavaObject (Object aJavaObject, String aIID)
 Returns a pointer to a C++ proxy object for the given Java object.
native Object wrapXPCOMObject (long aXPCOMObject, String aIID)
 Returns a Java proxy for the given C++ XPCOM object.

Static Public Member Functions

static void registerJavaXPCOMMethods (File aLibXULDirectory)
static native void registerJavaXPCOMMethodsNative (File aLibXULDirectory)
static Class findClassInLoader (Object aObject, String aClassName)
 Returns the Class object associated with the class or interface with the given string name, using the class loader of the given object.

Detailed Description

Definition at line 44 of file JavaXPCOMMethods.java.


Member Function Documentation

static Class org.mozilla.xpcom.internal.JavaXPCOMMethods.findClassInLoader ( Object  aObject,
String  aClassName 
) [inline, static]

Returns the Class object associated with the class or interface with the given string name, using the class loader of the given object.

Parameters:
aObjectthe Java object whose class loader is used to load class
aClassNamethe fully qualified name of desired class
Returns:
the Class object of requested Class; null if the class was not found
See also:
http://java.sun.com/j2se/1.3/docs/guide/jni/jni-12.html#classops

Definition at line 77 of file JavaXPCOMMethods.java.

                                                                           {
    try {
      if (aObject == null) {
        return Class.forName(aClassName);
      } else {
        return Class.forName(aClassName, true,
            aObject.getClass().getClassLoader());
      }
    } catch (ClassNotFoundException e) {
      return null;
    }
  }
static void org.mozilla.xpcom.internal.JavaXPCOMMethods.registerJavaXPCOMMethods ( File  aLibXULDirectory) [inline, static]

Definition at line 46 of file JavaXPCOMMethods.java.

                                                                     {
    // load JNI library
    String path = "";
    if (aLibXULDirectory != null) {
      path = aLibXULDirectory + File.separator;
    }

    String osName = System.getProperty("os.name").toLowerCase();
    if (osName.startsWith("os/2")) {
      System.load(path + System.mapLibraryName("jxpcmglu"));
    } else {
      System.load(path + System.mapLibraryName("javaxpcomglue"));
    }

    registerJavaXPCOMMethodsNative(aLibXULDirectory);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static native void org.mozilla.xpcom.internal.JavaXPCOMMethods.registerJavaXPCOMMethodsNative ( File  aLibXULDirectory) [static]

Here is the caller graph for this function:

Returns a pointer to a C++ proxy object for the given Java object.

Parameters:
aJavaObjectJava object to encapsulate in C++ proxy
aIIDinterface ID for requested proxy
Returns:
C pointer (as long) of new proxy

Implements org.mozilla.xpcom.IJavaXPCOMUtils.

Returns a Java proxy for the given C++ XPCOM object.

Parameters:
aXPCOMObjectC++ XPCOM object to encapsulate in Java proxy
aIIDinterface ID for requested proxy
Returns:
new Proxy

Implements org.mozilla.xpcom.IJavaXPCOMUtils.


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