splitted kernel up in core + many sub modules
This commit is contained in:
parent
deeaa923d1
commit
ab6637044f
154 changed files with 1510 additions and 2651 deletions
|
|
@ -1,26 +0,0 @@
|
|||
/**
|
||||
* Copyright (C) 2009 Scalable Solutions.
|
||||
*/
|
||||
|
||||
package se.scalablesolutions.akka.kernel.rest
|
||||
|
||||
import com.sun.jersey.core.spi.component.ioc.IoCFullyManagedComponentProvider
|
||||
|
||||
import kernel.config.Configurator
|
||||
import kernel.util.Logging
|
||||
|
||||
class ActorComponentProvider(val clazz: Class[_], val configurators: List[Configurator])
|
||||
extends IoCFullyManagedComponentProvider with Logging {
|
||||
|
||||
override def getInstance: AnyRef = {
|
||||
val instances = for {
|
||||
conf <- configurators
|
||||
if conf.isDefined(clazz)
|
||||
} yield conf.getInstance(clazz).asInstanceOf[AnyRef]
|
||||
instances match {
|
||||
case instance :: Nil => instance
|
||||
case Nil => throw new IllegalArgumentException("No Actor for class [" + clazz + "] could be found. Make sure you have defined and configured the class as an Active Object or Actor in a Configurator")
|
||||
case _ => throw new IllegalArgumentException("Actor for class [" + clazz + "] is defined in more than one Configurator. Eliminate the redundancy.")
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue