Package org.apache.camel.impl

Examples of org.apache.camel.impl.DefaultPackageScanClassResolver


        return delegate;
    }

    protected DefaultTypeConverter createRegistry() {
        // base the osgi type converter on the default type converter
        DefaultTypeConverter answer = new DefaultTypeConverter(new DefaultPackageScanClassResolver() {
            @Override
            public Set<ClassLoader> getClassLoaders() {
                // we don't need any classloaders as we use osgi service tracker instead
                return Collections.emptySet();
            }
View Full Code Here


        return delegate;
    }

    protected DefaultTypeConverter createRegistry() {
        // base the osgi type converter on the default type converter
        DefaultTypeConverter answer = new DefaultTypeConverter(new DefaultPackageScanClassResolver() {
            @Override
            public Set<ClassLoader> getClassLoaders() {
                // we don't need any classloaders as we use osgi service tracker instead
                return Collections.emptySet();
            }
View Full Code Here

        return delegate;
    }

    protected DefaultTypeConverter createRegistry() {
        // base the osgi type converter on the default type converter
        DefaultTypeConverter answer = new DefaultTypeConverter(new DefaultPackageScanClassResolver() {
            @Override
            public Set<ClassLoader> getClassLoaders() {
                // we don't need any classloaders as we use osgi service tracker instead
                return Collections.emptySet();
            }
View Full Code Here

        }
        return registry;
    }

    protected DefaultTypeConverter createRegistry() {
        DefaultTypeConverter reg = new DefaultTypeConverter(new DefaultPackageScanClassResolver() {
            @Override
            public Set<ClassLoader> getClassLoaders() {
                return Collections.emptySet();
            }
        }, injector, null);
View Full Code Here

    // this allows us to use Camel's property replacement via ref:{{jndiName}} - actually (ref:%7B%7BjndiName%7D%7D)
    camelContext = new DefaultCamelContext(new JndiRegistry(jndiContext));
    // we need to disable JMX so we don't depend on Spring classes
    camelContext.disableJMX();
    // configure correct classloading
    DefaultPackageScanClassResolver packageScanClassResolver = null;
    if (isAS4) {
                    packageScanClassResolver = (DefaultPackageScanClassResolver) camelContext.getPackageScanClassResolver();
                    if (packageScanClassResolver == null) {
                            packageScanClassResolver = new DefaultPackageScanClassResolver();
                            camelContext.setPackageScanClassResolver(packageScanClassResolver);
                    }
    } else if (isAS5) {
      // JBossESB on AS5+ needs this to handle VFS classloading URIs.
      // JBossESB on AS4 will not work if we use this.
      packageScanClassResolver = new JBossPackageScanClassResolver();
      camelContext.setPackageScanClassResolver(packageScanClassResolver);
    } else if (isAS6) {      
        try {
            Class c = Class.forName(AS6_CLASS_RESOLVER);
            Constructor con = c.getConstructor();
            packageScanClassResolver= (DefaultPackageScanClassResolver) con.newInstance();
                        camelContext.setPackageScanClassResolver(packageScanClassResolver);           
        } catch (InstantiationException e) {
            throw new ManagedLifecycleException(e);
        } catch (ClassNotFoundException e) {
                        throw new ManagedLifecycleException(e);
                    } catch (SecurityException e) {
                        throw new ManagedLifecycleException(e);
                    } catch (NoSuchMethodException e) {
                        throw new ManagedLifecycleException(e);
                    } catch (IllegalArgumentException e) {
                        throw new ManagedLifecycleException(e);
                    } catch (IllegalAccessException e) {
                        throw new ManagedLifecycleException(e);
                    } catch (InvocationTargetException e) {
                        throw new ManagedLifecycleException(e);
                    }
               
                    camelContext.setPackageScanClassResolver(packageScanClassResolver);       
    }
    Set<ClassLoader> classLoaders = new HashSet<ClassLoader>();
    classLoaders.add(Thread.currentThread().getContextClassLoader());
    packageScanClassResolver.setClassLoaders(classLoaders);
    // register JndiTypeConverters
    Set<Class<?>> jndiTypes = new HashSet<Class<?>>();
    jndiTypes.add(ConnectionFactory.class);
    jndiTypes.add(DataSource.class);
    // TODO: add classes from comma-separated config property for more jndiTypes that get looked up?
View Full Code Here

public class ModelSanityCheckerTest extends TestCase {

    private static final Logger LOG = LoggerFactory.getLogger(ModelSanityCheckerTest.class);

    private Set<Class<?>> discoverJaxbClasses() {
        PackageScanClassResolver resolver = new DefaultPackageScanClassResolver();
        String[] packages = Constants.JAXB_CONTEXT_PACKAGES.split(":");
        return resolver.findAnnotated(XmlAccessorType.class, packages);
    }
View Full Code Here

    protected TypeConverter converter;

    @Before
    public void init() throws Exception {
        converter = new DefaultTypeConverter(new DefaultPackageScanClassResolver(),
                new ReflectionInjector(), new DefaultFactoryFinderResolver().resolveDefaultFactoryFinder(new DefaultClassResolver()));
        ServiceHelper.startService(converter);
    }
View Full Code Here

    private Set<Class<? extends Annotation>> annotations = new HashSet<Class<? extends Annotation>>();
    private String scanPackage = "org.apache.camel.impl.scan.test";

    public void setUp() throws Exception {
        super.setUp();
        resolver = new DefaultPackageScanClassResolver();
        annotations.add(ScannableOne.class);
        annotations.add(ScannableTwo.class);
    }
View Full Code Here

    }

    protected DefaultTypeConverter createRegistry() {
        // base the osgi type converter on the default type converter
        // TODO: Why is it based on the DefaultPackageScanClassResolver and not OsgiPackageScanClassResolver?
        DefaultTypeConverter reg = new DefaultTypeConverter(new DefaultPackageScanClassResolver() {
            @Override
            public Set<ClassLoader> getClassLoaders() {
                return Collections.emptySet();
            }
        }, injector, null);
View Full Code Here

        return delegate;
    }

    protected DefaultTypeConverter createRegistry() {
        // base the osgi type converter on the default type converter
        DefaultTypeConverter answer = new DefaultTypeConverter(new DefaultPackageScanClassResolver() {
            @Override
            public Set<ClassLoader> getClassLoaders() {
                // we don't need any classloaders as we use osgi service tracker instead
                return Collections.emptySet();
            }
View Full Code Here

TOP

Related Classes of org.apache.camel.impl.DefaultPackageScanClassResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.