diff --git a/akka-amqp/src/main/scala/AMQP.scala b/akka-amqp/src/main/scala/AMQP.scala index 84f52088e7..96d6584df1 100644 --- a/akka-amqp/src/main/scala/AMQP.scala +++ b/akka-amqp/src/main/scala/AMQP.scala @@ -94,7 +94,7 @@ object AMQP { returnListener: Option[ReturnListener], shutdownListener: Option[ShutdownListener], initReconnectDelay: Long): ActorRef = { - val producer = newActor(() => new Producer( + val producer = actorOf( new Producer( new ConnectionFactory(config), hostname, port, exchangeName, @@ -117,7 +117,7 @@ object AMQP { durable: Boolean, autoDelete: Boolean, configurationArguments: Map[String, AnyRef]): ActorRef = { - val consumer = newActor(() => new Consumer( + val consumer = actorOf( new Consumer( new ConnectionFactory(config), hostname, port, exchangeName, diff --git a/akka-camel/src/main/scala/service/CamelService.scala b/akka-camel/src/main/scala/service/CamelService.scala index 42cae6f44f..fbd1a4cb93 100644 --- a/akka-camel/src/main/scala/service/CamelService.scala +++ b/akka-camel/src/main/scala/service/CamelService.scala @@ -21,7 +21,7 @@ trait CamelService extends Bootable with Logging { import CamelContextManager._ private[camel] val consumerPublisher = newActor[ConsumerPublisher] - private[camel] val publishRequestor = newActor(() => new PublishRequestor(consumerPublisher)) + private[camel] val publishRequestor = actorOf(new PublishRequestor(consumerPublisher)) /** * Starts the CamelService. Any started actor that is a consumer actor will be (asynchronously) diff --git a/akka-camel/src/test/scala/ProducerFeatureTest.scala b/akka-camel/src/test/scala/ProducerFeatureTest.scala index fdd14edda3..acba99fde9 100644 --- a/akka-camel/src/test/scala/ProducerFeatureTest.scala +++ b/akka-camel/src/test/scala/ProducerFeatureTest.scala @@ -36,7 +36,7 @@ class ProducerFeatureTest extends FeatureSpec with BeforeAndAfterAll with Before scenario("produce message sync and receive response") { given("a registered synchronous two-way producer for endpoint direct:producer-test-2") - val producer = newActor(() => new TestProducer("direct:producer-test-2") with Sync) + val producer = actorOf(new TestProducer("direct:producer-test-2") with Sync) producer.start when("a test message is sent to the producer") @@ -50,7 +50,7 @@ class ProducerFeatureTest extends FeatureSpec with BeforeAndAfterAll with Before scenario("produce message async and receive response") { given("a registered asynchronous two-way producer for endpoint direct:producer-test-2") - val producer = newActor(() => new TestProducer("direct:producer-test-2")) + val producer = actorOf(new TestProducer("direct:producer-test-2")) producer.start when("a test message is sent to the producer") @@ -64,7 +64,7 @@ class ProducerFeatureTest extends FeatureSpec with BeforeAndAfterAll with Before scenario("produce message sync and receive failure") { given("a registered synchronous two-way producer for endpoint direct:producer-test-2") - val producer = newActor(() => new TestProducer("direct:producer-test-2") with Sync) + val producer = actorOf(new TestProducer("direct:producer-test-2") with Sync) producer.start when("a fail message is sent to the producer") @@ -80,7 +80,7 @@ class ProducerFeatureTest extends FeatureSpec with BeforeAndAfterAll with Before scenario("produce message async and receive failure") { given("a registered asynchronous two-way producer for endpoint direct:producer-test-2") - val producer = newActor(() => new TestProducer("direct:producer-test-2")) + val producer = actorOf(new TestProducer("direct:producer-test-2")) producer.start when("a fail message is sent to the producer") @@ -96,7 +96,7 @@ class ProducerFeatureTest extends FeatureSpec with BeforeAndAfterAll with Before scenario("produce message sync oneway") { given("a registered synchronous one-way producer for endpoint direct:producer-test-1") - val producer = newActor(() => new TestProducer("direct:producer-test-1") with Sync with Oneway) + val producer = actorOf(new TestProducer("direct:producer-test-1") with Sync with Oneway) producer.start when("a test message is sent to the producer") @@ -109,7 +109,7 @@ class ProducerFeatureTest extends FeatureSpec with BeforeAndAfterAll with Before scenario("produce message async oneway") { given("a registered asynchronous one-way producer for endpoint direct:producer-test-1") - val producer = newActor(() => new TestProducer("direct:producer-test-1") with Oneway) + val producer = actorOf(new TestProducer("direct:producer-test-1") with Oneway) producer.start when("a test message is sent to the producer") diff --git a/akka-camel/src/test/scala/component/ActorProducerTest.scala b/akka-camel/src/test/scala/component/ActorProducerTest.scala index 5f7059295f..93f69d5255 100644 --- a/akka-camel/src/test/scala/component/ActorProducerTest.scala +++ b/akka-camel/src/test/scala/component/ActorProducerTest.scala @@ -18,7 +18,7 @@ class ActorProducerTest extends JUnitSuite with BeforeAndAfterAll { @After def tearDown = ActorRegistry.shutdownAll @Test def shouldSendMessageToActor = { - val actor = newActor(() => new Tester with Retain with Countdown[Message]) + val actor = actorOf(new Tester with Retain with Countdown[Message]) val endpoint = mockEndpoint("actor:uuid:%s" format actor.uuid) val exchange = endpoint.createExchange(ExchangePattern.InOnly) actor.start @@ -31,7 +31,7 @@ class ActorProducerTest extends JUnitSuite with BeforeAndAfterAll { } @Test def shouldSendMessageToActorAndReceiveResponse = { - val actor = newActor(() => new Tester with Respond { + val actor = actorOf(new Tester with Respond { override def response(msg: Message) = Message(super.response(msg), Map("k2" -> "v2")) }) val endpoint = mockEndpoint("actor:uuid:%s" format actor.uuid) @@ -45,7 +45,7 @@ class ActorProducerTest extends JUnitSuite with BeforeAndAfterAll { } @Test def shouldSendMessageToActorAndReceiveFailure = { - val actor = newActor(() => new Tester with Respond { + val actor = actorOf(new Tester with Respond { override def response(msg: Message) = Failure(new Exception("testmsg"), Map("k3" -> "v3")) }) val endpoint = mockEndpoint("actor:uuid:%s" format actor.uuid) @@ -60,7 +60,7 @@ class ActorProducerTest extends JUnitSuite with BeforeAndAfterAll { } @Test def shouldSendMessageToActorAndTimeout: Unit = { - val actor = newActor(() => new Tester { + val actor = actorOf(new Tester { timeout = 1 }) val endpoint = mockEndpoint("actor:uuid:%s" format actor.uuid) diff --git a/akka-camel/src/test/scala/service/CamelServiceFeatureTest.scala b/akka-camel/src/test/scala/service/CamelServiceFeatureTest.scala index b876fe14c8..951ce21fe8 100644 --- a/akka-camel/src/test/scala/service/CamelServiceFeatureTest.scala +++ b/akka-camel/src/test/scala/service/CamelServiceFeatureTest.scala @@ -38,7 +38,7 @@ class CamelServiceFeatureTest extends FeatureSpec with BeforeAndAfterAll with Gi override protected def beforeAll = { ActorRegistry.shutdownAll // register test consumer before starting the CamelService - newActor(() => new TestConsumer("direct:publish-test-1")).start + actorOf(new TestConsumer("direct:publish-test-1")).start // Consigure a custom camel route CamelContextManager.init CamelContextManager.context.addRoutes(new TestRoute) @@ -61,7 +61,7 @@ class CamelServiceFeatureTest extends FeatureSpec with BeforeAndAfterAll with Gi given("two consumer actors registered before and after CamelService startup") service.consumerPublisher.actor.asInstanceOf[ConsumerPublisher].expectPublishCount(1) - newActor(() => new TestConsumer("direct:publish-test-2")).start + actorOf(new TestConsumer("direct:publish-test-2")).start when("requests are sent to these actors") service.consumerPublisher.actor.asInstanceOf[ConsumerPublisher].awaitPublish diff --git a/akka-camel/src/test/scala/service/PublishRequestorTest.scala b/akka-camel/src/test/scala/service/PublishRequestorTest.scala index 59e9696ee4..985f18f142 100644 --- a/akka-camel/src/test/scala/service/PublishRequestorTest.scala +++ b/akka-camel/src/test/scala/service/PublishRequestorTest.scala @@ -24,12 +24,12 @@ class PublishRequestorTest extends JUnitSuite { @After def tearDown = ActorRegistry.shutdownAll @Test def shouldReceivePublishRequestOnActorRegisteredEvent = { - val consumer = newActor(() => new Actor with Consumer { + val consumer = actorOf(new Actor with Consumer { def endpointUri = "mock:test" protected def receive = null }).start - val publisher = newActor(() => new PublisherMock with Countdown[Publish]) - val requestor = newActor(() => new PublishRequestor(publisher)) + val publisher = actorOf(new PublisherMock with Countdown[Publish]) + val requestor = actorOf(new PublishRequestor(publisher)) publisher.start requestor.start requestor.!(ActorRegistered(consumer))(None) diff --git a/akka-core/src/main/scala/actor/Actor.scala b/akka-core/src/main/scala/actor/Actor.scala index c82a0dce0a..a39898879a 100644 --- a/akka-core/src/main/scala/actor/Actor.scala +++ b/akka-core/src/main/scala/actor/Actor.scala @@ -97,13 +97,13 @@ object Actor extends Logging { * This function should NOT be used for remote actors. *
* import Actor._
- * val actor = newActor(() => new MyActor)
+ * val actor = actorOf(new MyActor)
* actor.start
* actor ! message
* actor.stop
*
*/
- def newActor(factory: () => Actor): ActorRef = new ActorRef(factory)
+ def actorOf(factory: => Actor): ActorRef = new ActorRef(() => factory)
/**
* Use to create an anonymous event-driven actor.
@@ -288,7 +288,7 @@ object ActorRef {
*
* import Actor._
*
- * val actor = newActor(() => new MyActor(...))
+ * val actor = actorOf(new MyActor(...))
* actor.start
* actor ! message
* actor.stop
diff --git a/akka-core/src/main/scala/routing/Patterns.scala b/akka-core/src/main/scala/routing/Patterns.scala
index 258847b3fc..cf3eb079ff 100644
--- a/akka-core/src/main/scala/routing/Patterns.scala
+++ b/akka-core/src/main/scala/routing/Patterns.scala
@@ -27,7 +27,7 @@ object Patterns {
/** Creates a LoadBalancer from the thunk-supplied InfiniteIterator
*/
def loadBalancerActor(actors: => InfiniteIterator[ActorRef]): ActorRef =
- newActor(() => new Actor with LoadBalancer {
+ actorOf(new Actor with LoadBalancer {
start
val seq = actors
})
@@ -35,7 +35,7 @@ object Patterns {
/** Creates a Dispatcher given a routing and a message-transforming function
*/
def dispatcherActor(routing: PF[Any, ActorRef], msgTransformer: (Any) => Any): ActorRef =
- newActor(() => new Actor with Dispatcher {
+ actorOf(new Actor with Dispatcher {
start
override def transform(msg: Any) = msgTransformer(msg)
def routes = routing
@@ -43,7 +43,7 @@ object Patterns {
/** Creates a Dispatcher given a routing
*/
- def dispatcherActor(routing: PF[Any, ActorRef]): ActorRef = newActor(() => new Actor with Dispatcher {
+ def dispatcherActor(routing: PF[Any, ActorRef]): ActorRef = actorOf(new Actor with Dispatcher {
start
def routes = routing
})
diff --git a/akka-core/src/main/scala/stm/DataFlowVariable.scala b/akka-core/src/main/scala/stm/DataFlowVariable.scala
index 5b4826550a..8bd692b916 100644
--- a/akka-core/src/main/scala/stm/DataFlowVariable.scala
+++ b/akka-core/src/main/scala/stm/DataFlowVariable.scala
@@ -27,7 +27,7 @@ import se.scalablesolutions.akka.actor.Actor
import se.scalablesolutions.akka.dispatch.CompletableFuture
def thread(body: => Unit) = {
- val thread = newActor(() => new IsolatedEventBasedThread(body)).start
+ val thread = actorOf(new IsolatedEventBasedThread(body)).start
thread ! Start
thread
}
@@ -98,7 +98,7 @@ import se.scalablesolutions.akka.dispatch.CompletableFuture
}
}
- private[this] val in = newActor(() => new In(this))
+ private[this] val in = actorOf(new In(this))
def <<(ref: DataFlowVariable[T]) = in ! Set(ref())
@@ -108,7 +108,7 @@ import se.scalablesolutions.akka.dispatch.CompletableFuture
val ref = value.get
if (ref.isDefined) ref.get
else {
- val out = newActor(() => new Out(this))
+ val out = actorOf(new Out(this))
blockedReaders.offer(out)
val result = out !! Get
out ! Exit
diff --git a/akka-core/src/test/scala/ActorFireForgetRequestReplySpec.scala b/akka-core/src/test/scala/ActorFireForgetRequestReplySpec.scala
index 50e655d97d..9b8cffae16 100644
--- a/akka-core/src/test/scala/ActorFireForgetRequestReplySpec.scala
+++ b/akka-core/src/test/scala/ActorFireForgetRequestReplySpec.scala
@@ -48,7 +48,7 @@ class ActorFireForgetRequestReplySpec extends JUnitSuite {
state.finished.reset
val replyActor = newActor[ReplyActor]
replyActor.start
- val senderActor = newActor(() => new SenderActor(replyActor))
+ val senderActor = actorOf(new SenderActor(replyActor))
senderActor.start
senderActor ! "Init"
try { state.finished.await(1L, TimeUnit.SECONDS) }
@@ -61,7 +61,7 @@ class ActorFireForgetRequestReplySpec extends JUnitSuite {
state.finished.reset
val replyActor = newActor[ReplyActor]
replyActor.start
- val senderActor = newActor(() => new SenderActor(replyActor))
+ val senderActor = actorOf(new SenderActor(replyActor))
senderActor.start
senderActor ! "InitImplicit"
try { state.finished.await(1L, TimeUnit.SECONDS) }
diff --git a/akka-core/src/test/scala/ActorPatternsTest.scala b/akka-core/src/test/scala/ActorPatternsTest.scala
index ea49d370e4..a85d1f66c8 100644
--- a/akka-core/src/test/scala/ActorPatternsTest.scala
+++ b/akka-core/src/test/scala/ActorPatternsTest.scala
@@ -87,7 +87,7 @@ class ActorPatternsTest extends junit.framework.TestCase with Suite with MustMat
@Test def testListener = {
val latch = new CountDownLatch(2)
val num = new AtomicInteger(0)
- val i = newActor(() => new Actor with Listeners {
+ val i = actorOf(new Actor with Listeners {
def receive = listenerManagement orElse {
case "foo" => gossip("bar")
}
diff --git a/akka-core/src/test/scala/ExecutorBasedEventDrivenDispatcherActorsSpec.scala b/akka-core/src/test/scala/ExecutorBasedEventDrivenDispatcherActorsSpec.scala
index 91ba57d5c7..551e0484c2 100644
--- a/akka-core/src/test/scala/ExecutorBasedEventDrivenDispatcherActorsSpec.scala
+++ b/akka-core/src/test/scala/ExecutorBasedEventDrivenDispatcherActorsSpec.scala
@@ -39,8 +39,8 @@ class ExecutorBasedEventDrivenDispatcherActorsSpec extends JUnitSuite with MustM
@Test def slowActorShouldntBlockFastActor = {
val sFinished = new CountDownLatch(50)
val fFinished = new CountDownLatch(10)
- val s = newActor(() => new SlowActor(sFinished)).start
- val f = newActor(() => new FastActor(fFinished)).start
+ val s = actorOf(new SlowActor(sFinished)).start
+ val f = actorOf(new FastActor(fFinished)).start
// send a lot of stuff to s
for (i <- 1 to 50) {
diff --git a/akka-core/src/test/scala/ExecutorBasedEventDrivenWorkStealingDispatcherSpec.scala b/akka-core/src/test/scala/ExecutorBasedEventDrivenWorkStealingDispatcherSpec.scala
index 6ab034d8ec..4a1bf52370 100644
--- a/akka-core/src/test/scala/ExecutorBasedEventDrivenWorkStealingDispatcherSpec.scala
+++ b/akka-core/src/test/scala/ExecutorBasedEventDrivenWorkStealingDispatcherSpec.scala
@@ -57,8 +57,8 @@ class ExecutorBasedEventDrivenWorkStealingDispatcherSpec extends JUnitSuite with
@Test def fastActorShouldStealWorkFromSlowActor = {
val finishedCounter = new CountDownLatch(110)
- val slow = newActor(() => new DelayableActor("slow", 50, finishedCounter)).start
- val fast = newActor(() => new DelayableActor("fast", 10, finishedCounter)).start
+ val slow = actorOf(new DelayableActor("slow", 50, finishedCounter)).start
+ val fast = actorOf(new DelayableActor("fast", 10, finishedCounter)).start
for (i <- 1 to 100) {
// send most work to slow actor
diff --git a/akka-core/src/test/scala/InMemoryActorSpec.scala b/akka-core/src/test/scala/InMemoryActorSpec.scala
index c9380eb34f..a88e8c50c6 100644
--- a/akka-core/src/test/scala/InMemoryActorSpec.scala
+++ b/akka-core/src/test/scala/InMemoryActorSpec.scala
@@ -110,7 +110,7 @@ class InMemFailerActor extends Actor {
class InMemoryActorSpec extends JUnitSuite {
@Test
def shouldOneWayMapShouldNotRollbackStateForStatefulServerInCaseOfSuccess = {
- val stateful = newActor(() => new InMemStatefulActor(2))
+ val stateful = actorOf(new InMemStatefulActor(2))
stateful.start
stateful ! SetMapStateOneWay("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "init") // set init state
stateful ! SuccessOneWay("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "new state") // transactionrequired
@@ -130,7 +130,7 @@ class InMemoryActorSpec extends JUnitSuite {
@Test
def shouldOneWayMapShouldRollbackStateForStatefulServerInCaseOfFailure = {
- val stateful = newActor(() => new InMemStatefulActor(2))
+ val stateful = actorOf(new InMemStatefulActor(2))
stateful.start
val failer = newActor[InMemFailerActor]
failer.start
@@ -157,7 +157,7 @@ class InMemoryActorSpec extends JUnitSuite {
@Test
def shouldOneWayVectorShouldNotRollbackStateForStatefulServerInCaseOfSuccess = {
- val stateful = newActor(() => new InMemStatefulActor(2))
+ val stateful = actorOf(new InMemStatefulActor(2))
stateful.start
stateful ! SetVectorStateOneWay("init") // set init state
stateful ! SuccessOneWay("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "new state") // transactionrequired
@@ -177,7 +177,7 @@ class InMemoryActorSpec extends JUnitSuite {
@Test
def shouldOneWayVectorShouldRollbackStateForStatefulServerInCaseOfFailure = {
- val stateful = newActor(() => new InMemStatefulActor(2))
+ val stateful = actorOf(new InMemStatefulActor(2))
stateful.start
stateful ! SetVectorStateOneWay("init") // set init state
Thread.sleep(1000)
@@ -205,7 +205,7 @@ class InMemoryActorSpec extends JUnitSuite {
@Test
def shouldOneWayRefShouldNotRollbackStateForStatefulServerInCaseOfSuccess = {
- val stateful = newActor(() => new InMemStatefulActor(2))
+ val stateful = actorOf(new InMemStatefulActor(2))
stateful.start
stateful ! SetRefStateOneWay("init") // set init state
stateful ! SuccessOneWay("testShouldNotRollbackStateForStatefulServerInCaseOfSuccess", "new state") // transactionrequired
@@ -225,7 +225,7 @@ class InMemoryActorSpec extends JUnitSuite {
@Test
def shouldOneWayRefShouldRollbackStateForStatefulServerInCaseOfFailure = {
- val stateful = newActor(() => new InMemStatefulActor(2))
+ val stateful = actorOf(new InMemStatefulActor(2))
stateful.start
stateful ! SetRefStateOneWay("init") // set init state
Thread.sleep(1000)
diff --git a/akka-core/src/test/scala/ReactorBasedThreadPoolEventDrivenDispatcherActorSpec.scala b/akka-core/src/test/scala/ReactorBasedThreadPoolEventDrivenDispatcherActorSpec.scala
index 4e0b55f91b..6e0e1ca31e 100644
--- a/akka-core/src/test/scala/ReactorBasedThreadPoolEventDrivenDispatcherActorSpec.scala
+++ b/akka-core/src/test/scala/ReactorBasedThreadPoolEventDrivenDispatcherActorSpec.scala
@@ -26,7 +26,7 @@ class ReactorBasedThreadPoolEventDrivenDispatcherActorSpec extends JUnitSuite {
@Test def shouldSendOneWay = {
val oneWay = new CountDownLatch(1)
- val actor = newActor(() => new Actor {
+ val actor = actorOf(new Actor {
dispatcher = Dispatchers.newReactorBasedThreadPoolEventDrivenDispatcher(uuid)
def receive = {
case "OneWay" => oneWay.countDown
diff --git a/akka-core/src/test/scala/ThreadBasedActorSpec.scala b/akka-core/src/test/scala/ThreadBasedActorSpec.scala
index 6466e5749b..5d04393a22 100644
--- a/akka-core/src/test/scala/ThreadBasedActorSpec.scala
+++ b/akka-core/src/test/scala/ThreadBasedActorSpec.scala
@@ -27,7 +27,7 @@ class ThreadBasedActorSpec extends JUnitSuite {
@Test def shouldSendOneWay = {
var oneWay = new CountDownLatch(1)
- val actor = newActor(() => new Actor {
+ val actor = actorOf(new Actor {
dispatcher = Dispatchers.newThreadBasedDispatcher(this)
def receive = {
case "OneWay" => oneWay.countDown
diff --git a/akka-core/src/test/scala/ThreadBasedDispatcherSpec.scala b/akka-core/src/test/scala/ThreadBasedDispatcherSpec.scala
index f5b0235430..5ae9c9c786 100644
--- a/akka-core/src/test/scala/ThreadBasedDispatcherSpec.scala
+++ b/akka-core/src/test/scala/ThreadBasedDispatcherSpec.scala
@@ -14,9 +14,9 @@ import Actor._
class ThreadBasedDispatcherSpec extends JUnitSuite {
private var threadingIssueDetected: AtomicBoolean = null
- val key1 = newActor(() => new Actor { def receive = { case _ => {}} })
- val key2 = newActor(() => new Actor { def receive = { case _ => {}} })
- val key3 = newActor(() => new Actor { def receive = { case _ => {}} })
+ val key1 = actorOf(new Actor { def receive = { case _ => {}} })
+ val key2 = actorOf(new Actor { def receive = { case _ => {}} })
+ val key3 = actorOf(new Actor { def receive = { case _ => {}} })
class TestMessageHandle(handleLatch: CountDownLatch) extends MessageInvoker {
val guardLock: Lock = new ReentrantLock
diff --git a/akka-samples/akka-sample-camel/src/main/scala/Boot.scala b/akka-samples/akka-sample-camel/src/main/scala/Boot.scala
index 81bf83801c..a51563e4a0 100644
--- a/akka-samples/akka-sample-camel/src/main/scala/Boot.scala
+++ b/akka-samples/akka-sample-camel/src/main/scala/Boot.scala
@@ -35,8 +35,8 @@ class Boot {
// Routing example
val producer = newActor[Producer1]
- val mediator = newActor(() => new Transformer(producer))
- val consumer = newActor(() => new Consumer3(mediator))
+ val mediator = actorOf(new Transformer(producer))
+ val consumer = actorOf(new Consumer3(mediator))
producer.start
mediator.start
@@ -55,9 +55,9 @@ class Boot {
//val cometdPublisher = new Publisher("cometd-publisher", cometdUri).start
val jmsUri = "jms:topic:test"
- val jmsSubscriber1 = newActor(() => new Subscriber("jms-subscriber-1", jmsUri)).start
- val jmsSubscriber2 = newActor(() => new Subscriber("jms-subscriber-2", jmsUri)).start
- val jmsPublisher = newActor(() => new Publisher("jms-publisher", jmsUri)).start
+ val jmsSubscriber1 = actorOf(new Subscriber("jms-subscriber-1", jmsUri)).start
+ val jmsSubscriber2 = actorOf(new Subscriber("jms-subscriber-2", jmsUri)).start
+ val jmsPublisher = actorOf(new Publisher("jms-publisher", jmsUri)).start
//val cometdPublisherBridge = new PublisherBridge("jetty:http://0.0.0.0:8877/camel/pub/cometd", cometdPublisher).start
val jmsPublisherBridge = new PublisherBridge("jetty:http://0.0.0.0:8877/camel/pub/jms", jmsPublisher).start
diff --git a/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala b/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala
index c2ce76e1fa..77383a031b 100644
--- a/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala
+++ b/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala
@@ -130,7 +130,7 @@ trait SessionManagement { this: Actor =>
protected def sessionManagement: PartialFunction[Any, Unit] = {
case Login(username) =>
log.info("User [%s] has logged in", username)
- val session = newActor(() => new Session(username, storage))
+ val session = actorOf(new Session(username, storage))
session.start
sessions += (username -> session)
diff --git a/akka-samples/akka-sample-pubsub/src/main/scala/RedisPubSub.scala b/akka-samples/akka-sample-pubsub/src/main/scala/RedisPubSub.scala
index f0005ca919..44366d31a4 100644
--- a/akka-samples/akka-sample-pubsub/src/main/scala/RedisPubSub.scala
+++ b/akka-samples/akka-sample-pubsub/src/main/scala/RedisPubSub.scala
@@ -52,7 +52,7 @@ import se.scalablesolutions.akka.actor.Actor._
object Pub {
println("starting publishing service ..")
val r = new RedisClient("localhost", 6379)
- val p = newActor(() => new Publisher(r))
+ val p = actorOf(new Publisher(r))
p.start
def publish(channel: String, message: String) = {
@@ -63,7 +63,7 @@ object Pub {
object Sub {
println("starting subscription service ..")
val r = new RedisClient("localhost", 6379)
- val s = newActor(() => new Subscriber(r))
+ val s = actorOf(new Subscriber(r))
s.start
s ! Register(callback)