Project

General

Profile

Properties entered in init.properties not set before start() is called

Gabriel Rossetti
Added about 4 years ago

Hi All,

Please read this before:

https://projects.tigase.org/boards/4/topics/3364?r=3405#message-3405

I'm referencing this thread because I have an issue with start(). I am only doing initialization for my component in it now, but for some reason, the properties I set in init.properties are not set before start() is called (it is set at some point), so if I override a property there that I need during the start() if doesn't work... I think this is a bug personally since as you said in the above link that the start() should be used to initialize my component but I cannot do this properly because of this issue.

Thanks,

Gabriel


Replies (3)

Added by Wojciech Kapcia TigaseTeam about 4 years ago

Have you read Component Implementation - Lesson 8 - Startup Time As you can see properties are set in later steps.

Added by Gabriel Rossetti about 4 years ago

Hi Wojciech,

Thanks for the link, no I did not read it, I had not seen it when I had originally started coding my project several months ago, I may have misses it.

So start() is useful for what exactly? It says: "the component can start it’s internal jobs or worker threads or whatever it needs for future activity" but this is not true, since the internal jobs/worker threads/etc could need the properties. I'll switch to using initializationCompleted() then, no big issue.

Another question concerning properties, if they are updated va an ad-hoc command, is there a hook for this?

Thanks,

Gabriel

Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam about 4 years ago

When properties are updated/changed, then setProperties() method is called on the component. So this is your hook.

    (1-3/3)