private void undeployComponents ( Collection < ComponentContext < ? > > components , final CountingCompletionHandler < Void > complete ) { for ( final ComponentContext < ? > component : components ) { final CountingCompletionHandler < Void > counter = new CountingCompletionHandler < Void > ( component . instances ( ) . size ( ) ) ; counter . setHandler ( new Handler < AsyncResult < Void > > ( ) { @ Override public void handle ( AsyncResult < Void > result ) { if ( result . failed ( ) ) { complete . fail ( result . cause ( ) ) ; } else { // Remove the component's context from the cluster. data . remove ( component . address ( ) , new Handler < AsyncResult < String > > ( ) { @ Override public void handle ( AsyncResult < String > result ) { if ( result . failed ( ) ) { complete . fail ( result . cause ( ) ) ; } else { complete . succeed ( ) ; } } } ) ; } } } ) ; undeployInstances ( component . instances ( ) , counter ) ; } }
Undeploys all network components .