[infinispan-issues] [JBoss JIRA] Commented: (ISPN-893) Addtional attribute on @CacheEntryCreated to get on pre notifications only

Galder Zamarreño (JIRA) jira-events at lists.jboss.org
Thu Feb 17 12:30:13 EST 2011


    [ https://issues.jboss.org/browse/ISPN-893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12583057#comment-12583057 ] 

Galder Zamarreño commented on ISPN-893:
---------------------------------------

Patrick, none of the annotations take parameter. If you only want notifications when isPre=true, code your listener accordingly, iow, wrap around your code around an if statement for e.isPre(), i.e.

{code}
   @Listener(sync = false)
   public static class AsyncListener extends AbstractListener {
      public AsyncListener(CountDownLatch latch) {
         super(latch);
      }

      @CacheEntryCreated
      public void handle(CacheEntryCreatedEvent e) {
         if (e.isPre()) {
            caller = Thread.currentThread();
            latch.countDown();
         }
      }
   }
{code}

> Addtional attribute on @CacheEntryCreated to get on pre notifications only
> -----------------------------------------------------------------------------
>
>                 Key: ISPN-893
>                 URL: https://issues.jboss.org/browse/ISPN-893
>             Project: Infinispan
>          Issue Type: Enhancement
>          Components: Listeners
>    Affects Versions: 4.2.1.Final
>         Environment: ALL
>            Reporter: Sudheer Krishna
>            Assignee: Galder Zamarreño
>            Priority: Minor
>
> I may have usescases where i need notifications only when isPre = true. I was expecting a parameter to be taken by @CacheEntryCreated. But this doesnt seem to take any parametres.
> Aslo i would like similar values on  @CacheEntryremoved also.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the infinispan-issues mailing list