You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2010/07/07 06:14:01 UTC

svn commit: r961176 - /activemq/sandbox/activemq-apollo-actor/activemq-util/src/main/scala/org/apache/activemq/apollo/ServiceTrait.scala

Author: chirino
Date: Wed Jul  7 04:14:01 2010
New Revision: 961176

URL: http://svn.apache.org/viewvc?rev=961176&view=rev
Log:
Adding enriched service trait.

Added:
    activemq/sandbox/activemq-apollo-actor/activemq-util/src/main/scala/org/apache/activemq/apollo/ServiceTrait.scala

Added: activemq/sandbox/activemq-apollo-actor/activemq-util/src/main/scala/org/apache/activemq/apollo/ServiceTrait.scala
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo-actor/activemq-util/src/main/scala/org/apache/activemq/apollo/ServiceTrait.scala?rev=961176&view=auto
==============================================================================
--- activemq/sandbox/activemq-apollo-actor/activemq-util/src/main/scala/org/apache/activemq/apollo/ServiceTrait.scala (added)
+++ activemq/sandbox/activemq-apollo-actor/activemq-util/src/main/scala/org/apache/activemq/apollo/ServiceTrait.scala Wed Jul  7 04:14:01 2010
@@ -0,0 +1,38 @@
+/**
+ * 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.activemq.apollo
+
+import org.apache.activemq.Service
+import org.fusesource.hawtdispatch.ScalaDispatch
+
+/**
+ * <p>
+ * </p>
+ *
+ * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
+ */
+trait ServiceTrait extends Service {
+
+  def start(func: =>Unit ):Unit = {
+    start( ScalaDispatch.runnable( func _ ) )
+  }
+
+  def stop(func: =>Unit ):Unit = {
+    stop( ScalaDispatch.runnable( func _ ) )
+  }
+
+}
\ No newline at end of file