You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@toree.apache.org by lr...@apache.org on 2017/02/19 09:37:04 UTC
[08/14] incubator-toree git commit: case object for each plugin events
case object for each plugin events
Project: http://git-wip-us.apache.org/repos/asf/incubator-toree/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-toree/commit/b36fa461
Tree: http://git-wip-us.apache.org/repos/asf/incubator-toree/tree/b36fa461
Diff: http://git-wip-us.apache.org/repos/asf/incubator-toree/diff/b36fa461
Branch: refs/heads/sandbox
Commit: b36fa461ef4b5f83634fdee942cc5d2ee4e349f7
Parents: 63ba1c3
Author: David Taieb <da...@us.ibm.com>
Authored: Wed Jan 18 17:24:52 2017 -0500
Committer: David Taieb <da...@us.ibm.com>
Committed: Wed Jan 18 17:24:52 2017 -0500
----------------------------------------------------------------------
.../org/apache/toree/plugins/PluginEvents.scala | 51 ++++++++++++++++++++
1 file changed, 51 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/b36fa461/plugins/src/main/scala/org/apache/toree/plugins/PluginEvents.scala
----------------------------------------------------------------------
diff --git a/plugins/src/main/scala/org/apache/toree/plugins/PluginEvents.scala b/plugins/src/main/scala/org/apache/toree/plugins/PluginEvents.scala
new file mode 100644
index 0000000..fd47f4b
--- /dev/null
+++ b/plugins/src/main/scala/org/apache/toree/plugins/PluginEvents.scala
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package org.apache.toree.plugins
+
+import scala.language.implicitConversions
+
+sealed trait PluginEvent {
+ def name: String
+
+ implicit def pluginEventToString(pEvent: PluginEvent) = pEvent.name
+}
+
+/** Signaled when Spark Driver is ready. **/
+case object SparkReady extends PluginEvent{
+ val name = "sparkReady"
+}
+
+/** Signaled when a new OutputStream becomes available. **/
+case object NewOutputStream extends PluginEvent{
+ val name = "newOutputStream"
+}
+
+/** Signaled when all interpreters have been initialized. **/
+case object AllInterpretersReady extends PluginEvent{
+ val name = "allInterpretersReady"
+}
+
+/** Signaled before executing a block of code. **/
+case object PreRunCell extends PluginEvent{
+ val name = "preRunCell"
+}
+
+/** Signaled after executing a block of code. **/
+case object PostRunCell extends PluginEvent{
+ val name = "postRunCell"
+}
\ No newline at end of file