Java 类org.apache.camel.core.xml.AbstractCamelContextFactoryBean 实例源码

项目:Camel    文件:BlueprintModelJAXBContextFactory.java   
private String getPackages() {
    // we nedd to have a class from each different package with jaxb models
    // and we must use the .class for the classloader to work in OSGi
    Set<Class<?>> classes = new LinkedHashSet<Class<?>>();
    classes.add(CamelContextFactoryBean.class);
    classes.add(AbstractCamelContextFactoryBean.class);
    classes.add(SSLContextParametersFactoryBean.class);
    classes.add(org.apache.camel.ExchangePattern.class);
    classes.add(org.apache.camel.model.RouteDefinition.class);
    classes.add(org.apache.camel.model.config.StreamResequencerConfig.class);
    classes.add(org.apache.camel.model.dataformat.DataFormatsDefinition.class);
    classes.add(org.apache.camel.model.language.ExpressionDefinition.class);
    classes.add(org.apache.camel.model.loadbalancer.RoundRobinLoadBalancerDefinition.class);
    classes.add(org.apache.camel.model.rest.RestDefinition.class);

    StringBuilder packages = new StringBuilder();
    for (Class<?> cl : classes) {
        if (packages.length() > 0) {
            packages.append(":");
        }
        packages.append(cl.getName().substring(0, cl.getName().lastIndexOf('.')));
    }
    return packages.toString();
}
项目:Camel    文件:SpringTestSupport.java   
@SuppressWarnings("deprecation")
@Override
protected void setUp() throws Exception {
    if (isLazyLoadingTypeConverter()) {
        System.setProperty(AbstractCamelContextFactoryBean.LAZY_LOAD_TYPE_CONVERTERS, "true");
    } else {
        System.setProperty(AbstractCamelContextFactoryBean.LAZY_LOAD_TYPE_CONVERTERS, "false");
    }

    applicationContext = createApplicationContext();
    assertNotNull("Should have created a valid spring context", applicationContext);
    super.setUp();
}