org.openbp.common.classloader
Class XClassLoaderSystemErr

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by org.openbp.common.classloader.XClassLoaderBase
                  extended by org.openbp.common.classloader.XClassLoaderSystemErr

public class XClassLoaderSystemErr
extends XClassLoaderBase

XClassLoader that logs errors to System.err.

Author:
Falk Hartmann

Field Summary
 
Fields inherited from class org.openbp.common.classloader.XClassLoaderBase
configuration, DEBUG_LOAD_TIME
 
Constructor Summary
XClassLoaderSystemErr(XClassLoaderConfiguration config, java.lang.String logLevel)
          The constructor.
 
Method Summary
protected  boolean isLogEnabled(java.lang.String logLevel)
          Checks if the specified log level is enabled.
protected  void setupLogger()
          Initializes the logger.
protected  void writeLog(java.lang.String logLevel, java.lang.String msg, java.lang.Exception e)
          Writes a message to the log.
 
Methods inherited from class org.openbp.common.classloader.XClassLoaderBase
addClassToCache, addResourceEntry, addResourceEntryForClass, createClass, getConfiguration, getParentClassLoader, getResource, getResourceAsStream, getResourceEntry, getResourceFromPath, init, loadClass, loadClassFromCache, loadClassFromPath, loadResourceFromPath, log, log, log, log, log, readContent, rescan, scanRepositories, toString
 
Methods inherited from class java.net.URLClassLoader
addURL, definePackage, findClass, findResource, 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, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XClassLoaderSystemErr

public XClassLoaderSystemErr(XClassLoaderConfiguration config,
                             java.lang.String logLevel)
                      throws java.lang.Exception
The constructor.

Parameters:
config - A configuration for the class loader to be constructed
logLevel - The log level to be used for the class loader as in LogLevel
Throws:
java.lang.Exception - On any error that occurs while scanning the repositories specified in the class loader configuration
Method Detail

setupLogger

protected void setupLogger()
Description copied from class: XClassLoaderBase
Initializes the logger. This will be called before any log output is being written.

Specified by:
setupLogger in class XClassLoaderBase

writeLog

protected void writeLog(java.lang.String logLevel,
                        java.lang.String msg,
                        java.lang.Exception e)
Description copied from class: XClassLoaderBase
Writes a message to the log. This abstract method has to be implemented by sub classes of this class to implement support of a custom log mechanism.

Specified by:
writeLog in class XClassLoaderBase
Parameters:
logLevel - Log level as defined by LogLevel
msg - Message to be logged
e - An exception that should be logged together with the message (might be null)

isLogEnabled

protected boolean isLogEnabled(java.lang.String logLevel)
Description copied from class: XClassLoaderBase
Checks if the specified log level is enabled. This abstract method has to be implemented by sub classes of this class to implement support of a custom log mechanism.

Specified by:
isLogEnabled in class XClassLoaderBase
Parameters:
logLevel - Log level as defined by LogLevel
Returns:
true The log level is enabled. false The log level is disabled.


Copyright © 2011. All Rights Reserved.