use of org.apache.camel.spring.SpringCamelContext in project camel by apache.
the class JavaSpaceTransportSendReceiveTest method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
spring = new ClassPathXmlApplicationContext("org/apache/camel/component/javaspace/spring.xml");
SpringCamelContext ctx = SpringCamelContext.springCamelContext(spring);
return ctx;
}
use of org.apache.camel.spring.SpringCamelContext in project camel by apache.
the class AbstractMongoDbTest method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
applicationContext = new AnnotationConfigApplicationContext(EmbedMongoConfiguration.class);
CamelContext ctx = new SpringCamelContext(applicationContext);
PropertiesComponent pc = new PropertiesComponent("classpath:mongodb.test.properties");
ctx.addComponent("properties", pc);
return ctx;
}
use of org.apache.camel.spring.SpringCamelContext in project camel by apache.
the class SpelExpression method createEvaluationContext.
private EvaluationContext createEvaluationContext(Exchange exchange) {
StandardEvaluationContext evaluationContext = new StandardEvaluationContext(new RootObject(exchange));
if (exchange.getContext() instanceof SpringCamelContext) {
// Support references (like @foo) in expressions to beans defined in the Registry/ApplicationContext
ApplicationContext applicationContext = ((SpringCamelContext) exchange.getContext()).getApplicationContext();
evaluationContext.setBeanResolver(new BeanFactoryResolver(applicationContext));
}
return evaluationContext;
}
use of org.apache.camel.spring.SpringCamelContext in project camel by apache.
the class CxfEndpointUtils method createBus.
/**
* Create a CXF bus with either BusFactory or SpringBusFactory if Camel Context
* is SpringCamelContext. In the latter case, this method updates the bus
* configuration with the applicationContext which SpringCamelContext holds
*
* @param context - the Camel Context
*/
public static Bus createBus(CamelContext context) {
BusFactory busFactory = BusFactory.newInstance();
if (context instanceof SpringCamelContext) {
SpringCamelContext springCamelContext = (SpringCamelContext) context;
ApplicationContext applicationContext = springCamelContext.getApplicationContext();
busFactory = new SpringBusFactory(applicationContext);
}
return busFactory.createBus();
}
use of org.apache.camel.spring.SpringCamelContext in project bamboobsc by billchen198318.
the class TestHelloCamelStartForContextInitialized method execute.
@Override
public void execute(ServletContextEvent event) throws Exception {
CamelContext context = new SpringCamelContext(AppContext.getApplicationContext());
context.start();
}
Aggregations