When using Akka actors, every actor created gets registered in an ActorRegistry. The ActorRegistry is a singleton, and allows for easy lookup and management (start, stop, ...) of all actors.
In an OSGi environment however, a number of application bundles can be installed each using Akka actors internally (and Akka is installed as a bundle itself). Some of the actors of an application bundle should be available to other bundles and as such act as exported services. Others are strictly internal to the bundle. The ActorRegistry however contains all the actors of all bundles (since it's a singleton), so both the exported as well as the internal ones. This means even the actors used internally in a bundle are available to any other bundle.
But I'd like to gain more control of which actors are available outside the scope of a bundle. Ideally every bundle would have it's own ActorRegistry, and decide which of its actors get published as an OSGi service.
So what would be the best way to use Akka for a modular application in an OSGi environment, to achieve true modularity?
(Background about this on http://blog.xume.com/2011/02/actorregistry-scope-using-akka-in-osgi.html