I think that the use case you have illustrated is a useful one ie where you have some actors created via DI and some not. I'd see that what you propose in this regard is a progression in thought to what I presented. Would you be ok if I pulled your changes into an alternate branch as I believe there is great merit in starting with the simplest of examples first?

Sent from my iPhone

On 20/03/2013, at 1:02 AM, Roland Kuhn <notifications@github.com> wrote:

> In src/main/scala/org/typesafe/Akkaspring.scala:
> 
> >    }
> > +  
> > +  lazy val counter = system.actorOf(Props(SpringExt(system).ctx.getBean(classOf[Counter])))
> > +  
> > +  def shutdown(): Unit = system.shutdown()
> >  }
> >  
> The use-case I am trying to illustrate a solution for is to implement part of an application—i.e. one component or service—using actors, which means that this part will use an ActorSystem. Allowing dependencies to be injected into some part of the actors should not require you to pay for that in the construction of all other actors just to thread through the DI context.
> 
> Another way to look at this is reuse of actors: if you need to add the DI context handling (which frankly speaking is an ugly mutable piece) whenever you rearrange your actor hierarchy or bring in actors “from the shelf”, that is not good. The SpringExt allows all actors which need it to access the context while leaving all others alone.
> 
> —
> Reply to this email directly or view it on GitHub.