osgi / design

OSGi design repository
Other
152 stars 38 forks source link

Blueprint Container enhancements #17

Open bjhargrave opened 12 years ago

bjhargrave commented 12 years ago

Original bug ID: BZ#143 From: Balazs Zsoldos <balazs.zsoldos@everit.biz> Reported version: R4 V4.3

bjhargrave commented 12 years ago

Comment author: Balazs Zsoldos <balazs.zsoldos@everit.biz>

In the end of June I would like to start enhancing one of the existing Blueprint solutions with the following features:

These are my ideas for now. Some of them may already be available somewhere. If anybody knows about that please let me know as I would not like to work unnecessarily. Also if you have any ideas please do not keep it to yourself. I would like to have a long living (almost perfect :)) solution that may is a good base for the enhancement of the specification.

If we have the metatype extension as well that can open to a pretty new word. Jdbc DataSources could be defined via admin console and also connection pools (selecting from the existing datasource services from combo boxes). And for this only some minor blueprint configuration would be necessary.

Here is an example of a managed service or managed service factory fragment (that opens a new child Bluepring Container always as a new config is available and unregisters it when the config is not available anymore):

<managed factoryPid="com.acme.designate.factory" componentIdPrefix="someUniqueAttributePid">
    <bean .... >
       <property key="a" value="${attributeName}"
    <bean>
    <reference ... />
    <service ... />      

    <choose>
        <when test="${someAttributeId eq 'value'}">

            <reference ... />
            <bean  ... />
            <service ... />

        </when>
        <when test="${parent.parent.otherAttributeId eq 'value'}">

             ...

        </when>
        <otherwise>

             ...

        </otherwise>
    </choose>

</managed>