3

since version 10 guava offers com.google.common.eventbus.EventBus - a generic pub-sub facility. It is not marked as GWT-compatible in the source. I wonder whether it's possible to plug some custom code pre-processing into gwt compiler to map this (partially annotation/reflection-based) API into javascript.

AFAIK there're some other custom extensions added into GWT java-to-js compiler, like com.google.gwt.i18n.client.ConstantsWithLookup and quite likely some others. I'd seen some experimental compiler extensions to add partial support for reflection/annotations, but not sure they're required in case we handle a specific set of annotations and simple class->methods->annotation listing is required (not a complete reflection API).

Maybe someone knows whether GWT-enabling this component is planned by guava dev team?

Thanks, Anton

Anton Kraievyi
  • 4,182
  • 4
  • 26
  • 41
  • 1
    This is probably more appropriate for guava-discuss than for StackOverflow, but Guava team member here: no, we're not planning on it. – Louis Wasserman May 09 '12 at 16:16
  • @LouisWasserman it might be a good idea to re-post your statement as an answer so that I close the question? – Anton Kraievyi May 10 '12 at 08:37
  • 2
    There is this: http://google-web-toolkit.googlecode.com/svn/javadoc/2.1/com/google/gwt/event/shared/EventBus.html – Ray May 10 '12 at 15:29
  • @Ray yup, I know about that one. A bit of disclosure: we'd evaluated GWT's EventBus and came to conclusion that our couple of extra features mandate implementing an EventBus from scratch. Now I read the samples of guava's EventBus and it's so interesting that I'd try to recode our version against it, if it's possible to port guava's EventBus to GWT – Anton Kraievyi May 10 '12 at 17:15

2 Answers2

4

This is probably more appropriate for guava-discuss than for StackOverflow, but Guava team member here: no, we're not planning on it.

Louis Wasserman
  • 191,574
  • 25
  • 345
  • 413
-1

simply already working (GWT server+client compatible) with this one: http://www.gwtproject.org/javadoc/latest/com/google/gwt/event/shared/EventBus.html

and here (Tutorial): http://www.gwtproject.org/articles/mvp-architecture.html#events

(answered also here: https://stackoverflow.com/a/28082823/1915920)

Community
  • 1
  • 1
Andreas Covidiot
  • 4,286
  • 5
  • 51
  • 96
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – mkobit Jan 22 '15 at 07:47
  • @Mike Kobit: the second link is the answer and points to the provided GWT implementation/functionality itself! Please give me a +1 instead of -1 (if you did not understand the answer itself at the start) because its the best answer you could get for such questions if the functionality is provided where it should be! Thanks anyways – Andreas Covidiot Jan 22 '15 at 08:04
  • I didn't downvote, but see [How do I write a good answer?](http://stackoverflow.com/help/how-to-answer) for information about providing context for links. – mkobit Jan 22 '15 at 08:08
  • @Mike Kobit: ok, thanks. So I moved the first link on my hasty answer to the bottom which should be fine I guess. (and had a quick look at your link) – Andreas Covidiot Jan 22 '15 at 09:32