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();
}
use of org.apache.camel.spring.SpringCamelContext in project wildfly-camel by wildfly-extras.
the class SpringIntegrationProducerTest method testSendingOneWayMessage.
@Test
public void testSendingOneWayMessage() throws Exception {
SpringCamelContext camelctx = (SpringCamelContext) contextRegistry.getCamelContext("camel");
Assert.assertNotNull(camelctx);
ProducerTemplate template = camelctx.createProducerTemplate();
template.sendBody("direct:onewayMessage", "Greet");
HelloWorldService service = SpringUtils.getMandatoryBean(camelctx, HelloWorldService.class, "helloService");
Assert.assertEquals("We should call the service", service.getGreetName(), "Greet");
}
Aggregations