1 Reply Latest reply on Aug 23, 2011 2:53 PM by pmuir

    Confusion in Cmmad Event and Interceptor

    meenarajani

      Hi

       

        As going through Infinispan API I am wondering why there is package for commands and events both? for example there is an event which is InvalidateCommand and CacheEntryInvalidatedEvent. Does former has to do something with clustered and later(CacheEntryInvalidatedEvent) is just for the local node. It sounds like it should be when ever an invalidatecommand is visited the CacheEntryInvalidatedEvent should be triggered. But I can not see this relationship in the packages. Also why there are  both interceptors and listeners?

       

      Regards

       

      Meena

        • 1. Re: Confusion in Cmmad Event and Interceptor
          pmuir

          Commands are used by Infinispan internally to perform operations on remote nodes, as well as some local operations. Events are fired by Infinispan so that user code can react to cache events. So one is an impl detail (commands) and one is a user api (events).

           

          Interceptors are also used for internal purposes and to extend infinispan, whilst listeners are a user api.