Hi Andreas,

the mechanism we foresee for this case is that you create an appropriate
ClassLoader which has visibility into all the right bundles (e.g. using the
BundleDelegatingClassLoader from the akka-osgi package) and pass that to
the ActorSystem at creation. We have taken care that all reflective access
and configuration loading occur via that ClassLoader.

Hooking into the OSGi configuration management facilities will be rather
painful because Akka does not support dynamic configuration: once the
ActorSystem is created you cannot change anything, so you would have to
restart the bundle that contains the ActorSystem upon every config change.

Regards,

Roland



On Tue, May 6, 2014 at 11:50 AM, Andreas Gies <andreas....@googlemail.com>wrote:

> Hello Hakkers,
>
> today I am interested how you usually configure your bundles inside an
> OSGi container.
>
> I can easily access the application.conf provided with Akka itself to get
> to all the default values. I can also provide bundle specific configuration
> in separate files and my bundle would pick up those.
>
> However, I have just done some experimenting with Spray in OSGi and the
> problem is as follows:
>
> Several spray bundles contain resource.conf files with default values that
> make sense to configure spray. On top of that the user has to provide some
> additional values to make his route work.
> The ActorSystem that lives in some bundle not knowing about spray does not
> see the resource.conf files provided by spray and the user-bundle should
> only contain the values it wishes to add or override.
>
> I have seen examples to do some classloader tweaking (e.g. [1]) to bring
> the resource.conf files into scope when the ActorSystem is initialized.
> From my (probably limited) understanding that would kind of defeat the
> purpose of OSGi. The ActorSystem shouldn't know about the bundles that are
> installed and may contribute to the configuration. My current solution is
> to replicate the spray settings in my bundle's conf file, but that somehow
> doesn't feel right either.
>
> I was wondering whether someone has thought about / tried to implement
> some kind of whiteboard pattern ? - I am thinking along the lines of an
> Akka config service that starts with the default application.conf. The
> extender would merge resource.conf files as akka bundles are installed
> remove the settings again when the bundle is uninstalled. Does the Config
> API provide such functionality ?
>
> Well, I just wanted to hear some thoughts before diving into such an
> extender ....
>
>
> [1] https://groups.google.com/forum/#!topic/spray-user/lmcdBsxNzdQ
>
>
> Thanks and best regards
> Andreas
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Akka Team
Typesafe - The software stack for applications that scale
Blog: letitcrash.com
Twitter: @akkateam

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to