-
1. Re: How to listen to network connected and disconnected even
manik Dec 13, 2008 5:35 AM (in response to nachiket_patel)Look at the @ViewChanged annotation, with which you can annotate methods on registered @CacheListener objects so that they are invoked whenever a change in the cluster membership is detected.
-
2. Re: How to listen to network connected and disconnected even
nachiket_patel Dec 15, 2008 1:36 AM (in response to nachiket_patel)Yes,
Thank you for guidance.
But i want to listen to own computer's events also,
When i disable Network, so application shows exception stack, which i think handled interally, I want to catch it in my code [or listen to events]. -
3. Re: How to listen to network connected and disconnected even
brian.stansberry Dec 15, 2008 12:55 PM (in response to nachiket_patel)You can implement the org.jgroups.ChannelListener interface (http://www.jgroups.org/javagroupsnew/docs/javadoc/org/jgroups/ChannelListener.html ). You register your impl with the org.jgroups.Channel used by the cache via the Channel.add/removeChannelListener(ChannelListener listener) methods. You get a ref to the channel from a started cache via cache.getConfiguration().getRuntimeConfig().getChannel().
As with all JGroups callbacks, be careful not to execute long running tasks in the thread that invokes the listener callbacks. And don't try to use that thread to do anything that results in sending messages to the cluster. -
4. Re: How to listen to network connected and disconnected even
nachiket_patel Dec 15, 2008 10:36 PM (in response to nachiket_patel)Hi,
I added as you said, but no event is fired.
I am using GossipRouter, When i stop gossip router, i get these error printed internally. But event is not fired and executed.
2008-12-16 09:05:01,553 ERROR [GossipClient] (Timer-4,150.0.149.105:7800) exception connecting to host 150.0.149.105:5555
2008-12-16 09:05:02,756 ERROR [GossipClient] (Timer-1) exception connecting to host 150.0.149.105:5555
Any Hint??? -
5. Re: How to listen to network connected and disconnected even
nachiket_patel Dec 15, 2008 11:54 PM (in response to nachiket_patel)Hello,
I am using TCP and GossipRouter.
No event is getting fired.
I change it to UDP and still no event is fired.
But Guess what? when i disconnect network of one UDP app instance, and at the time of connection of network , event got fired.
?????? I am getting more and more confused................