While you have made your TimerTask serializable that doesn't mean that it can be used in a distributed fashion. The TimerTask only works when confined in a single JVM to individual instances. By serializing this on node1 and then deserializing on node2 you have created a different instance on a different JVM, the cancel can't work in that case. The reason it works on node1 is because we are storing the same reference you provided to us in the cache, so you are actually cancelling it. There would be a requirement to send a message to node1 from node2 to start/stop the task somehow. Are you specifically looking for a reoccurring cancellable clustered task ? We have the distributed execution framework http://infinispan.org/docs/6.0.x/user_guide/user_guide.html#_distributed_execution_framework which doesn't have the reoccurring portion, but does allow for executing tasks on various nodes of the cluster.
when i added keys to node1 it is added once to the cache,,but when i am removing keys on node1 why it is removing twice...in the cache ??? Is there any problem with logger or it will be like that only ??
This is how our local listeners work. We raise the event up to twice, the first time before the modification occurs and then after it is completed. This is especially important for transaction caches as the second notification can come quite a bit later during the commit. Event (Infinispan Distribution 6.0.0.Final API)
Dear William Burns ,
Thanks for giving Response,
How it is working(timertasks are cancelling successfully) with two nodes and numOwners=2 ???
I am using 30 Timers in my application And I want to serialize those TimerTasks ..I don't want to use Distributed Execution Framework ,,it is not suitable to my application..Because i cannot acheive TimerTask functionality(schedule at fixed rate ,, to cancel the scheduled task) through DistributedCallable .
1.Is there any function to make scheduledWithFixedDelay means ScheduledExecutorService??
2.With Future we can cancel the tasks but that Future is not serialized..??
So,Is there any alternative solution for this.???? Is Infinispan is Suitable to this type of applications???
Kindly respond to this..