Move all doc examples out of the akka-package to avoid use of private APIs. See #2092

This commit is contained in:
Patrik Nordwall 2012-05-22 11:37:09 +02:00
parent 09469b73e1
commit 0eae9d8d22
85 changed files with 105 additions and 105 deletions

View file

@ -0,0 +1,54 @@
package docs.camel
object Introduction {
{
//#Consumer-mina
import akka.camel.{ CamelMessage, Consumer }
class MinaClient extends Consumer {
def endpointUri = "mina:tcp://localhost:6200?textline=true"
def receive = {
case msg: CamelMessage { /* ... */ }
case _ { /* ... */ }
}
}
// start and expose actor via tcp
import akka.actor.{ ActorSystem, Props }
val sys = ActorSystem("camel")
val mina = sys.actorOf(Props[MinaClient])
//#Consumer-mina
}
{
//#Consumer
import akka.camel.{ CamelMessage, Consumer }
class JettyAdapter extends Consumer {
def endpointUri = "jetty:http://localhost:8877/example"
def receive = {
case msg: CamelMessage { /* ... */ }
case _ { /* ... */ }
}
}
//#Consumer
}
{
//#Producer
import akka.actor.Actor
import akka.camel.{ Producer, Oneway }
import akka.actor.{ ActorSystem, Props }
class Orders extends Actor with Producer with Oneway {
def endpointUri = "jms:queue:Orders"
}
val sys = ActorSystem("camel")
val orders = sys.actorOf(Props[Orders])
orders ! <order amount="100" currency="PLN" itemId="12345"/>
//#Producer
}
}