php.java.bridge
Class JavaBridgeClassLoader

java.lang.Object
  extended by php.java.bridge.SimpleJavaBridgeClassLoader
      extended by php.java.bridge.JavaBridgeClassLoader

public class JavaBridgeClassLoader
extends SimpleJavaBridgeClassLoader

A bridge pattern which allows us to vary the class loader as run-time. The decision is based on whether we are allowed to use a dynamic classloader or not (cl==null) or security exception at run-time.

See Also:
DynamicJavaBridgeClassLoader, ClassLoader

Constructor Summary
JavaBridgeClassLoader(java.lang.ClassLoader xloader)
          Create a new JavaBridge class loader
 
Method Summary
 void clear()
          clear the caches and the input vectors, clear the VM cache and set a new ThreadContextClassLoader
 void reset()
          reset loader to the loader to its initial state, clear the VM cache and set a new ThreadContextClassLoader This is only called by the API function "java_reset()", used only for tests.
 void switcheThreadContextClassLoader()
          Enable the DynamicJavaBridgeClassLoader, if needed.
 void updateJarLibraryPath(java.lang.String path, java.lang.String extensionDir, java.lang.String cwd, java.lang.String searchpath)
          Append the path to the current library path
 
Methods inherited from class php.java.bridge.SimpleJavaBridgeClassLoader
forName, getClassLoader, getContextClassLoader, getDefaultClassLoader
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaBridgeClassLoader

public JavaBridgeClassLoader(java.lang.ClassLoader xloader)
Create a new JavaBridge class loader

Parameters:
xloader - The real class loader
Method Detail

reset

public void reset()
reset loader to the loader to its initial state, clear the VM cache and set a new ThreadContextClassLoader This is only called by the API function "java_reset()", used only for tests.

Overrides:
reset in class SimpleJavaBridgeClassLoader

clear

public void clear()
clear the caches and the input vectors, clear the VM cache and set a new ThreadContextClassLoader

Overrides:
clear in class SimpleJavaBridgeClassLoader

updateJarLibraryPath

public void updateJarLibraryPath(java.lang.String path,
                                 java.lang.String extensionDir,
                                 java.lang.String cwd,
                                 java.lang.String searchpath)
                          throws java.io.IOException
Append the path to the current library path

Overrides:
updateJarLibraryPath in class SimpleJavaBridgeClassLoader
Parameters:
path - A file or url list, separated by ';'
extensionDir - Usually ini_get("extension_dir");
cwd - The current working dir
searchpath - The search path
Throws:
java.io.IOException

switcheThreadContextClassLoader

public void switcheThreadContextClassLoader()
Enable the DynamicJavaBridgeClassLoader, if needed. This method changes the current thread context classLoader as a side effect.

Overrides:
switcheThreadContextClassLoader in class SimpleJavaBridgeClassLoader