xmlBlaster 2.2.0 client API

org.xmlBlaster.util.classloader
Class StandaloneClassLoaderFactory

java.lang.Object
  extended by org.xmlBlaster.util.classloader.StandaloneClassLoaderFactory
All Implemented Interfaces:
ClassLoaderFactory
Direct Known Subclasses:
OsgiClassLoaderFactory

public class StandaloneClassLoaderFactory
extends java.lang.Object
implements ClassLoaderFactory


Field Summary
 java.lang.String ME
           
 
Constructor Summary
StandaloneClassLoaderFactory()
           
StandaloneClassLoaderFactory(Global glob)
          We are a singleton in respect to a Global instance.
 
Method Summary
static java.lang.String directoryForWrite(java.lang.String path)
          Recursiv go up the given path until we find a writeable directory
static java.lang.String getDirectoryForWrite()
          Navigate up the absolute file system path (where this class came from) until we find a writeable directory.
static LoaderInfo getLoaderInfo(java.lang.Object caller, java.lang.String plugin, boolean exceptionOnFailure)
          Retrievs the base path for the object related classpath.
 java.net.URLClassLoader getPluginClassLoader(PluginInfo pluginInfo)
          Creates and returns a new URL class loader based on the callers class loader and the callers related additional classes which may exist in a specified path.
 java.net.URLClassLoader getXmlBlasterClassLoader()
          Creates and returns a new URL class loader based on the callers class loader and the callers related additional classes which may exist in a specified path.
 void init(Global glob)
           
static java.lang.String which(java.lang.Object caller, java.lang.String className)
          Prints the absolute pathname of the class file containing the specified class name, as prescribed by the current classpath.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ME

public java.lang.String ME
Constructor Detail

StandaloneClassLoaderFactory

public StandaloneClassLoaderFactory()

StandaloneClassLoaderFactory

public StandaloneClassLoaderFactory(Global glob)
We are a singleton in respect to a Global instance.

Method Detail

init

public void init(Global glob)
Specified by:
init in interface ClassLoaderFactory

getPluginClassLoader

public java.net.URLClassLoader getPluginClassLoader(PluginInfo pluginInfo)
                                             throws XmlBlasterException
Creates and returns a new URL class loader based on the callers class loader and the callers related additional classes which may exist in a specified path.

Specified by:
getPluginClassLoader in interface ClassLoaderFactory
Throws:
XmlBlasterException

getXmlBlasterClassLoader

public java.net.URLClassLoader getXmlBlasterClassLoader()
                                                 throws XmlBlasterException
Creates and returns a new URL class loader based on the callers class loader and the callers related additional classes which may exist in a specified path.

Specified by:
getXmlBlasterClassLoader in interface ClassLoaderFactory
Throws:
XmlBlasterException

getLoaderInfo

public static LoaderInfo getLoaderInfo(java.lang.Object caller,
                                       java.lang.String plugin,
                                       boolean exceptionOnFailure)
                                throws XmlBlasterException
Retrievs the base path for the object related classpath. Taking the base path from the line in the environment classpath which contains the xmlBlaster.jar first! Adding the name of the calling class as path to the basepath.

Parameters:
caller - Type of the calling class
plugin - The plugin name e.g. "org.xmlBlaster.protocol.corba.CorbaDriver" or null
exceptionOnFailure - TODO
Returns:
The base path for the caller specific additional classes, is never null
Throws:
On - failure
XmlBlasterException

which

public static java.lang.String which(java.lang.Object caller,
                                     java.lang.String className)
Prints the absolute pathname of the class file containing the specified class name, as prescribed by the current classpath.
 author Mike Clark
 author Clarkware Consulting
 

Parameters:
caller -
className - Name of the class, e.g. "org.xmlBlaster.protocol.corba.CorbaDriver"
Returns:
Url of resource of className. e.g. "/home/xmlblast/xmlBlaster/classes/org/xmlBlaster/protocol/corba/CorbaDriver.class"

getDirectoryForWrite

public static java.lang.String getDirectoryForWrite()
Navigate up the absolute file system path (where this class came from) until we find a writeable directory.

Returns:
for example "/home/project/lib"

directoryForWrite

public static java.lang.String directoryForWrite(java.lang.String path)
Recursiv go up the given path until we find a writeable directory

Parameters:
path -
Returns:
null if not found

xmlBlaster 2.2.0 client API

Copyright © 1999-2014 The xmlBlaster.org contributers.