Code example for EventBus

Methods: post

0
	public Publisher(EventBus eventBus) {
		this.eventBus = eventBus;
	} 
 
	public void publishMsgEvent(String message) {
		eventBus.post(new MsgEvent(message));
	} 
 
	public void publishSpecialMsgEvent(String message, String user) {
		eventBus.post(new SpecialMsgEvent(message, user));
	} 
 
	public void publishTimeEvent() { 
		eventBus.post(new TimeEvent(new Date()));
	} 
 
} 
Contextual code suggestions in your IDE  Get Codota for Java