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 two pluggble resolvers:
PackageScanClassResolver
ClassResolver
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.
<bean id="jbossresolver" class="com.mycompany.jboss.JBossPackageScanClassResolver"/> <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="seda:start"/> <to uri="mock:result"/> </route> </camelContext>
In the sample above the CamelContext will automatic detect the jbossresolver
bean and use it instead of its default one.