@ViewChanged
	public synchronized void onViewChangeEvent(ViewChangedEvent event) {
		
		if (logger.isDebugEnabled()) {
			logger.debug("onViewChangeEvent : pre[" + event.isPre() + "] : event local address[" + event.getCache().getLocalAddress() + "]");
		}
		
		final List<Address> oldView = currentView;
		currentView = new ArrayList<Address>(event.getNewView().getMembers());
		final Address localAddress = getLocalAddress();
		
		//just a precaution, it can be null!
		if (oldView != null) {
			final Cache jbossCache = mobicentsCache.getJBossCache();
			final Configuration config = jbossCache.getConfiguration();		

			final boolean isBuddyReplicationEnabled = config.getBuddyReplicationConfig() != null && config.getBuddyReplicationConfig().isEnabled();
			// recover stuff from lost members
			Runnable runnable = new Runnable() {
				public void run() {
					for (Address oldMember : oldView) {
						if (!currentView.contains(oldMember)) {
							if (logger.isDebugEnabled()) {
								logger.debug("onViewChangeEvent : processing lost member " + oldMember);
							}
							for (FailOverListener localListener : failOverListeners) {
								ClientLocalListenerElector localListenerElector = localListener.getElector();
								if (localListenerElector != null && !isBuddyReplicationEnabled) {
									// going to use the local listener elector instead, which gives results based on data
									performTakeOver(localListener,oldMember,localAddress, true, isBuddyReplicationEnabled);
								}
								else {
									
									List<Address> electionView = getElectionView(oldMember);
									if(electionView!=null && elector.elect(electionView).equals(localAddress))
									{
										performTakeOver(localListener, oldMember, localAddress, false, isBuddyReplicationEnabled);
									}
									
									cleanAfterTakeOver(localListener, oldMember);
								}
							}
						}
					}
				}
			};
			Thread t = new Thread(runnable);
			t.start();
		}
		
	}
@ ViewChanged public synchronized void onViewChangeEvent ( ViewChangedEvent event ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "onViewChangeEvent : pre[" + event . isPre ( ) + "] : event local address[" + event . getCache ( ) . getLocalAddress ( ) + "]" ) ; } final List < Address > oldView = currentView ; currentView = new ArrayList < Address > ( event . getNewView ( ) . getMembers ( ) ) ; final Address localAddress = getLocalAddress ( ) ; if ( oldView != null ) { final Cache jbossCache = mobicentsCache . getJBossCache ( ) ; final Configuration config = jbossCache . getConfiguration ( ) ; final boolean isBuddyReplicationEnabled = config . getBuddyReplicationConfig ( ) != null && config . getBuddyReplicationConfig ( ) . isEnabled ( ) ; Runnable runnable = new Runnable ( ) { public void run ( ) { for ( Address oldMember : oldView ) { if ( ! currentView . contains ( oldMember ) ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "onViewChangeEvent : processing lost member " + oldMember ) ; } for ( FailOverListener localListener : failOverListeners ) { ClientLocalListenerElector localListenerElector = localListener . getElector ( ) ; if ( localListenerElector != null && ! isBuddyReplicationEnabled ) { performTakeOver ( localListener , oldMember , localAddress , true , isBuddyReplicationEnabled ) ; } else { List < Address > electionView = getElectionView ( oldMember ) ; if ( electionView != null && elector . elect ( electionView ) . equals ( localAddress ) ) { performTakeOver ( localListener , oldMember , localAddress , false , isBuddyReplicationEnabled ) ; } cleanAfterTakeOver ( localListener , oldMember ) ; } } } } } } ; Thread t = new Thread ( runnable ) ; t . start ( ) ; } }
Method handle a change on the cluster members set
@param event