code: @Override
  	public void terminateMachine( TargetHandlerParameters parameters, String machineId ) throws TargetException {
  
  		this.logger.fine( "Terminating an in-memory agent." );
  		Map<String,String> targetProperties = preventNull( parameters.getTargetProperties());
  
  		// If we executed real recipes, undeploy everything first.
  		// That's because we do not really terminate the agent's machine, we just kill the agent.
  		// So, it is important to stop and undeploy properly.
  		if( ! simulatePlugins( targetProperties )) {
  			this.logger.fine( "Stopping instances correctly (real recipes are used)." );
  			Map.Entry<String,String> ctx = parseMachineId( machineId );
  			ManagedApplication ma = this.manager.applicationMngr().findManagedApplicationByName( ctx.getValue());
  
  			// We do not want to undeploy the scoped instances, but its children.
  			try {
  				Instance scopedInstance = InstanceHelpers.findInstanceByPath( ma.getApplication(), ctx.getKey());
  				for( Instance childrenInstance : scopedInstance.getChildren())
  					this.manager.instancesMngr().changeInstanceState( ma, childrenInstance, InstanceStatus.NOT_DEPLOYED );
  
  			} catch( IOException e ) {
  				throw new TargetException( e );
  			}
  		}
  
  		// Destroy the IPojo
  		Factory factory = findIPojoFactory( parameters );
  		deleteIPojo( factory, machineId );
  	}
docs: /*
  (non-Javadoc)
  @see net.roboconf.target.api.TargetHandler
  #terminateMachine(net.roboconf.target.api.TargetHandlerParameters, java.lang.String)