Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kodi] Thing handler factory with null annotations and constructor injection #8075

Merged
merged 2 commits into from
Jul 5, 2020

Conversation

lolodomo
Copy link
Contributor

@lolodomo lolodomo commented Jul 4, 2020

Signed-off-by: Laurent Garnier [email protected]

@lolodomo lolodomo requested review from cweitkamp and pail23 as code owners July 4, 2020 15:45
@TravisBuddy
Copy link

Travis tests were successful

Hey @lolodomo,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

Signed-off-by: Laurent Garnier <[email protected]>
@TravisBuddy
Copy link

Travis tests were successful

Hey @lolodomo,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

Copy link
Contributor

@cweitkamp cweitkamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Nice little improvement.

this.networkAddressService = networkAddressService;
this.stateDescriptionProvider = stateDescriptionProvider;
this.webSocketClient = webSocketFactory.getCommonWebSocketClient();
}

@Override
protected void activate(ComponentContext componentContext) {
Copy link
Contributor

@cweitkamp cweitkamp Jul 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add @Activate annotation here too. Otherwise this method will be ignored in favor of all annotated activation methods.

Another option would be to pass the ComponentContext parameter to the constructor and move all the logic inside this method into the constructor too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excuse me but I have a serious doubt. Please look at the handler factory for the Sonos and LGwebOS bindings for example. They are done like that. If activate method was not called, the LGwebOS binding would just not work at all a(s the WebSocket client would not be started).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, interesting. I do not have a clue why it is working but it seems to work.

@cweitkamp cweitkamp merged commit eba4892 into openhab:2.5.x Jul 5, 2020
@lolodomo lolodomo deleted the kodi_constructorinjection branch July 5, 2020 09:52
@cpmeister cpmeister added this to the 2.5.7 milestone Jul 7, 2020
knikhilwiz pushed a commit to knikhilwiz/openhab2-addons that referenced this pull request Jul 12, 2020
…jection (openhab#8075)

* [kodi] Thing handler factory with null annotations and constructor injection

Signed-off-by: Laurent Garnier <[email protected]>
CSchlipp pushed a commit to CSchlipp/openhab-addons that referenced this pull request Jul 26, 2020
…jection (openhab#8075)

* [kodi] Thing handler factory with null annotations and constructor injection

Signed-off-by: Laurent Garnier <[email protected]>
Signed-off-by: CSchlipp <[email protected]>
MPH80 pushed a commit to MPH80/openhab-addons that referenced this pull request Aug 3, 2020
…jection (openhab#8075)

* [kodi] Thing handler factory with null annotations and constructor injection

Signed-off-by: Laurent Garnier <[email protected]>
Signed-off-by: MPH80 <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
…jection (openhab#8075)

* [kodi] Thing handler factory with null annotations and constructor injection

Signed-off-by: Laurent Garnier <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
…jection (openhab#8075)

* [kodi] Thing handler factory with null annotations and constructor injection

Signed-off-by: Laurent Garnier <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
…jection (openhab#8075)

* [kodi] Thing handler factory with null annotations and constructor injection

Signed-off-by: Laurent Garnier <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
…jection (openhab#8075)

* [kodi] Thing handler factory with null annotations and constructor injection

Signed-off-by: Laurent Garnier <[email protected]>
DaanMeijer pushed a commit to DaanMeijer/openhab-addons that referenced this pull request Sep 1, 2020
…jection (openhab#8075)

* [kodi] Thing handler factory with null annotations and constructor injection

Signed-off-by: Laurent Garnier <[email protected]>
Signed-off-by: Daan Meijer <[email protected]>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this pull request Sep 19, 2020
…jection (openhab#8075)

* [kodi] Thing handler factory with null annotations and constructor injection

Signed-off-by: Laurent Garnier <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants