Oleg,
Just to let you know what I am trying to do. I am trying to fire events from a UI. The SeachEvent object carries an enum saying whether the user action was a reset-filter or a filter-text change event type. Here's the two implementations I was playing with.
Code:
@Publisher(value = "#return", channel = "eventChannel")
public SearchEvent reset() {
log.debug("Resetting the search component...");
// Handle local object specific reset behavior.
textField.setText(null);
// Issue the event object as the return value.
return new SearchEvent(this);
}
@Publisher(channel = "eventChannel.reset")
public void reset2() {
log.debug("Resetting the search component...");
// Handle local object specific reset behavior.
textField.setText(null);
}
I get an event fired on the first but not on the second I think because of the void returning behavior. The idea is to not only have a handler that is simply defined as
Code:
public void reset() {...}
in another class that should handle the event but also to issue it simply as well.
On the message endpoint side and based on your previous response, it is clear that I can simply define a channel with a specific naming scheme to make this easily happen. I am comparing this to eventbus.org's library for swing applications. There, you can subscribe by event object type or a "string". In SI, it looks like could define an easy router to route from the main channel to a channel whose name is derived from the event object type or an enum (or whatever) and subscribe to it that way. That parts looks straight forward now. Just having problems issuing events in the way I would like.