I\'m using Guava\'s EventBus to kick off some processing and report results. Here\'s a very simple compilable example:
import com.google.common.eventbus.EventBu
EventBus
generally operates on the principle that the code posting an event to the bus shouldn't care about what the subscribers do with the events or when, other than that the order the events were posted in is respected (in the case of a synchronous event bus anyway).
If you want specific methods to be called at specific times in the course of your method and you want to be sure those methods complete before your method continues (as you seem to in your example), why not call those methods directly? When you use an event bus, you're explicitly separating your code from what exactly happens in response to a given event. This is desirable in many cases and is the main reason EventBus
exists, but it doesn't seem to be quite what you want here.