well if you have a managed service factory the service is only created
if the corresponding configuration is available.
If you depend on config files they do have to have the following
scheme for its pid: x.y.z-service.cfg
where x.y.z is the standard pid and the -service is the name (or
marker) for the manged service instance.
This only works if you have some tool like Fileinstall (which is
out-of-the-box provided by karaf/servicemix) that
does look for such files, and which does promote those configurations
to the configuration admin service.
Still you need to make sure you not only have a managed service but a
managed service factory that
does create a service for each configuration (FileInstall itself uses
it, but without blueprint :) )

To come back to the other question about waiting for a missing
property, I'm not sure blueprint does it
(or aries as the implentation). But with this all your dependent
services won't start.

regards, Achim


2012/6/13 James Carman <[email protected]>:
> It would be great if I could get blueprint to spit out a message when
> I'm missing a property and stall the startup of the container like it
> does when you don't have a required dependency!
>
> On Wed, Jun 13, 2012 at 11:35 AM, Christian Schneider
> <[email protected]> wrote:
>> I am not sure about stalling the start but
>> update-strategy="reload"
>> makes the blueprint context restart when the config is changed. So it will
>> always reflect the newest config. In most cases this is good enough.
>>
>> The config admin service always handles complete configs so it is more about
>> the file than the property.
>>
>> Christian
>>
>> Am 13.06.2012 17:07, schrieb James Carman:
>>>
>>> I looked at Christian's tutorial here:
>>>
>>>
>>> http://www.liquid-reality.de/display/liquid/2011/09/23/Karaf+Tutorial+Part+2+-+Using+the+Configuration+Admin+Service
>>>
>>> However, I don't see anything that specifically says that the
>>> Blueprint container will not start until the configuration is
>>> provided.  Also, does this mean that the configuration file is there
>>> or that each property I try to reference is there?
>>>
>>> On Wed, Jun 13, 2012 at 11:00 AM, Achim Nierbeck
>>> <[email protected]>  wrote:
>>>>
>>>> Hi James,
>>>>
>>>> you need to use managed Services via the Configuration Admin service.
>>>> Take a look at the blueprint documentation to find some more details
>>>> on how to create that.
>>>> Or take a look at some of those tutorials christian did. (I'm sure he
>>>> has a link in his signature :) )
>>>>
>>>> regards, Achim
>>>>
>>>> 2012/6/13 James Carman<[email protected]>:
>>>>>
>>>>> On Tue, Jun 12, 2012 at 4:59 PM, Christian Schneider
>>>>> <[email protected]>  wrote:
>>>>>>
>>>>>>
>>>>>> You probably use start levels to work around this. OSGi services and
>>>>>> blueprint should help you
>>>>>> with this. You can make sure bundles only start when required services
>>>>>> or
>>>>>> configs are present.
>>>>>>
>>>>> We actually don't mess with start levels.  Blueprint will put the
>>>>> bundle into the "Grace Period" until it finds everything it needs.
>>>>> However, I am intrigued by that last part there where you said I can
>>>>> tell BP to only start when required configs are present.  How do I
>>>>> stall the BP startup when configs aren't present?
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Apache Karaf<http://karaf.apache.org/>  Committer&  PMC
>>>>
>>>> OPS4J Pax Web<http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>>>> Committer&  Project Lead
>>>> OPS4J Pax for Vaadin
>>>> <http://team.ops4j.org/wiki/display/PAXVAADIN/Home>  Commiter&  Project
>>>> Lead
>>>> blog<http://notizblog.nierbeck.de/>
>>
>>
>>
>> --
>> Christian Schneider
>> http://www.liquid-reality.de
>>
>> Open Source Architect
>> Talend Application Integration Division http://www.talend.com
>>



-- 

Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
Committer & Project Lead
OPS4J Pax for Vaadin
<http://team.ops4j.org/wiki/display/PAXVAADIN/Home> Commiter & Project
Lead
blog <http://notizblog.nierbeck.de/>

Reply via email to