Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse SmartHome » Posting custom command types on the event bus
Posting custom command types on the event bus [message #1734700] Fri, 10 June 2016 12:14 Go to next message
Adam Gillmore is currently offline Adam GillmoreFriend
Messages: 3
Registered: May 2016
Junior Member
I am developing a binding and I have created a custom command type (i.e. implements Command and State). When I post a new ItemCommandEvent (created using the ItemEventFactory) on the EventBus I get a ClassNotFoundException because the ItemEventFactory calls Class<?>.forname() and passes in a path to the type using concatenation of the Command name and the hard-coded string "org.eclipse.smarthome.core.library.types", however my Command class is in my package, not in the core.library.type package.

It would appear from this that the ItemEventFactory expects all commands to be of the core type and cannot be used to post events with custom command types. Is it intended that developers are able to create custom commands, and if so what is the preferred method of posting ItemCommandEvents with them, given that a factory is needed to create the Event?


Re: Posting custom command types on the event bus [message #1735357 is a reply to message #1734700] Fri, 17 June 2016 15:33 Go to previous message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 657
Registered: December 2011
Senior Member
> Is it intended that developers are able to create custom commands

This was once the idea in openHAB 1, but we actually reverted this idea as it had all kinds of issues (like the one you describe). So as a matter of fact, only core command types exist. If people want to do something very specific, they usually fall back to String commands and build their own interpretation on top of it.

What command type would you like to introduce? Is it something that should be considered to add to the core types for everyone?

Regards,
Kai
Previous Topic:How to know when the an UI is used
Next Topic:Dynamically created channels are not shown
Goto Forum:
  


Current Time: Sat Sep 22 04:54:25 GMT 2018

Powered by FUDForum. Page generated in 0.01853 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top