org.hibernate.osgi
Class OsgiClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by org.hibernate.osgi.OsgiClassLoader

public class OsgiClassLoader
extends ClassLoader

Custom OSGI ClassLoader helper which knows all the "interesting" class loaders and bundles. Encapsulates the OSGi related CL capabilities.


Constructor Summary
OsgiClassLoader()
           
 
Method Summary
 void addBundle(org.osgi.framework.Bundle bundle)
           
 void addClassLoader(ClassLoader classLoader)
           
 void clear()
           
protected  Class<?> findClass(String name)
          Load the class and break on first found match.
protected  URL findResource(String name)
          Load the class and break on first found match.
protected  Enumeration<URL> findResources(String name)
          Load the class and break on first found match.
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OsgiClassLoader

public OsgiClassLoader()
Method Detail

findClass

protected Class<?> findClass(String name)
                      throws ClassNotFoundException
Load the class and break on first found match. TODO: Should this throw a different exception or warn if multiple classes were found? Naming collisions can and do happen in OSGi...

Overrides:
findClass in class ClassLoader
Throws:
ClassNotFoundException

findResource

protected URL findResource(String name)
Load the class and break on first found match. TODO: Should this throw a different exception or warn if multiple classes were found? Naming collisions can and do happen in OSGi...

Overrides:
findResource in class ClassLoader

findResources

protected Enumeration<URL> findResources(String name)
Load the class and break on first found match. Note: Since they're Enumerations, do not cache these results! TODO: Should this throw a different exception or warn if multiple classes were found? Naming collisions can and do happen in OSGi...

Overrides:
findResources in class ClassLoader

addClassLoader

public void addClassLoader(ClassLoader classLoader)

addBundle

public void addBundle(org.osgi.framework.Bundle bundle)

clear

public void clear()


Copyright © 2001-2015 Red Hat, Inc. All Rights Reserved.