Spring

 

My App

(Capa de negocio)

 

HTTP Req

MixIns /

JsonComponent

Callbacks

EntityListener

Emisor

Eventos

Evento A

Evento B

Evento C

Listener

Listener

0: subscribe

(evento concreto C)

Listener

subscribe

(evento B)

1: new

Listener

2: accept(event)
3: //do something
public class EmisorEventos {

  // 0: subscripcion
  void addListener(Listener listener) {...}
  
  void foo() {
    ...
    if (happensEventC) {
      Event event = new EventC(bar); // 1
      for (Listener l : getListeners()) {
        if (l.listenFor(event)) { // filtro
          l.accept(event); // 2
        }
      }
    }
    ...
  }

}

Listener

Listener

Diagramas Spring

By Lanyu EStudio

Diagramas Spring

  • 1,190