ObserverGateway is another Messaging Gateway (468), this time between the observer (not shown) and the messaging system. The observer creates the gateway, then uses attach() to start the connection (which is analogous to calling the Attach(Observer) method in the Observer pattern). The gateway is an Event-Driven Consumer (498), so it implements the MessageListener interface, which requires the onMessage method. In this way, when an update is received, the gateway processes the message to get the new state and calls its own update(String) method, which then calls the corresponding message in
  
  ...more




