configurable blueprints

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

configurable blueprints

jamiecampbell
This might be a stupidly easy question or an unsolveable one.  I
googled, checked the r4.core and r4.cmpn , and the felix and aries
sites, wasn't able to find the answer.

I'm trying to take the next logical step with openjpa in karaf : a
configurable datasource.  The blog sample has a blueprint file
specifying a hard coded database name, blogDB.  I put together a bundle
for datasource configuration management, and started writing my own
derby bundle.  It's easy to get my derby bundle to access the common
datasource config (databasename, host, username, password, etc), but
.... then what?  I referenced the blog-datasource bundle, and I can't
tell whether I'm able to write a blueprint file referencing
configuration, like $dbname_param style, or whether I can bypass using a
blueprint.xml and instead register the services "in code".  If I
register them in code, I'm not sure how to translate blueprint.xml
syntax into equivalent in-code context.registerService() calls.

I'll gladly rtfm if there's an fm to r and someone can point me at it :)
, otherwise help is much appreciated...

-Jamie
Reply | Threaded
Open this post in threaded view
|

Re: configurable blueprints

David Jencks

On Jun 30, 2010, at 2:35 PM, jamie campbell wrote:

> This might be a stupidly easy question or an unsolveable one.  I googled, checked the r4.core and r4.cmpn , and the felix and aries sites, wasn't able to find the answer.
>
> I'm trying to take the next logical step with openjpa in karaf : a configurable datasource.  The blog sample has a blueprint file specifying a hard coded database name, blogDB.  I put together a bundle for datasource configuration management, and started writing my own derby bundle.  It's easy to get my derby bundle to access the common datasource config (databasename, host, username, password, etc), but .... then what?  I referenced the blog-datasource bundle, and I can't tell whether I'm able to write a blueprint file referencing configuration, like $dbname_param style, or whether I can bypass using a blueprint.xml and instead register the services "in code".  If I register them in code, I'm not sure how to translate blueprint.xml syntax into equivalent in-code context.registerService() calls.
>
> I'll gladly rtfm if there's an fm to r and someone can point me at it :) , otherwise help is much appreciated...

I don't think there's a manual yet.  I think you are looking for blueprint config admin support, which is currently partly described in an osgi spec under development.  There are some namespace handlers that do some of this in a not-yet-spec way in aries blueprint, IIRC the module is something like blueprint-cm.

thanks
david jencks



>
> -Jamie

Reply | Threaded
Open this post in threaded view
|

Re: configurable blueprints

Lin Sun
In reply to this post by jamiecampbell
In addition to what David has mentioned, you can also check out the
blueprint/blueprint-sample 's blueprint XML definition file, while it
uses the Aries blueprint config admin impl and specify property, like
-

        <cm:property-placeholder id="property-placeholder"
                persistent-id="blueprint-sample-placeholder">
                <cm:default-properties>
                        <cm:property name="key.b" value="-1" />
                </cm:default-properties>
        </cm:property-placeholder>

HTH

Lin

On Wed, Jun 30, 2010 at 5:35 PM, jamie campbell <[hidden email]> wrote:

> This might be a stupidly easy question or an unsolveable one.  I googled,
> checked the r4.core and r4.cmpn , and the felix and aries sites, wasn't able
> to find the answer.
>
> I'm trying to take the next logical step with openjpa in karaf : a
> configurable datasource.  The blog sample has a blueprint file specifying a
> hard coded database name, blogDB.  I put together a bundle for datasource
> configuration management, and started writing my own derby bundle.  It's
> easy to get my derby bundle to access the common datasource config
> (databasename, host, username, password, etc), but .... then what?  I
> referenced the blog-datasource bundle, and I can't tell whether I'm able to
> write a blueprint file referencing configuration, like $dbname_param style,
> or whether I can bypass using a blueprint.xml and instead register the
> services "in code".  If I register them in code, I'm not sure how to
> translate blueprint.xml syntax into equivalent in-code
> context.registerService() calls.
>
> I'll gladly rtfm if there's an fm to r and someone can point me at it :) ,
> otherwise help is much appreciated...
>
> -Jamie
>