From ab3a86c6c37914bdbbad28af49be3adeacbf778a Mon Sep 17 00:00:00 2001 From: "bluejoe2008@gmail.com" Date: Thu, 10 May 2018 23:05:52 +0800 Subject: [PATCH] event.scala --- src/main/scala/event.scala | 12 ++++++++++++ src/main/scala/flow.scala | 15 ++------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/main/scala/event.scala b/src/main/scala/event.scala index 6284c67..da526de 100644 --- a/src/main/scala/event.scala +++ b/src/main/scala/event.scala @@ -7,6 +7,18 @@ trait Event { } +case class LaunchProcess() extends Event { +} + +case class ProcessStarted(processName: String) extends Event { +} + +case class ProcessFailed(processName: String) extends Event { +} + +case class ProcessCompleted(processName: String) extends Event { +} + trait EventHandler { def handle(event: Event, args: Any): Unit; } diff --git a/src/main/scala/flow.scala b/src/main/scala/flow.scala index 03f9511..f0107ef 100644 --- a/src/main/scala/flow.scala +++ b/src/main/scala/flow.scala @@ -212,23 +212,12 @@ class FlowExecutionImpl(id: String, flow: Flow, args: Map[String, Any]) override def getId(): String = id; - override def addListener(listener: FlowExecutionListener): Unit = listeners += listener; + override def addListener(listener: FlowExecutionListener): Unit = + listeners += listener; override def getFlow(): Flow = flow; } -case class LaunchProcess() extends Event { -} - -case class ProcessStarted(processName: String) extends Event { -} - -case class ProcessFailed(processName: String) extends Event { -} - -case class ProcessCompleted(processName: String) extends Event { -} - class ProcessAsQuartzJob extends Job with Logging { override def execute(context: JobExecutionContext): Unit = { val map = context.getJobDetail.getJobDataMap;