Hi Christian
On 16/11/12 06:59, Christian Schneider wrote:
Currently we manually use spring-dm to read the IntentMap from the dsw
bundle as well as from bundles implementing or using OSGi services.
This has some drawbacks:
- As IntentMap is defined in the dsw bundle the user bundles depend on
the dsw bundle
- User bundles and dsw bundle depend on spring dm
- It is not possible to use other ways to define intents (e.g. blueprint
or by hand)

So I propose to replace this with a different aproach:

First I would like to replace the IntentMap with a simple HashMap so we
do not need a depdendency on dsw.
To also avoid to directly use spring dm I propose we define the default
intents in java code.

For user defined intents we could use a service. So the user bundles
would define the intent map themselves and offer it as an OSGi service.
The dsw bundle then would check for these services.
As the Map is not a unique identifier we could use a property to mark a
service as a intent map.

The solution has one drawback though. It is incompatible with the
current way of defining intents. Do you think this is a problem? Do you
see any other problems with proposed solution?

Btw. I think the current intent map reading has a bug. We use
getIntentMap for loading the default intents as well as the use intents.
Inside getIntentMap we cache the loaded IntentMap. So only the first
call will load something. So I am not sure if user intents work at all
at the moment. Is this correct?

See also:
https://issues.apache.org/jira/browse/DOSGI-86
https://issues.apache.org/jira/browse/DOSGI-115


I'm not sure anyone uses custom intents, there were some ideas from users on how to get custom intents, suggesting how it can be done based on the existing approach but it was too difficult as far as I recall. So what you suggest seems more flexible and OSGI-friendly.

Typically, reacting to an intent means adding a CXF-level interceptor.
How will it work with your approach ?


Cheers, Sergey

Christian



--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to