Dear all,
I created a region named Operation.
What I want to do is to get notified upon creating or updating record in
this region.
Following are my code segments:
*Listener (named OperationCacheListener):*
public void afterCreate(EntryEvent event) {
iEvent message = (iEvent) event.getNewValue();
if(message instanceof CmdStartCSS)
{
logger.debug("[OperationCacheListener][Command: Start][Key: {}]");
try {
CmdStartCSS command = (CmdStartCSS) event.getNewValue();
DialManager.getInstance().Start(command);
}
catch(Exception e)
{
logger.error("[OperationCacheListener][Start][{}][Exception: {}]",
e.getClass().getSimpleName(), e.getMessage());
}
}
else if(message instanceof CmdStopCSS)
{
logger.debug("[OperationCacheListener][Command: Stop][Key: {}]");
try {
DialManager.getInstance().Stop();
} catch (Exception e) {
//
}
}
}
public void afterUpdate(EntryEvent event)
{
System.err.println("Region entry was updated.");
}
*How I initiate the listener:*
this.listener = new OperationCacheListener();
this.OperationRegion = cache
.<String,
iEvent>createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY)
.initCacheListeners(new CacheListener[]
{this.listener})
.create(OperationRegionName);
*PROBLEM:*
When I am to create/update a record in this region, my events are not
triggered.
Could you please check and tell me where I am wrong or missing? (If you
have a sample code on this matter, I will be glad).
Thank you in advance.
--
Saygılarımla, with my warm regards,
Ali KOYUNCU