org.apache.camel.core.osgi
Class OsgiClassResolver

java.lang.Object
  extended by org.apache.camel.impl.DefaultClassResolver
      extended by org.apache.camel.core.osgi.OsgiClassResolver
All Implemented Interfaces:
ClassResolver

public class OsgiClassResolver
extends DefaultClassResolver


Field Summary
 org.osgi.framework.BundleContext bundleContext
           
 
Constructor Summary
OsgiClassResolver(org.osgi.framework.BundleContext context)
           
 
Method Summary
protected  Class<?> doLoadClass(String name, org.osgi.framework.Bundle loader)
           
 InputStream loadResourceAsStream(String uri)
          Loads the given resource as a stream
 URL loadResourceAsURL(String uri)
          Loads the given resource as a URL
 Class<?> resolveClass(String name)
          Resolves the given class by its name
<T> Class<T>
resolveClass(String name, Class<T> type)
          Resolves the given class by its name
 
Methods inherited from class org.apache.camel.impl.DefaultClassResolver
loadClass, resolveClass, resolveClass, resolveMandatoryClass, resolveMandatoryClass, resolveMandatoryClass, resolveMandatoryClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bundleContext

public org.osgi.framework.BundleContext bundleContext
Constructor Detail

OsgiClassResolver

public OsgiClassResolver(org.osgi.framework.BundleContext context)
Method Detail

resolveClass

public Class<?> resolveClass(String name)
Description copied from interface: ClassResolver
Resolves the given class by its name

Specified by:
resolveClass in interface ClassResolver
Overrides:
resolveClass in class DefaultClassResolver
Parameters:
name - full qualified name of class
Returns:
the class if resolved, null if not found.

resolveClass

public <T> Class<T> resolveClass(String name,
                                 Class<T> type)
Description copied from interface: ClassResolver
Resolves the given class by its name

Specified by:
resolveClass in interface ClassResolver
Overrides:
resolveClass in class DefaultClassResolver
Parameters:
name - full qualified name of class
type - the expected type of the class
Returns:
the class if resolved, null if not found.

loadResourceAsStream

public InputStream loadResourceAsStream(String uri)
Description copied from interface: ClassResolver
Loads the given resource as a stream

Specified by:
loadResourceAsStream in interface ClassResolver
Overrides:
loadResourceAsStream in class DefaultClassResolver
Parameters:
uri - the uri of the resource
Returns:
as a stream

loadResourceAsURL

public URL loadResourceAsURL(String uri)
Description copied from interface: ClassResolver
Loads the given resource as a URL

Specified by:
loadResourceAsURL in interface ClassResolver
Overrides:
loadResourceAsURL in class DefaultClassResolver
Parameters:
uri - the uri of the resource
Returns:
as a URL

doLoadClass

protected Class<?> doLoadClass(String name,
                               org.osgi.framework.Bundle loader)


Copyright © 2007-2010 IONA Open Source Community. All Rights Reserved.