Ditch RESTService since it only had Lifecycle.
authorChristos KK Loverdos <loverdos@gmail.com>
Fri, 16 Dec 2011 10:21:28 +0000 (12:21 +0200)
committerChristos KK Loverdos <loverdos@gmail.com>
Fri, 16 Dec 2011 10:21:28 +0000 (12:21 +0200)
logic/src/main/scala/gr/grnet/aquarium/MasterConf.scala
logic/src/main/scala/gr/grnet/aquarium/actor/ActorRole.scala
logic/src/main/scala/gr/grnet/aquarium/processor/actor/DispatcherActor.scala
logic/src/main/scala/gr/grnet/aquarium/rest/RESTService.scala [deleted file]
logic/src/main/scala/gr/grnet/aquarium/rest/actor/RESTActorService.scala

index 56190db..1f8ea5a 100644 (file)
@@ -42,9 +42,8 @@ import com.ckkloverdos.props.Props
 import com.ckkloverdos.maybe.{Maybe, Failed, Just, NoVal}
 import com.ckkloverdos.convert.Converters.{DefaultConverters => TheDefaultConverters}
 import processor.actor.{ResourceEventProcessorService, ConfigureDispatcher}
-import rest.RESTService
 import store.{StoreProvider, EventStore, UserStore}
-import util.Loggable
+import util.{Lifecycle, Loggable}
 
 /**
  * The master configurator. Responsible to load all of application configuration and provide the relevant services.
@@ -54,6 +53,9 @@ import util.Loggable
 class MasterConf(val props: Props) extends Loggable {
   import MasterConf.Keys
 
+  /**
+   * Reflectively provide a new instance of a class and configure it appropriately.
+   */
   private[this] def newInstance[C : Manifest](className: String): C = {
     val instanceM = Maybe(defaultClassLoader.loadClass(className).newInstance().asInstanceOf[C])
     instanceM match {
@@ -90,8 +92,8 @@ class MasterConf(val props: Props) extends Loggable {
     instance
   }
   
-  private[this] lazy val _restService: RESTService = {
-    val instance = newInstance[RESTService](props.getEx(Keys.rest_service_class))
+  private[this] lazy val _restService: Lifecycle = {
+    val instance = newInstance[Lifecycle](props.getEx(Keys.rest_service_class))
     logger.info("Loaded RESTService: %s".format(instance.getClass))
     instance
   }
index e319142..2e6db97 100644 (file)
@@ -32,7 +32,8 @@
  * documentation are those of the authors and should not be
  * interpreted as representing official policies, either expressed
  * or implied, of GRNET S.A.
- */package gr.grnet.aquarium.actor
+ */
+package gr.grnet.aquarium.actor
 
 import gr.grnet.aquarium.processor.actor.{ResourceProcessorActor, DispatcherActor}
 import gr.grnet.aquarium.rest.actor.RESTActor
index 90779b2..c92845d 100644 (file)
@@ -39,7 +39,8 @@ import gr.grnet.aquarium.actor.{ActorProvider, DispatcherRole, AquariumActor}
 import gr.grnet.aquarium.util.Loggable
 
 /**
- * 
+ * Business logic dispatcher.
+ *
  * @author Christos KK Loverdos <loverdos@gmail.com>.
  */
 class DispatcherActor extends AquariumActor with Loggable {
diff --git a/logic/src/main/scala/gr/grnet/aquarium/rest/RESTService.scala b/logic/src/main/scala/gr/grnet/aquarium/rest/RESTService.scala
deleted file mode 100644 (file)
index 039de4d..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2011 GRNET S.A. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or
- * without modification, are permitted provided that the following
- * conditions are met:
- *
- *   1. Redistributions of source code must retain the above
- *      copyright notice, this list of conditions and the following
- *      disclaimer.
- *
- *   2. Redistributions in binary form must reproduce the above
- *      copyright notice, this list of conditions and the following
- *      disclaimer in the documentation and/or other materials
- *      provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
- * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and
- * documentation are those of the authors and should not be
- * interpreted as representing official policies, either expressed
- * or implied, of GRNET S.A.
- */
-
-package gr.grnet.aquarium.rest
-
-import gr.grnet.aquarium.util.Lifecycle
-
-/**
- * 
- * @author Christos KK Loverdos <loverdos@gmail.com>.
- */
-trait RESTService extends Lifecycle
\ No newline at end of file
index 382e57a..b1b3bbf 100644 (file)
@@ -40,12 +40,13 @@ import gr.grnet.aquarium.MasterConf
 import gr.grnet.aquarium.actor.RESTRole
 import _root_.akka.actor._
 import cc.spray.can.{ClientConfig, HttpClient, ServerConfig, HttpServer}
+import gr.grnet.aquarium.util.Lifecycle
 
 /**
  * 
  * @author Christos KK Loverdos <loverdos@gmail.com>.
  */
-class RESTActorService extends RESTService {
+class RESTActorService extends Lifecycle {
   private[this] var _port: Int = 8080
   private[this] var _restActor: ActorRef = _
   private[this] var _serverActor: ActorRef = _