Event APIs for Life Events

To understand this section the reader must be familiar with the contents that precede this section in this Chapter. The Life Event Broker is instrumented with Guice events. Developers can write listeners that can be bound to these events. The available events are:

Note that both the Pre and Post SubmitLifeEvent events are executed from within a Deferred Process so the current user is expected to be SYSTEM. Life Event Events should never attempt to change the contents of the Life Event. The code extract below shows how a Listener class, MyPreCreateListener can be bound to one of these Life Events:

Multibinder<LifeEventEvents.PreCreateLifeEvent>
   preCreateBinder = 
    Multibinder.newSetBinder(binder(),
      new TypeLiteral<LifeEventEvents.PreCreateLifeEvent>() { /**/
    });
    
  preCreateBinder.addBinding().to(MyPreCreateListener.class);