On 11/24/10 9:17, Clement Escoffier wrote:
Hi,
On 24.11.10 13:27, "Gay David (Annecy)"<[email protected]> wrote:
Hi all,
While looking at some documents about iPojo composition, I've see that
there is a notion of "context-source".
For example :
* this presentation at page 91 :
http://felix.apache.org/site/presentations.data/ipojo-berlin-20080611.pd
f
* this presentation at page 43 :
http://felix.apache.org/site/article-presentations.data/iPOJO-Defense-FI
NAL.pdf
In the iPojo API, I've also see this interface :
http://felix.apache.org/ipojo/api/1.6.0/org/apache/felix/ipojo/ContextSo
urce.html
And in the composite documentation here :
http://felix.apache.org/site/ipojo-composition-tutorial.html , there is
nothing about it, just a word in the conclusion that say that
context-awareness will be addressed shortly (as other topics)
While composite are very clear to me (BTW this is an fantastic feature,
thanks), I'm not sure I understand what's really the context-source and
context awareness.
Can someone provides me more info / links / samples about this ?
The context-awareness was made to allow composition to evolve according to
a context (I.e. When the context changes, the composition is
re-evaluated). This is a little bit experimental in the sense that this
was never really used in production (as far as I know).
The idea is kind of simple. You define context-sources providing the
context and publishing the changes. Then, the compositions are expressed
in term of the context by configuring 'context-aware-filters'.
I will add ASAP an example of the context-awareness on the composition
tutorial to make this topic clearer.
To be a little more concrete (although details may be out of date)...
A context source is just something that supplies name/value pairs at run
time. A composition with a context source can have its filters written
in terms of properties from the context source.
For example, assume you have a context source that provides the user's
current location. Then when you specify a sub-service in a composite,
you can reference the user's current location in its filter, e.g.:
<composite name="foo">
...
<sub-service
context-source="global:user-context-source"
action="instantiate"
specification="org.foo.Printer"
filter="(location=${user.location})" />
...
</composite>
In this case, the global context source "user-context-source" is used to
determine the user's current location, which is used to track printer
services in the same location as the user.
-> richard
Regards,
Clement
PS: As I'm pretty sure you can read French, you can check:
http://tel.archives-ouvertes.fr/tel-00347935/en/ (pages 129 to 131)
Thanks for your help.
David G.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]