Code example for EventBus

Methods: register

0
 
	private EventBus eventBus = EventBusFactory.getInstance();
	private List<Object> subscribers = new ArrayList<Object>();
 
	public void register(Object subscriber) { 
		eventBus.register(subscriber);
		subscribers.add(subscriber); 
	} 
 
	public void unregisterAll() { 
		for (Object subscriber : subscribers) { 
			eventBus.unregister(subscriber);
		} 
	} 
 
}