4 Replies Latest reply on Jan 16, 2013 12:54 PM by Eduardo Ribeiro Silva

    Seam+CDI Event Probleam - Observer does not work

    Eduardo Ribeiro Silva Newbie

      Hi all,


      I'm in trouble with Observers.

      I have a superclass that fire event and another class responsible for observe the event, but it's not working.


      My superclass:


      public abstract class AbstractCrudModel<T> implements Serializable {




          protected Event<T> evtUpdate;


          public String update() {

              T loaded = findSelectedById();


              if (loaded != null) {

                  T t = doUpdate();

                  if (t != null) {



              } else {

                  messages.warn(new BundleKey("messages", "registro_nao_encontrado_atualizacao"));



              list = queryList();


              return crudController().urlBegin();




      My concrete model class:





      public class ManterTipoAutorizacaoModel extends AbstractCrudModel<TipoAutorizacao> {



          public TipoAutorizacao doUpdate() {



              return entitySelected;




      My Observer:


      public class PersistenceEvent {



          private Messages msg;


          public void onAtualizar(@Observes(during=TransactionPhase.AFTER_SUCCESS) @Update final TipoAutorizacao tipoAutorizacao) {

              msg.info(new BundleKey("messages", "registro_atualizado_sucesso"));




      Any idea?