Finishing your Federation Execution

To finish your Federation Execution, you need to resign and “try” to destroy it. You will just “try” to destroy because it will raise an error if some Federate still connected to the Federation.

rtiamb.resignFederationExecution( ResignAction.DELETE_OBJECTS );
try {
  rtiamb.destroyFederationExecution( "MyFederationName" );
} catch( FederationExecutionDoesNotExist dne ) {
  // No need to destroy federation, it doesn't exist
} catch( FederatesCurrentlyJoined fcj ){
  // Didn't destroy federation, federates still joined
}

Done. You’re quit!

Add Comment