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