removed deprecation warnings from akka-samples
This commit is contained in:
parent
8a2e522a6e
commit
1f87f9e90e
8 changed files with 9 additions and 9 deletions
|
|
@ -9,8 +9,8 @@ import org.apache.camel.{ Exchange }
|
|||
object AsyncRouteAndTransform extends App {
|
||||
val system = ActorSystem("rewriteAkkaToAKKA")
|
||||
val httpTransformer = system.actorOf(Props[HttpTransformer], "transformer")
|
||||
val httpProducer = system.actorOf(Props(new HttpProducer(httpTransformer)), "producer")
|
||||
val httpConsumer = system.actorOf(Props(new HttpConsumer(httpProducer)), "consumer")
|
||||
val httpProducer = system.actorOf(Props(classOf[HttpProducer], httpTransformer), "producer")
|
||||
val httpConsumer = system.actorOf(Props(classOf[HttpConsumer], httpProducer), "consumer")
|
||||
}
|
||||
|
||||
class HttpConsumer(producer: ActorRef) extends Consumer {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ object SimpleFileConsumer extends App {
|
|||
val tmpDirUri = "file://%s/%s" format (tmpDir, subDir)
|
||||
|
||||
val system = ActorSystem("consume-files")
|
||||
val fileConsumer = system.actorOf(Props(new FileConsumer(tmpDirUri)), "fileConsumer")
|
||||
val fileConsumer = system.actorOf(Props(classOf[FileConsumer], tmpDirUri), "fileConsumer")
|
||||
println(String.format("Put a text file in '%s', the consumer will pick it up!", consumeDir))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ object DiningHakkers {
|
|||
//Create 5 awesome hakkers and assign them their left and right chopstick
|
||||
val hakkers = for {
|
||||
(name, i) ← List("Ghosh", "Boner", "Klang", "Krasser", "Manie").zipWithIndex
|
||||
} yield system.actorOf(Props(new Hakker(name, chopsticks(i), chopsticks((i + 1) % 5))))
|
||||
} yield system.actorOf(Props(classOf[Hakker], name, chopsticks(i), chopsticks((i + 1) % 5)))
|
||||
|
||||
//Signal all hakkers that they should start thinking, and watch the show
|
||||
hakkers.foreach(_ ! Think)
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ object DiningHakkersOnFsm {
|
|||
// Create 5 awesome fsm hakkers and assign them their left and right chopstick
|
||||
val hakkers = for {
|
||||
(name, i) ← List("Ghosh", "Boner", "Klang", "Krasser", "Manie").zipWithIndex
|
||||
} yield system.actorOf(Props(new FSMHakker(name, chopsticks(i), chopsticks((i + 1) % 5))))
|
||||
} yield system.actorOf(Props(classOf[FSMHakker], name, chopsticks(i), chopsticks((i + 1) % 5)))
|
||||
|
||||
hakkers.foreach(_ ! Think)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,6 @@ import akka.sample.osgi.internal.Hakker
|
|||
|
||||
class DiningHakkersServiceImpl(system: ActorSystem) extends DiningHakkersService {
|
||||
def getHakker(name: String, chairNumber: Int) = {
|
||||
system.actorOf(Props(new Hakker(name, chairNumber)))
|
||||
system.actorOf(Props(classOf[Hakker], name, chairNumber))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ java.io.EOFException
|
|||
}
|
||||
}
|
||||
|
||||
hakker.tell(Identify, actorSystem.actorOf(Props(new Interrogator()), "Interrogator"))
|
||||
hakker.tell(Identify, actorSystem.actorOf(Props[Interrogator], "Interrogator"))
|
||||
val (fromHakker, busyWith) = response.poll(5, TimeUnit.SECONDS)
|
||||
|
||||
println("---------------> %s is busy with %s.".format(fromHakker, busyWith))
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class CreationApplication extends Bootable {
|
|||
ActorSystem("RemoteCreation", ConfigFactory.load.getConfig("remotecreation"))
|
||||
val remoteActor = system.actorOf(Props[AdvancedCalculatorActor],
|
||||
name = "advancedCalculator")
|
||||
val localActor = system.actorOf(Props(new CreationActor(remoteActor)),
|
||||
val localActor = system.actorOf(Props(classOf[CreationActor], remoteActor),
|
||||
name = "creationActor")
|
||||
|
||||
def doSomething(op: MathOp): Unit =
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class LookupApplication extends Bootable {
|
|||
ActorSystem("LookupApplication", ConfigFactory.load.getConfig("remotelookup"))
|
||||
val remotePath =
|
||||
"akka.tcp://CalculatorApplication@127.0.0.1:2552/user/simpleCalculator"
|
||||
val actor = system.actorOf(Props(new LookupActor(remotePath)), "lookupActor")
|
||||
val actor = system.actorOf(Props(classOf[LookupActor], remotePath), "lookupActor")
|
||||
|
||||
def doSomething(op: MathOp): Unit =
|
||||
actor ! op
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue