2012-06-26 10:43:31 +02:00
|
|
|
package docs.camel
|
|
|
|
|
|
|
|
|
|
object QuartzExample {
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
//#Quartz
|
2012-07-12 15:00:11 +02:00
|
|
|
import akka.actor.{ ActorSystem, Props }
|
2012-06-26 10:43:31 +02:00
|
|
|
|
2012-07-12 15:00:11 +02:00
|
|
|
import akka.camel.{ Consumer }
|
2012-06-26 10:43:31 +02:00
|
|
|
|
|
|
|
|
class MyQuartzActor extends Consumer {
|
|
|
|
|
|
|
|
|
|
def endpointUri = "quartz://example?cron=0/2+*+*+*+*+?"
|
|
|
|
|
|
|
|
|
|
def receive = {
|
|
|
|
|
|
2012-07-12 15:00:11 +02:00
|
|
|
case msg ⇒ println("==============> received %s " format msg)
|
2012-06-26 10:43:31 +02:00
|
|
|
|
|
|
|
|
} // end receive
|
|
|
|
|
|
|
|
|
|
} // end MyQuartzActor
|
|
|
|
|
|
|
|
|
|
object MyQuartzActor {
|
|
|
|
|
|
|
|
|
|
def main(str: Array[String]) {
|
|
|
|
|
val system = ActorSystem("my-quartz-system")
|
|
|
|
|
system.actorOf(Props[MyQuartzActor])
|
|
|
|
|
} // end main
|
|
|
|
|
|
|
|
|
|
} // end MyQuartzActor
|
|
|
|
|
//#Quartz
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|