I forgot to ask this question... Is notLeader() method designed to be called when the session is closed?
On Tue, Nov 12, 2013 at 12:23 AM, Bae, Jae Hyeon <[email protected]> wrote: > Hello > > When I was testing with LeaderLatch recipe, I created two LeaderLatches > and closed the first one which was the original leader. I expected > notBecome method of listener which was added to the first one, but it was > not because close() method is removing LeaderLatchListener. > > For example, > > LeaderLatchListener listener1 = new LeaderLatchListener(...); > LeaderLatch latch1 = new LeaderLatch(...); > latch1.addListener(listener1); > latch1.start(); > ... > > LeaderLatchListener listener2 = new LeaderLatchListener(...); > LeaderLatch latch2 = new LeaderLatch(...); > latch2.addListener(listener1); > latch2.start(); > ... > latch1.close(); > // here I expected listener1.notBecome() method would be called but it was > not. > > When is notLeader method is called? > > Thank you > Best, Jae > > > >
