2012-07-15 14:12:03 +02:00
|
|
|
package docs.camel;
|
|
|
|
|
|
|
|
|
|
import akka.actor.ActorSystem;
|
|
|
|
|
import akka.camel.Camel;
|
|
|
|
|
import akka.camel.CamelExtension;
|
|
|
|
|
import org.apache.camel.CamelContext;
|
|
|
|
|
import org.apache.camel.ProducerTemplate;
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
|
|
|
|
|
public class CamelExtensionTestBase {
|
|
|
|
|
@Test
|
|
|
|
|
public void getCamelExtension() {
|
|
|
|
|
//#CamelExtension
|
|
|
|
|
ActorSystem system = ActorSystem.create("some-system");
|
|
|
|
|
Camel camel = CamelExtension.get(system);
|
2012-07-23 01:36:12 +02:00
|
|
|
CamelContext camelContext = camel.context();
|
2012-07-15 14:12:03 +02:00
|
|
|
ProducerTemplate producerTemplate = camel.template();
|
|
|
|
|
//#CamelExtension
|
|
|
|
|
system.shutdown();
|
|
|
|
|
}
|
|
|
|
|
public void addActiveMQComponent() {
|
|
|
|
|
//#CamelExtensionAddComponent
|
|
|
|
|
ActorSystem system = ActorSystem.create("some-system");
|
|
|
|
|
Camel camel = CamelExtension.get(system);
|
2012-07-23 01:36:12 +02:00
|
|
|
CamelContext camelContext = camel.context();
|
2012-10-01 20:35:19 +02:00
|
|
|
// camelContext.addComponent("activemq", ActiveMQComponent.activeMQComponent(
|
|
|
|
|
// "vm://localhost?broker.persistent=false"));
|
2012-07-15 14:12:03 +02:00
|
|
|
//#CamelExtensionAddComponent
|
|
|
|
|
system.shutdown();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|