iota-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tonyfaust...@apache.org
Subject [02/12] incubator-iota git commit: Adjusting FeyCore for better way of testing
Date Mon, 18 Jul 2016 20:43:25 GMT
Adjusting FeyCore for better way of testing


Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/c8456305
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/c8456305
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/c8456305

Branch: refs/heads/master
Commit: c84563056003b858f4e08a3b9bcb882542e001db
Parents: 7203d6d
Author: Barbara Gomes <barbaramaltagomes@gmail.com>
Authored: Thu Jul 14 19:36:08 2016 -0700
Committer: Barbara Gomes <barbaramaltagomes@gmail.com>
Committed: Thu Jul 14 19:36:08 2016 -0700

----------------------------------------------------------------------
 fey-core/src/main/scala/org/apache/iota/fey/Application.scala  | 2 +-
 fey-core/src/main/scala/org/apache/iota/fey/FeyCore.scala      | 4 +---
 .../main/scala/org/apache/iota/fey/WatchServiceReceiver.scala  | 6 ++++--
 3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/c8456305/fey-core/src/main/scala/org/apache/iota/fey/Application.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/main/scala/org/apache/iota/fey/Application.scala b/fey-core/src/main/scala/org/apache/iota/fey/Application.scala
index c11815a..1e5ee69 100644
--- a/fey-core/src/main/scala/org/apache/iota/fey/Application.scala
+++ b/fey-core/src/main/scala/org/apache/iota/fey/Application.scala
@@ -39,6 +39,7 @@ object SYSTEM_ACTORS{
   implicit val system = ActorSystem("FEY-MANAGEMENT-SYSTEM")
 
   val fey = system.actorOf(FeyCore.props, name = "FEY-CORE")
+  fey ! FeyCore.START
 
   val service = system.actorOf(Props[MyServiceActor], name = "FEY_REST_API")
 
@@ -47,5 +48,4 @@ object SYSTEM_ACTORS{
   implicit val timeout = Timeout(800.seconds)
   IO(Http) ? Http.Bind(SYSTEM_ACTORS.service, interface = "0.0.0.0", port = 16666)
 
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/c8456305/fey-core/src/main/scala/org/apache/iota/fey/FeyCore.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/main/scala/org/apache/iota/fey/FeyCore.scala b/fey-core/src/main/scala/org/apache/iota/fey/FeyCore.scala
index 8ae3056..8f0b44f 100644
--- a/fey-core/src/main/scala/org/apache/iota/fey/FeyCore.scala
+++ b/fey-core/src/main/scala/org/apache/iota/fey/FeyCore.scala
@@ -96,14 +96,12 @@ protected class FeyCore extends Actor with ActorLogging{
   override def preStart(): Unit = {
     SYSTEM_ACTORS.monitoring ! Monitor.START(Utils.getTimestamp)
     log.info("Starting Fey Core")
-    self ! START
   }
 
-
-
   override def postRestart(reason: Throwable): Unit = {
     SYSTEM_ACTORS.monitoring ! Monitor.RESTART(reason, Utils.getTimestamp)
     preStart()
+    self ! START
   }
 
   override val supervisorStrategy =

http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/c8456305/fey-core/src/main/scala/org/apache/iota/fey/WatchServiceReceiver.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/main/scala/org/apache/iota/fey/WatchServiceReceiver.scala b/fey-core/src/main/scala/org/apache/iota/fey/WatchServiceReceiver.scala
index 58d25b0..a20ce54 100644
--- a/fey-core/src/main/scala/org/apache/iota/fey/WatchServiceReceiver.scala
+++ b/fey-core/src/main/scala/org/apache/iota/fey/WatchServiceReceiver.scala
@@ -97,9 +97,11 @@ class WatchServiceReceiver(receiverActor: ActorRef) extends JsonReceiver{
   }
 
   override def exceptionOnRun(e: Exception): Unit = {
-    log.error("Watch Service stopped", e)
+    e match {
+      case e: InterruptedException =>
+      case e: Exception => log.error("Watch Service stopped", e)
+    }
     watchService.close()
-    throw e
   }
 
 }


Mime
View raw message