Back to index

lightning-sunbird  0.9+nobinonly
Classes | Static Public Member Functions | Static Package Functions | Static Private Member Functions | Static Private Attributes
netscape.oji.ProxyClassLoaderFactory Class Reference
Collaboration diagram for netscape.oji.ProxyClassLoaderFactory:
Collaboration graph
[legend]

List of all members.

Classes

class  ProxyClassLoader
 Trivial subclass of URLClassLoader that predefines the class netscape.oji.LiveConnectProxy as if it were loaded from the specified codebase URL passed to the constructor. More...

Static Public Member Functions

static ClassLoader createClassLoader (final String documentURL) throws MalformedURLException
static ClassLoader createClassLoader (final String documentURL) throws MalformedURLException
static void destroyClassLoader (final String documentURL)

Static Package Functions

static void debug (String message)

Static Private Member Functions

static byte[] getMRJPluginClassFile (String path)
 Loads specified class file as an array of bytes from ${netscape.oji.plugin.home}/MRJPlugin.jar.

Static Private Attributes

static WeakHashMap mClassLoaders = new WeakHashMap()

Detailed Description

Definition at line 45 of file ProxyClassLoaderFactory.java.


Member Function Documentation

static ClassLoader netscape.oji.ProxyClassLoaderFactory.createClassLoader ( final String  documentURL) throws MalformedURLException [inline, static]

Definition at line 47 of file ProxyClassLoaderFactory.java.

                                               {
        URL[] documentURLArray = new URL[1];
        int lastIndx = documentURL.lastIndexOf("/");
        String urlPath = documentURL.substring(0, lastIndx+1);
        try {
            documentURLArray[0] = new URL(urlPath);
              }
        catch (MalformedURLException e) {
            System.out.println("MalformedURLException was caught");
            return null;
        }
        return new URLClassLoader(documentURLArray);
    }

Here is the call graph for this function:

static ClassLoader netscape.oji.ProxyClassLoaderFactory.createClassLoader ( final String  documentURL) throws MalformedURLException [inline, static]

Definition at line 103 of file ProxyClassLoaderFactory.java.

                                                                                                       {
        ClassLoader loader = (ClassLoader) mClassLoaders.get(documentURL);
        if (loader == null) {
            try {
                URL[] documentURLs = new URL[] { new URL(documentURL) };
                loader = new ProxyClassLoader(documentURLs);
                mClassLoaders.put(documentURL, loader);
              } catch (MalformedURLException e) {
            }
        }
        return loader;
    }
static void netscape.oji.ProxyClassLoaderFactory.debug ( String  message) [inline, static, package]

Definition at line 52 of file ProxyClassLoaderFactory.java.

                                      {
        System.out.println("<<< " + message + " >>>");
    }

Here is the caller graph for this function:

static void netscape.oji.ProxyClassLoaderFactory.destroyClassLoader ( final String  documentURL) [inline, static]

Definition at line 116 of file ProxyClassLoaderFactory.java.

                                                                    {
        mClassLoaders.remove(documentURL);
    }
static byte [] netscape.oji.ProxyClassLoaderFactory.getMRJPluginClassFile ( String  path) [inline, static, private]

Loads specified class file as an array of bytes from ${netscape.oji.plugin.home}/MRJPlugin.jar.

Definition at line 59 of file ProxyClassLoaderFactory.java.

                                                             {
        try {
              String homeDir = System.getProperty("netscape.oji.plugin.home");
              ZipFile jarFile = new ZipFile(new File(homeDir, "MRJPlugin.jar"));
              ZipEntry classEntry = jarFile.getEntry(path);
              int size = (int) classEntry.getSize();
              if (size > 0) {
                     byte[] data = new byte[size];
                     DataInputStream input = new DataInputStream(jarFile.getInputStream(classEntry));
                     input.readFully(data);
                     input.close();
                     jarFile.close();
                     return data;
              }
        } catch (IOException ioe) {
        }
              return null;
    }

Here is the call graph for this function:


Member Data Documentation

WeakHashMap netscape.oji.ProxyClassLoaderFactory.mClassLoaders = new WeakHashMap() [static, private]

Definition at line 101 of file ProxyClassLoaderFactory.java.


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