Pluggable Class Resolvers

Available since Camel 2.0

Camel provides pluggable class resolvers allowing third party platforms and contains to provide their own resolvers in case the default ones does not work on their platform. For example we provide a WebSpherePackageScanClassResolver out of the box in Camel to integration Camel with IBM WebSphere.

Platform providers should look in the org.apache.camel.spi package for the following pluggble resolvers:

  • PackageScanClassResolver
  • ClassResolver
  • FactoryFinderResolver

In camel-osgi we provide OSGi aware class resolver allowing Camel to run in any OSGi container.

Configuration of a custom class resolver

To instruct Camel to use your own custom class resolver you set the resolver on the CamelContext using the appropriate setters.

Easy configuration in Spring XML

We have provided easy configuration in Spring XML as you just need to declare a spring bean with your custom resolver and Camel will pick it up automatically.

In the sample above the CamelContext will automatic detect the jbossresolver bean and use it instead of its default one.

FactoryFinderResolver

FactoryFinderResolver is used to get an instance of FactoryFinder that is used for lookup of resource files in the classpath in the META-INF/services. It is used internally by Camel to look in .jars for Camel components. For instance to look for the file component Camel will use the FactoryFinder to look the the file named file in META-INF/services/org/apache/camel/component. The CamelContext have methods to inject a custom FactoryFinderResolver.

Easy configuration in Spring XML

We have provided easy configuration in Spring XML as you just need to declare a spring bean with your custom factory finder resolver and Camel will pick it up automatically.

Using Camel with JBoss

See more at camel-jboss for a class resolver which works with JBoss and how to use it.

Using Camel with Eclipse RCP

See more at camel-eclipse for a class resolver which works with Eclipse RCP and how to use it.

© 2004-2014 The Apache Software Foundation.
Apache Camel, Camel, Apache, the Apache feather logo, and the Apache Camel project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
Graphic Design By Hiram