On 2009-12-05 21.02, Niclas Hedhman wrote:
On Fri, Dec 4, 2009 at 10:48 PM, Stanislav Muhametsin
<[email protected]>  wrote:
Does Qi4j currently provide (or will it provide in future) any non-direct
way to pass data from outside the app, to the app?

I think you have 3 choices;

  1. You can use the metaInfo() feature. That means you call
setMetaInfo() on the ServiceDeclaration in assembly, and can retrieve
it from the ServiceComposite.metaInfo() method. I vaguely remember
that metaInfo set during assembly will also be used to populate @Uses,
but I would need to check that to be sure... Rickard?

This was my first thought as well. The ServiceDescriptor can be injected with @Uses in the service instance, and from there you can get the metaInfo().

  2. You can move the Service lifecycle outside of Qi4j, and do
importServices() instead of addServices().

Yup, that's a valid choice.

  3. After you have activated your application, you can query the
Application for a Module and from the Module you can ask for a
ServiceFinder and that way engage the Qi4j application from code
outside the Qi4j Runtime.

Yes, that's the main way to access Qi4j from outside of Qi4j.

/Rickard

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to