rename ActorSystem.stop() to .shutdown()
This commit is contained in:
parent
9af58366f6
commit
5eedbdd69f
26 changed files with 44 additions and 44 deletions
|
|
@ -20,7 +20,7 @@ public class JavaAPI {
|
|||
|
||||
@AfterClass
|
||||
public static void afterAll() {
|
||||
system.stop();
|
||||
system.shutdown();
|
||||
system = null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public class JavaExtension {
|
|||
|
||||
@AfterClass
|
||||
public static void afterAll() {
|
||||
system.stop();
|
||||
system.shutdown();
|
||||
system = null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public class JavaFutureTests {
|
|||
|
||||
@AfterClass
|
||||
public static void afterAll() {
|
||||
system.stop();
|
||||
system.shutdown();
|
||||
system = null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ object Chameneos {
|
|||
val actor = system.actorOf(Props(new Mall(1000000, 4)))
|
||||
Thread.sleep(10000)
|
||||
println("Elapsed: " + (end - start))
|
||||
system.stop()
|
||||
system.shutdown()
|
||||
}
|
||||
|
||||
def main(args: Array[String]): Unit = run
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class DeployerSpec extends AkkaSpec(DeployerSpec.deployerConf) {
|
|||
}
|
||||
""", ConfigParseOptions.defaults).withFallback(AkkaSpec.testConf)
|
||||
|
||||
ActorSystem("invalid", invalidDeployerConf).stop()
|
||||
ActorSystem("invalid", invalidDeployerConf).shutdown()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ class FSMActorSpec extends AkkaSpec(Map("akka.actor.debug.fsm" -> true)) with Im
|
|||
}
|
||||
}
|
||||
} finally {
|
||||
fsmEventSystem.stop()
|
||||
fsmEventSystem.shutdown()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,9 +52,9 @@ class LoggingReceiveSpec extends WordSpec with BeforeAndAfterEach with BeforeAnd
|
|||
}
|
||||
|
||||
override def afterAll {
|
||||
appLogging.stop()
|
||||
appAuto.stop()
|
||||
appLifecycle.stop()
|
||||
appLogging.shutdown()
|
||||
appAuto.shutdown()
|
||||
appLifecycle.shutdown()
|
||||
}
|
||||
|
||||
"A LoggingReceive" must {
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ class SerializeSpec extends AkkaSpec(SerializeSpec.serializationConf) {
|
|||
(deadLetters eq a.deadLetters) must be(true)
|
||||
}
|
||||
} finally {
|
||||
a.stop()
|
||||
a.shutdown()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ abstract class ActorSystem extends ActorRefFactory {
|
|||
* (below which the logging actors reside) and the execute all registered
|
||||
* termination handlers (see [[ActorSystem.registerOnTermination]]).
|
||||
*/
|
||||
def stop()
|
||||
def shutdown()
|
||||
|
||||
/**
|
||||
* Registers the provided extension and creates its payload, if this extension isn't already registered
|
||||
|
|
@ -453,7 +453,7 @@ class ActorSystemImpl(val name: String, applicationConfig: Config) extends Actor
|
|||
def registerOnTermination[T](code: ⇒ T) { terminationFuture onComplete (_ ⇒ code) }
|
||||
def registerOnTermination(code: Runnable) { terminationFuture onComplete (_ ⇒ code.run) }
|
||||
|
||||
def stop() {
|
||||
def shutdown() {
|
||||
stop(guardian)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class ConfigDocSpec extends WordSpec with MustMatchers {
|
|||
val system = ActorSystem("MySystem", ConfigFactory.load(customConf))
|
||||
//#custom-config
|
||||
|
||||
system.stop()
|
||||
system.shutdown()
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public class UntypedActorTestBase {
|
|||
ActorRef myActor = system.actorOf(new Props(MyUntypedActor.class));
|
||||
//#system-actorOf
|
||||
myActor.tell("test");
|
||||
system.stop();
|
||||
system.shutdown();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -52,7 +52,7 @@ public class UntypedActorTestBase {
|
|||
ActorRef myActor = system.actorOf(new Props(MyUntypedActor.class));
|
||||
//#context-actorOf
|
||||
myActor.tell("test");
|
||||
system.stop();
|
||||
system.shutdown();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -67,7 +67,7 @@ public class UntypedActorTestBase {
|
|||
}));
|
||||
//#creating-constructor
|
||||
myActor.tell("test");
|
||||
system.stop();
|
||||
system.shutdown();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -80,7 +80,7 @@ public class UntypedActorTestBase {
|
|||
"myactor");
|
||||
//#creating-props
|
||||
myActor.tell("test");
|
||||
system.stop();
|
||||
system.shutdown();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -105,7 +105,7 @@ public class UntypedActorTestBase {
|
|||
}
|
||||
}
|
||||
//#using-ask
|
||||
system.stop();
|
||||
system.shutdown();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -113,7 +113,7 @@ public class UntypedActorTestBase {
|
|||
ActorSystem system = ActorSystem.create("MySystem");
|
||||
ActorRef myActor = system.actorOf(new Props(MyReceivedTimeoutUntypedActor.class));
|
||||
myActor.tell("Hello");
|
||||
system.stop();
|
||||
system.shutdown();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -123,7 +123,7 @@ public class UntypedActorTestBase {
|
|||
//#poison-pill
|
||||
myActor.tell(poisonPill());
|
||||
//#poison-pill
|
||||
system.stop();
|
||||
system.shutdown();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -133,7 +133,7 @@ public class UntypedActorTestBase {
|
|||
//#kill
|
||||
victim.tell(kill());
|
||||
//#kill
|
||||
system.stop();
|
||||
system.shutdown();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -147,7 +147,7 @@ public class UntypedActorTestBase {
|
|||
myActor.tell("foo");
|
||||
myActor.tell("bar");
|
||||
myActor.tell("bar");
|
||||
system.stop();
|
||||
system.shutdown();
|
||||
}
|
||||
|
||||
public static class MyActor extends UntypedActor {
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public class LoggingDocTestBase {
|
|||
}
|
||||
}));
|
||||
myActor.tell("test");
|
||||
system.stop();
|
||||
system.shutdown();
|
||||
}
|
||||
|
||||
//#my-actor
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public class DurableMailboxDocTestBase {
|
|||
}));
|
||||
//#define-dispatcher
|
||||
myActor.tell("test");
|
||||
system.stop();
|
||||
system.shutdown();
|
||||
}
|
||||
|
||||
public static class MyUntypedActor extends UntypedActor {
|
||||
|
|
|
|||
|
|
@ -149,6 +149,6 @@ object QDumper {
|
|||
new QueueDumper(filename, system.log)()
|
||||
}
|
||||
|
||||
system.stop()
|
||||
system.shutdown()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ akka {
|
|||
implicit val timeout = system.settings.ActorTimeout
|
||||
|
||||
override def atTermination() {
|
||||
other.stop()
|
||||
other.shutdown()
|
||||
}
|
||||
|
||||
"Remoting" must {
|
||||
|
|
@ -130,4 +130,4 @@ akka {
|
|||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ akka {
|
|||
val other = ActorSystem("remote_sys", conf)
|
||||
|
||||
override def atTermination() {
|
||||
other.stop()
|
||||
other.shutdown()
|
||||
}
|
||||
|
||||
"A Remote Router" must {
|
||||
|
|
@ -55,4 +55,4 @@ akka {
|
|||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class HelloActor extends Actor {
|
|||
case Start ⇒ worldActor ! "Hello"
|
||||
case s: String ⇒
|
||||
println("Received message: %s".format(s))
|
||||
context.system.stop()
|
||||
context.system.shutdown()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,6 +48,6 @@ public class RetryExample {
|
|||
|
||||
application.stop(transferer);
|
||||
|
||||
application.stop();
|
||||
application.shutdown();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,6 @@ public class UntypedCoordinatedExample {
|
|||
application.stop(counter1);
|
||||
application.stop(counter2);
|
||||
|
||||
application.stop();
|
||||
application.shutdown();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,6 @@ public class UntypedTransactorExample {
|
|||
application.stop(counter1);
|
||||
application.stop(counter2);
|
||||
|
||||
application.stop();
|
||||
application.shutdown();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public class UntypedCoordinatedIncrementTest {
|
|||
|
||||
@AfterClass
|
||||
public static void afterAll() {
|
||||
system.stop();
|
||||
system.shutdown();
|
||||
system = null;
|
||||
}
|
||||
|
||||
|
|
@ -113,6 +113,6 @@ public class UntypedCoordinatedIncrementTest {
|
|||
|
||||
@After
|
||||
public void stop() {
|
||||
application.stop();
|
||||
application.shutdown();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class UntypedTransactorTest {
|
|||
|
||||
@AfterClass
|
||||
public static void afterAll() {
|
||||
system.stop();
|
||||
system.shutdown();
|
||||
system = null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ abstract class AkkaSpec(_system: ActorSystem)
|
|||
}
|
||||
|
||||
final override def afterAll {
|
||||
system.stop()
|
||||
system.shutdown()
|
||||
try system.asInstanceOf[ActorSystemImpl].terminationFuture.await(5 seconds) catch {
|
||||
case _: FutureTimeoutException ⇒ system.log.warning("Failed to stop [{}] within 5 seconds", system.name)
|
||||
}
|
||||
|
|
@ -96,7 +96,7 @@ class AkkaSpecSpec extends WordSpec with MustMatchers {
|
|||
val ref = Seq(testActor, system.actorOf(Props.empty, "name"))
|
||||
}
|
||||
spec.ref foreach (_.isTerminated must not be true)
|
||||
system.stop()
|
||||
system.shutdown()
|
||||
spec.awaitCond(spec.ref forall (_.isTerminated), 2 seconds)
|
||||
}
|
||||
|
||||
|
|
@ -139,15 +139,15 @@ class AkkaSpecSpec extends WordSpec with MustMatchers {
|
|||
|
||||
val latch = new TestLatch(1)(system)
|
||||
system.registerOnTermination(latch.countDown())
|
||||
system.stop()
|
||||
system.shutdown()
|
||||
latch.await(2 seconds)
|
||||
(davyJones ? "Die!").get must be === "finally gone"
|
||||
|
||||
// this will typically also contain log messages which were sent after the logger shutdown
|
||||
locker must contain(DeadLetter(42, davyJones, probe.ref))
|
||||
} finally {
|
||||
system.stop()
|
||||
otherSystem.stop()
|
||||
system.shutdown()
|
||||
otherSystem.shutdown()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -168,6 +168,6 @@ public class Pi {
|
|||
latch.await();
|
||||
|
||||
// Shut down the system
|
||||
system.stop();
|
||||
system.shutdown();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,6 +102,6 @@ object Pi extends App {
|
|||
latch.await()
|
||||
|
||||
// Shut down the system
|
||||
system.stop()
|
||||
system.shutdown()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class WorkerSpec extends WordSpec with MustMatchers with BeforeAndAfterAll {
|
|||
implicit val system = ActorSystem()
|
||||
|
||||
override def afterAll {
|
||||
system.stop()
|
||||
system.shutdown()
|
||||
}
|
||||
|
||||
"Worker" must {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue