Class CpoClassLoader

java.lang.Object
org.synchronoss.cpo.core.helper.CpoClassLoader

public final class CpoClassLoader extends Object
This is a proxy class designed to handle the different classloaders needed when running in a container as a skinny war versus running from the console.

Currently check the classloader for cpo first, then use the contextClassloader second.

Author:
dberry
  • Method Details

    • getResourceAsStream

      public static InputStream getResourceAsStream(String name)
      Loads a classpath resource, first via this class's own classloader, then falling back to the current thread's context classloader.
      Parameters:
      name - the resource name to load
      Returns:
      an open stream for the resource, or null if it could not be found by either classloader
    • forName

      public static Class<?> forName(String className) throws ClassNotFoundException
      Loads a class by name, first via the normal Class.forName(String) lookup, then falling back to the current thread's context classloader.
      Parameters:
      className - the fully qualified name of the class to load
      Returns:
      the loaded Class
      Throws:
      ClassNotFoundException - if the class could not be found by either classloader