felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <XavierMillie...@Eaton.com>
Subject RE: Ipojo property
Date Thu, 18 Jul 2013 10:08:16 GMT
Hi Clement,

Thank for you answer, here my ascertainment, when I start the bundle, the updated method is
called twice, once the bundle is started, and if the file is modified, the method is called
one time.

Regards

Xavier



-----------------------------

-----------------------------

-----Message d'origine-----
De : Clement Escoffier [mailto:clement.escoffier@gmail.com] 
Envoyé : jeudi 18 juillet 2013 11:54
À : users@felix.apache.org
Objet : Re: Ipojo property

Hi,

The @Updated callback is called whenever an update is pushed. 
Do you see differences in the given configuration ? If so, iPOJO has detected an update, so
invoke the callback. If not, it may be a bug.

Regards,

Clement


On 16 juil. 2013, at 11:01, XavierMillieret@Eaton.com wrote:

> No, I use Ipojo to doing all stuff (like you present me yesterday)
> 
> 
> 
> -----------------------------
> 
> -----------------------------
> 
> -----Message d'origine-----
> De : Guillaume Sauthier (OW2/GMail) [mailto:guillaume.ow2@gmail.com] 
> Envoyé : mardi 16 juillet 2013 11:00 À : users@felix.apache.org Objet 
> : Re: Ipojo property
> 
> Do you implement yourself the ManagedService interface ?
> 
> 
> 2013/7/16 <XavierMillieret@eaton.com>
> 
>> Hi Guillaume,
>> 
>> Updated method (with the ipojo annotation.
>> @Updated
>> public void updated(Dictionary conf) {
>>        System.out.println("updated ");  }
>> 
>> I would like doing something when my config file is modified, but 
>> this method is called twice, at the bundle start
>> 
>> 
>> 
>> -----------------------------
>> 
>> -----------------------------
>> 
>> -----Message d'origine-----
>> De : Guillaume Sauthier (OW2/GMail) [mailto:guillaume.ow2@gmail.com] 
>> Envoyé : mardi 16 juillet 2013 09:32 À : users@felix.apache.org Objet
>> : Re: Ipojo property
>> 
>> What method ?
>> Is this an @Modified or @Updated method ?
>> Or do you directly implement ManagedService interface ?
>> I need a little bit of context :)
>> --G
>> 
>> 
>> 2013/7/16 <XavierMillieret@eaton.com>
>> 
>>> Hi,
>>> 
>>> I have a short question, about this feature, why the method: public 
>>> void updated(Dictionary conf) is called twice, when the bundle starts ??
>>> 
>>> Best regards
>>> 
>>> 
>>> 
>>> -----------------------------
>>> 
>>> -----------------------------
>>> 
>>> -----Message d'origine-----
>>> De : guillaume.ow2@gmail.com [mailto:guillaume.ow2@gmail.com] De la 
>>> part de Guillaume Sauthier (OW2) Envoyé : lundi 15 juillet 2013
>>> 13:44 À : users@felix.apache.org Objet : Re: Ipojo property
>>> 
>>> This is not a simple property file, it's a file for configAdmin service.
>>> ConfigAdmin takes properties as input and try to apply them on a 
>>> factory or an instance of component.
>>> So, you have to tell config admin which component you're targetting 
>>> with your configuration file.
>>> 
>>> Using fileinstall (the thing that read your .cfg file), the target 
>>> ID is specified reading the file name:
>>> 
>>> http://felix.apache.org/site/apache-felix-file-install.html#ApacheFe
>>> li
>>> xFileInstall-Configurations
>>> 
>>> So, your file is named mypackage.MyComponent.cfg As per the doc, it 
>>> targets a component instance named 'myPackage.MyComponent'.
>>> But you don't provide any name to your instance.
>>> 
>>> To sum up:
>>> 1. Rename your file to 'MyComponent-default.cfg' (since 'MyComponent'
>>> is the @Component.name you set) 2. Remove the @Instantiate 
>>> (ConfigAdmin WILL instantiate a new component instance for you)
>>> 
>>> --Guillaume
>>> 
>>> 
>>> 2013/7/15 <XavierMillieret@eaton.com>
>>> 
>>>> Hi All,
>>>> 
>>>> I would like to know, if it's possible with IPOJO to retrieve any 
>>>> property from a property file, because after reading any 
>>>> documentation about this, normally, yes, but this code does not 
>>>> work !! some help
>>> please ?
>>>> 
>>>> package mypackage
>>>> 
>>>> @Component(name = "MyComponent ", immediate = true, propagation =
>>>> true) @Instantiate @Provides public class MyComponent {
>>>> 
>>>>    private static Logger logger =
>>>> LoggerFactory.getLogger(MessageBusTransport.class);
>>>>    @Property(name = "myProperty")
>>>>    public void myProperty (String myProperty) {
>>>>        this. myProperty = myProperty;
>>>>    }
>>>> 
>>>>    /**
>>>>     * Try to connect with a AMQP MOM.
>>>>     *
>>>>     * @throws MessageBusException
>>>>     */
>>>>    @Validate
>>>>    public void starting(){
>>>>        logger.debug(MessageBusTransport.class.getSimpleName() + " :
>>>> starting...");
>>>> 
>>>>        System.out.println(myProperty); }
>>>> 
>>>> .....
>>>> 
>>>> With Karaf I put my property file under /etc, and the name, is:
>>>> mypackage.MyComponent.cfg
>>>> 
>>>> In the file
>>>> myProperty=myValue
>>>> 
>>>> 
>>>> So ???????
>>>> 
>>>> Thanks you for help
>>>> 
>>>> 
>>>> 
>>>> ________________________________
>>>> 
>>>> ________________________________
>>>> 
>>>> 
>>>> 
>>> 
>>> --------------------------------------------------------------------
>>> - To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>> 
>>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message