Deletes the given template. The service is unregistered, and the cache is cleared.

@param template the template
179928
public void deleteTemplate(ThymeLeafTemplateImplementation template) {
        // 1 - unregister the service
        try {
            ServiceRegistration reg = registrations.remove(template);
            if (reg != null) {
                reg.unregister();
            }
        } catch (Exception e) { //NOSONAR
            // May already have been unregistered during the shutdown sequence.
        }

        // 2 - as templates can have dependencies, and expressions kept in memory, we clear all caches.
        // Despite this may really impact performance, it should not happen too often on real systems.
        synchronized (this) {
            engine.getCacheManager().clearAllCaches();
        }
        OgnlRuntime.clearCache();
        // Unfortunately, the previous method do not clear the get and set method cache
        // (ognl.OgnlRuntime.cacheGetMethod and ognl.OgnlRuntime.cacheSetMethod)
        clearMethodCaches();
    }
619201
def delete_template(self, template_id):
        ''' 

        '''

        url = self.TEMPLATE_DELETE_URL

        request = self._get_request()
        response = request.post(url + template_id, get_json=False)

        return response
191008
@Override
    public void unregisterService(ServiceInstance<T> service) throws Exception
    {
        Entry<T> entry = services.remove(service.getId());
        internalUnregisterService(entry);
    }
34917
public String deleteTempate(String template) throws ElasticSearchException {
		try{
			return client.executeHttp("/_template/"+template,ClientUtil.HTTP_DELETE);
		}
		catch(ElasticSearchException e){
			return ResultUtil.hand404HttpRuntimeException(e,String.class,ResultUtil.OPERTYPE_deleteTempate);
		}
	}
1115954
protected function _setTemplate($template)
    {
        if ($template !== null && !($template instanceof TemplateInterface)) {
            throw $this->_createInvalidArgumentException($this->__('Invalid template'), null, null, $template);
        }

        $this->template = $template;
    }
564339
public void deleteTemplate(File templateFile) {
        ThymeLeafTemplateImplementation template = getTemplateByFile(templateFile);
        if (template != null) {
            deleteTemplate(template);
        }
    }
732702
public void installationTemplate_templateName_DELETE(String templateName) throws IOException {
		String qPath = "/me/installationTemplate/{templateName}";
		StringBuilder sb = path(qPath, templateName);
		exec(qPath, "DELETE", sb.toString(), null);
	}
1188563
public void unregisterService(String serviceName, String providerId) {
        getServiceDirectoryClient().unregisterServiceInstance(serviceName, providerId);
        getCacheServiceInstances().remove(new ServiceInstanceToken(serviceName, providerId));
    }
543638
public function setTemplate($template)
    {
        $this->templatePath = $this->getTemplatesDirectory() . '/' . ltrim($template, '/');
        if (!file_exists($this->templatePath)) {
            throw new \RuntimeException('View cannot render template `' . $this->templatePath . '`. Template does not exist.');
        }
    }
94567
def delete_template(template_id,**kwargs):
    
    try:
        tmpl = db.DBSession.query(Template).filter(Template.id==template_id).one()
    except NoResultFound:
        raise ResourceNotFoundError("Template %s not found"%(template_id,))
    db.DBSession.delete(tmpl)
    db.DBSession.flush()
    return 'OK'
147988
protected function _setPlaceholderTemplate($template)
    {
        if (!is_null($template)) {
            $template = $this->_normalizeStringable($template);
        }

        $this->placeholderTemplate = $template;
    }
145999
public void updateComponentDumpTemplate(String template) throws SecurityException {
	checkWriteAccess();
	boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
	if (!hasAccess) throw new SecurityException("no access to update component setting");

	Element component = _getRootElement("component");
	// if(template.trim().length()>0)
	component.setAttribute("dump-template", template);
    }
18014
public function onDelete()
    {
        $this->validateRequestTheme();

        $type = Request::input('templateType');

        $this->loadTemplate($type, trim(Request::input('templatePath')))->delete();

        /*
         * Extensibility - documented above
         */
        $this->fireSystemEvent('cms.template.delete', [$type]);
    }
1316364
public void reset() {
		unused.addAll(templateNegative);
		unused.addAll(templatePositive);
		templateNegative.clear();
		templatePositive.clear();
	}
30401
public void delete(String templateId) {
        String url = WxEndpoint.get("url.template.delete");
        String json = String.format("{\"template_id\":\"%s\"}", templateId);
        logger.debug("template message, delete template: {}", json);
        wxClient.post(url, json);
    }
411191
protected void modifyTemplate(Template template, String key, HttpServletRequest request,
			HttpServletResponse response, Object... args)
	{

	}
246997
public function registerTemplate($template)
    {
        $template = $this->normalizeTemplateDuringRegistration($template);

        $this->templates[$template['name']] = $template;

        $this->registerTemplateAliases($template, $template['aliases']);
    }