Skip to content

Instantly share code, notes, and snippets.

@sapanparikh18
Last active April 19, 2018 10:44
Show Gist options
  • Save sapanparikh18/bc7474871a6b656d1734bc98704c545e to your computer and use it in GitHub Desktop.
Save sapanparikh18/bc7474871a6b656d1734bc98704c545e to your computer and use it in GitHub Desktop.
import java.util.HashMap;
import java.util.Map;
public class Invoice implements Subscriber {
@Override
public void update(Broker.Context ctx) {
System.out.println("tax rates changed");
}
public static void main(String[] args) {
// register to listen to events
Invoice subscriber = new Invoice();
Broker.getInstance().register(Broker.CommonTopics.ON_TAX_CHANGE,subscriber);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment