[
https://issues.jboss.org/browse/ISPN-893?page=com.atlassian.jira.plugin.s...
]
Galder Zamarreño edited comment on ISPN-893 at 2/17/11 12:29 PM:
-----------------------------------------------------------------
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}
was (Author: galder.zamarreno(a)jboss.com):
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