diff --git a/akka-actor-tests/src/test/scala/akka/actor/DeployerSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/DeployerSpec.scala index 404fcf5acb..89a153ad57 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/DeployerSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/DeployerSpec.scala @@ -15,11 +15,6 @@ object DeployerSpec { akka.actor.deployment { /service1 { } - /service3 { - create-as { - class = "akka.actor.DeployerSpec$RecipeActor" - } - } /service-direct { router = from-code } @@ -68,7 +63,6 @@ class DeployerSpec extends AkkaSpec(DeployerSpec.deployerConf) { Deploy( service, deployment.get.config, - None, NoRouter, LocalScope))) } @@ -79,20 +73,6 @@ class DeployerSpec extends AkkaSpec(DeployerSpec.deployerConf) { deployment must be(None) } - "be able to parse 'akka.actor.deployment._' with recipe" in { - val service = "/service3" - val deployment = system.asInstanceOf[ActorSystemImpl].provider.deployer.lookup(service) - deployment must be('defined) - - deployment must be(Some( - Deploy( - service, - deployment.get.config, - Some(ActorRecipe(classOf[DeployerSpec.RecipeActor])), - NoRouter, - LocalScope))) - } - "detect invalid number-of-instances" in { intercept[com.typesafe.config.ConfigException.WrongType] { val invalidDeployerConf = ConfigFactory.parseString(""" @@ -137,7 +117,6 @@ class DeployerSpec extends AkkaSpec(DeployerSpec.deployerConf) { val deployment = system.asInstanceOf[ActorSystemImpl].provider.deployer.lookup(service) deployment must be('defined) deployment.get.path must be(service) - deployment.get.recipe must be(None) deployment.get.routing.getClass must be(expected.getClass) deployment.get.routing.resizer must be(expected.resizer) deployment.get.scope must be(LocalScope) diff --git a/akka-actor-tests/src/test/scala/akka/routing/ConfiguredLocalRoutingSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/ConfiguredLocalRoutingSpec.scala index dd4e45f5cb..032c4da921 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/ConfiguredLocalRoutingSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/ConfiguredLocalRoutingSpec.scala @@ -15,7 +15,7 @@ class ConfiguredLocalRoutingSpec extends AkkaSpec with DefaultTimeout with Impli "RouterConfig" must { "be overridable in config" in { - deployer.deploy(Deploy("/config", null, None, RandomRouter(4), LocalScope)) + deployer.deploy(Deploy("/config", null, RandomRouter(4), LocalScope)) val actor = system.actorOf(Props(new Actor { def receive = { case "get" ⇒ sender ! context.props diff --git a/akka-actor/src/main/resources/reference.conf b/akka-actor/src/main/resources/reference.conf index de4b46709b..f6b7188192 100644 --- a/akka-actor/src/main/resources/reference.conf +++ b/akka-actor/src/main/resources/reference.conf @@ -74,8 +74,7 @@ akka { # that the values specified in the code shall be used. # In case of routing, the actors to be routed to can be specified # in several ways: - # - nr-of-instances: will create that many children given the actor factory - # supplied in the source code (overridable using create-as below) + # - nr-of-instances: will create that many children # - routees.paths: will look the paths up using actorFor and route to # them, i.e. will not create children # - resizer: dynamically resizable number of routees as specified in resizer below @@ -88,11 +87,6 @@ akka { # within is the timeout used for routers containing future calls within = 5 seconds - create-as { - # fully qualified class name of recipe implementation - class = "" - } - routees { # Alternatively to giving nr-of-instances you can specify the full # paths of those actors which should be routed to. This setting takes diff --git a/akka-actor/src/main/scala/akka/actor/Deployer.scala b/akka-actor/src/main/scala/akka/actor/Deployer.scala index 5ac4c13391..54ba5c1a57 100644 --- a/akka-actor/src/main/scala/akka/actor/Deployer.scala +++ b/akka-actor/src/main/scala/akka/actor/Deployer.scala @@ -15,7 +15,7 @@ import akka.routing._ import java.util.concurrent.{ TimeUnit, ConcurrentHashMap } import akka.util.ReflectiveAccess -case class Deploy(path: String, config: Config, recipe: Option[ActorRecipe] = None, routing: RouterConfig = NoRouter, scope: Scope = LocalScope) +case class Deploy(path: String, config: Config, routing: RouterConfig = NoRouter, scope: Scope = LocalScope) case class ActorRecipe(implementationClass: Class[_ <: Actor]) //TODO Add ActorConfiguration here @@ -82,16 +82,7 @@ class Deployer(val settings: ActorSystem.Settings) { } } - val recipe: Option[ActorRecipe] = - deployment.getString("create-as.class") match { - case "" ⇒ None - case impl ⇒ - val implementationClass = getClassFor[Actor](impl).fold(e ⇒ throw new ConfigurationException( - "Config option [akka.actor.deployment." + key + ".create-as.class] load failed", e), identity) - Some(ActorRecipe(implementationClass)) - } - - Some(Deploy(key, deployment, recipe, router, LocalScope)) + Some(Deploy(key, deployment, router, LocalScope)) } } diff --git a/akka-actor/src/main/scala/akka/routing/Routing.scala b/akka-actor/src/main/scala/akka/routing/Routing.scala index 0473f99fd6..abc1c80713 100644 --- a/akka-actor/src/main/scala/akka/routing/Routing.scala +++ b/akka-actor/src/main/scala/akka/routing/Routing.scala @@ -126,9 +126,9 @@ trait RouterConfig { def adaptFromDeploy(deploy: Option[Deploy]): RouterConfig = { deploy match { - case Some(Deploy(_, _, _, NoRouter, _)) ⇒ this - case Some(Deploy(_, _, _, r, _)) ⇒ r - case _ ⇒ this + case Some(Deploy(_, _, NoRouter, _)) ⇒ this + case Some(Deploy(_, _, r, _)) ⇒ r + case _ ⇒ this } } diff --git a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala index 3f95c03d1a..bcfb98e76d 100644 --- a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala +++ b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala @@ -103,7 +103,7 @@ class RemoteActorRefProvider( }) deployment match { - case Some(Deploy(_, _, _, _, RemoteScope(address))) ⇒ + case Some(Deploy(_, _, _, RemoteScope(address))) ⇒ // FIXME RK this should be done within the deployer, i.e. the whole parsing business address.parse(remote.transports) match { case Left(x) ⇒ diff --git a/akka-remote/src/main/scala/akka/routing/RemoteRouters.scala b/akka-remote/src/main/scala/akka/routing/RemoteRouters.scala index 2b0a685f32..c8f61f471e 100644 --- a/akka-remote/src/main/scala/akka/routing/RemoteRouters.scala +++ b/akka-remote/src/main/scala/akka/routing/RemoteRouters.scala @@ -22,7 +22,7 @@ trait RemoteRouterConfig extends RouterConfig { val impl = context.system.asInstanceOf[ActorSystemImpl] //TODO ticket #1559 IndexedSeq.empty[ActorRef] ++ (for (i ← 1 to nrOfInstances) yield { val name = "c" + i - val deploy = Deploy("", ConfigFactory.empty(), None, props.routerConfig, RemoteScope(node.next)) + val deploy = Deploy("", ConfigFactory.empty(), props.routerConfig, RemoteScope(node.next)) impl.provider.actorOf(impl, props, context.self.asInstanceOf[InternalActorRef], context.self.path / name, false, Some(deploy)) }) } diff --git a/akka-remote/src/test/scala/akka/remote/RemoteDeployerSpec.scala b/akka-remote/src/test/scala/akka/remote/RemoteDeployerSpec.scala index bb219f3d55..1e78b3ebe3 100644 --- a/akka-remote/src/test/scala/akka/remote/RemoteDeployerSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/RemoteDeployerSpec.scala @@ -41,7 +41,6 @@ class RemoteDeployerSpec extends AkkaSpec(RemoteDeployerSpec.deployerConf) { Deploy( service, deployment.get.config, - None, RoundRobinRouter(3), RemoteScope(UnparsedSystemAddress(Some("sys"), UnparsedTransportAddress("akka", "wallace", 2552)))))) }