Search in sources :

Example 1 with OsgiTypeConverter

use of org.apache.camel.core.osgi.OsgiTypeConverter in project camel by apache.

the class OsgiSpringCamelContext method createTypeConverter.

@Override
protected TypeConverter createTypeConverter() {
    // CAMEL-3614: make sure we use a bundle context which imports org.apache.camel.impl.converter package
    BundleContext ctx = BundleContextUtils.getBundleContext(getClass());
    if (ctx == null) {
        ctx = bundleContext;
    }
    FactoryFinder finder = new OsgiFactoryFinderResolver(bundleContext).resolveDefaultFactoryFinder(getClassResolver());
    return new OsgiTypeConverter(ctx, this, getInjector(), finder);
}
Also used : OsgiFactoryFinderResolver(org.apache.camel.core.osgi.OsgiFactoryFinderResolver) OsgiTypeConverter(org.apache.camel.core.osgi.OsgiTypeConverter) FactoryFinder(org.apache.camel.spi.FactoryFinder) BundleContext(org.osgi.framework.BundleContext)

Example 2 with OsgiTypeConverter

use of org.apache.camel.core.osgi.OsgiTypeConverter in project camel by apache.

the class BlueprintCamelContext method createTypeConverter.

@Override
protected TypeConverter createTypeConverter() {
    // CAMEL-3614: make sure we use a bundle context which imports org.apache.camel.impl.converter package
    BundleContext ctx = BundleContextUtils.getBundleContext(getClass());
    if (ctx == null) {
        ctx = bundleContext;
    }
    FactoryFinder finder = new OsgiFactoryFinderResolver(bundleContext).resolveDefaultFactoryFinder(getClassResolver());
    return new OsgiTypeConverter(ctx, this, getInjector(), finder);
}
Also used : OsgiFactoryFinderResolver(org.apache.camel.core.osgi.OsgiFactoryFinderResolver) OsgiTypeConverter(org.apache.camel.core.osgi.OsgiTypeConverter) FactoryFinder(org.apache.camel.spi.FactoryFinder) BundleContext(org.osgi.framework.BundleContext)

Aggregations

OsgiFactoryFinderResolver (org.apache.camel.core.osgi.OsgiFactoryFinderResolver)2 OsgiTypeConverter (org.apache.camel.core.osgi.OsgiTypeConverter)2 FactoryFinder (org.apache.camel.spi.FactoryFinder)2 BundleContext (org.osgi.framework.BundleContext)2