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" bundles and encapsulates the OSGi related capabilities.


Constructor Summary
OsgiClassLoader()
           
 
Method Summary
 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.
protected static String getBundleKey(org.osgi.framework.Bundle bundle)
           
 void registerBundle(org.osgi.framework.Bundle bundle)
          Register the bundle with this class loader
 void unregisterBundle(org.osgi.framework.Bundle bundle)
          Unregister the bundle from this class loader
 
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. 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

registerBundle

public void registerBundle(org.osgi.framework.Bundle bundle)
Register the bundle with this class loader


unregisterBundle

public void unregisterBundle(org.osgi.framework.Bundle bundle)
Unregister the bundle from this class loader


clear

public void clear()

getBundleKey

protected static String getBundleKey(org.osgi.framework.Bundle bundle)


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