Determines whether to override the debug settings. Sets the debugOverride
status on ThreadLocalJawrContext

@param req
the request
@param jawrConfig
the jawr config
169110
public static void setRequestDebuggable(HttpServletRequest req, JawrConfig jawrConfig) {

		// make sure we have set an overrideKey
		// make sure the overrideKey exists in the request
		// lastly, make sure the keys match
		if (jawrConfig.getDebugOverrideKey().length() > 0
				&& null != req.getParameter(JawrConstant.OVERRIDE_KEY_PARAMETER_NAME) && jawrConfig
						.getDebugOverrideKey().equals(req.getParameter(JawrConstant.OVERRIDE_KEY_PARAMETER_NAME))) {
			ThreadLocalJawrContext.setDebugOverriden(true);
		} else {
			ThreadLocalJawrContext.setDebugOverriden(false);
		}

		// Inherit the debuggable property of the session if the session is a
		// debuggable one
		inheritSessionDebugProperty(req);

	}
1357367
protected void initializeJawrConfig(Properties props) throws ServletException {

		StopWatch stopWatch = new StopWatch("Jawr Processing for '" + resourceType + "' resource");
		ThreadLocalJawrContext.setStopWatch(stopWatch);

		// init registry
		generatorRegistry = new GeneratorRegistry(resourceType);

		// Initialize config
		if (null != jawrConfig) {
			jawrConfig.invalidate();
		}

		stopWatch.start("Initialize configuration");
		createJawrConfig(props);

		jawrConfig.setContext(servletContext);
		jawrConfig.setGeneratorRegistry(generatorRegistry);

		// Set the content type to be used for every request.
		contentType = "text/";
		contentType += "js".equals(resourceType) ? "javascript" : "css";
		contentType += "; charset=" + jawrConfig.getResourceCharset().name();

		// Set mapping, to be used by the tag lib to define URLs that point to
		// this servlet.
		String mapping = (String) initParameters.get("mapping");
		if (null != mapping)
			jawrConfig.setServletMapping(mapping);

		if (jawrConfig.isCssClasspathImageHandledByClasspathCss() && resourceType.equals("css")) {
			BinaryResourcesHandler binaryRsHandler = (BinaryResourcesHandler) servletContext
					.getAttribute(JawrConstant.BINARY_CONTEXT_ATTRIBUTE);
			if (binaryRsHandler == null) {
				LOGGER.error(
						"You are using the CSS classpath image feature, but the JAWR Binary servlet is not yet initialized.\n"
								+ "The JAWR Binary servlet must be initialized before the JAWR CSS servlet.\n"
								+ "Please check you web application configuration.");
			}
		}

		if (LOGGER.isDebugEnabled()) {
			LOGGER.debug("Configuration read. Current config:");
			LOGGER.debug(jawrConfig.toString());
		}

		// Initialize the IllegalBundleRequest handler
		initIllegalBundleRequestHandler();

		stopWatch.stop();
		// Create a resource handler to read files from the WAR archive or
		// exploded dir.
		rsReaderHandler = initResourceReaderHandler();
		ResourceBundleHandler rsBundleHandler = initResourceBundleHandler();
		PropertiesBasedBundlesHandlerFactory factory = new PropertiesBasedBundlesHandlerFactory(props, resourceType,
				rsReaderHandler, rsBundleHandler, jawrConfig);
		try {
			bundlesHandler = factory.buildResourceBundlesHandler();
		} catch (DuplicateBundlePathException | BundleDependencyException e) {
			throw new ServletException(e);
		}

		if (resourceType.equals(JawrConstant.JS_TYPE))
			servletContext.setAttribute(JawrConstant.JS_CONTEXT_ATTRIBUTE, bundlesHandler);
		else
			servletContext.setAttribute(JawrConstant.CSS_CONTEXT_ATTRIBUTE, bundlesHandler);

		this.clientSideScriptRequestHandler = new ClientSideHandlerScriptRequestHandler(bundlesHandler, jawrConfig);

		if (LOGGER.isDebugEnabled()) {
			LOGGER.debug("content type set to: " + contentType);
		}

		// Warn when in debug mode
		if (jawrConfig.isDebugModeOn()) {
			LOGGER.warn(
					"Jawr initialized in DEVELOPMENT MODE. Do NOT use this mode in production or integration servers. ");
		}

		if (PERF_PROCESSING_LOGGER.isDebugEnabled()) {
			PERF_PROCESSING_LOGGER.debug(stopWatch.prettyPrint());
		}
	}
1246882
@SuppressWarnings("unchecked")
	public void init(ServletContext context, JawrConfig config) {
		super.init(context, config);
		pluginPathMap = (Map<String, String>) context.getAttribute(pluginMapAttributeName);
		if (pluginPathMap == null) {
			throw new BundlingProcessException("No grails plugin paths map defined in the servlet context");
		}

		// Determine wether this is run-app or run-war style of runtime.
		warDeployed = ((Boolean) context.getAttribute(JawrGrailsConstant.GRAILS_WAR_DEPLOYED)).booleanValue();
	}
103429
@Override
	public void setUseContextPathOverrideInDebugMode(boolean useContextPathOverrideInDebugMode) {

		configProperties.setProperty(JawrConfig.JAWR_USE_URL_CONTEXTPATH_OVERRIDE_IN_DEBUG_MODE,
				Boolean.toString(useContextPathOverrideInDebugMode));
	}
941376
@Override
	public synchronized void configChanged(Properties newConfig) {
		if (LOGGER.isDebugEnabled()) {
			LOGGER.debug("Reloading Jawr configuration");
		}
		try {
			// Initialize the Thread local for the Jawr context
			ThreadLocalJawrContext.setJawrConfigMgrObjectName(JmxUtils.getMBeanObjectName(servletContext, resourceType,
					jawrConfig.getProperty(JawrConstant.JAWR_JMX_MBEAN_PREFIX)));

			// clears resource bundle cache for the refresh
			ResourceBundle.clearCache();
			StopWatch stopWatch = ThreadLocalJawrContext.getStopWatch();
			if (stopWatch != null && stopWatch.isRunning()) {
				stopWatch.stop();
			}

			Properties props = propertiesSource.getConfigProperties();
			// override the properties if needed
			if (this.overrideProperties != null) {
				props.putAll(overrideProperties);
			}
			props.putAll(newConfig);

			initializeJawrContext(props);

			if (LOGGER.isDebugEnabled()) {
				LOGGER.debug("Jawr configuration succesfully reloaded. ");
			}

		} catch (InterruptBundlingProcessException e) {
			if (LOGGER.isInfoEnabled()) {
				LOGGER.info(resourceType + " bundling process Interrupted");
			}
		} catch (Exception e) {
			throw new BundlingProcessException("Error reloading Jawr config: " + e.getMessage(), e);
		} finally {

			// Reset the Thread local for the Jawr context
			ThreadLocalJawrContext.reset();
		}

	}
568394
public void setJPAExPcBindingContext(Object exPc) //d468174
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.debug(tc, "setJPAExPcBindingContext: " + exPc);

        ivExPcContext = exPc;
    }
1115480
protected boolean getUseRandomParamFlag(JawrConfig config) {

		boolean useRandomParamFlag = config.isDebugUseRandomParam();
		if (useRandomParam != null) {
			useRandomParamFlag = Boolean.parseBoolean(useRandomParam);
		}
		return useRandomParamFlag;
	}
819737
public static void setDefaultDebugSettingsForDevelopment(final WebApplication application)
	{
		ApplicationExtensions.setHtmlHotDeploy(application);
		ApplicationExtensions.setDebugSettingsForDevelopment(application);
		ApplicationExtensions.setExceptionSettingsForDevelopment(application);
		// set the behavior if an missing resource is found...
		application.getResourceSettings().setThrowExceptionOnMissingResource(true);
	}
962583
@SuppressWarnings("unchecked")
	public void setConfig(JawrConfig config) {
		
		servletContext = config.getContext();
		grailsContext = servletContext
				.getAttribute(JawrGrailsConstant.GRAILS_WAR_DEPLOYED) != null;
		if (grailsContext) {
			LOGGER.info("Grails war deployed");
		}
		
		pluginMsgPathMap = (Map<String, String>) servletContext.getAttribute(JawrGrailsConstant.JAWR_GRAILS_PLUGIN_MSG_PATHS);
		if(pluginMsgPathMap == null){
			throw new BundlingProcessException("No grails plugin message paths map defined in the servlet context");
		}
		
		rsHandler = new GrailsServletContextResourceReader(JawrGrailsConstant.JAWR_GRAILS_PLUGIN_MSG_PATHS);
		rsHandler.init(servletContext, config);
	}
173433
def set_debug(self, status):
        """"""
        if status:
            self.logger.setLevel('DEBUG')
        else:
            self.logger.setLevel('INFO')
1354328
private void initRequestHandler(ServletContext context, Properties configProps) throws ServletException {

		long initialTime = System.currentTimeMillis();
		if (LOGGER.isInfoEnabled())
			LOGGER.info("Initializing jawr config for request handler named " + getInitParameter("handlerName"));

		this.servletContext = context;
		this.overrideProperties = configProps;
		resourceType = getInitParameter("type");
		resourceType = null == resourceType ? "js" : resourceType;

		if (resourceType.equals("img")) {
			throw new BundlingProcessException(
					"The resource type 'img' is not supported since the version 3.6. You should use the type 'binary' instead.");
		}

		// Check if the resource type is a valid one
		if (!(resourceType.equals(JawrConstant.JS_TYPE) || resourceType.equals(JawrConstant.CSS_TYPE)
				|| resourceType.equals(JawrConstant.BINARY_TYPE))) {
			throw new BundlingProcessException("Unknown resource Type:" + resourceType);
		}

		// Initialize the config properties source that will provide with all
		// configuration options.
		ConfigPropertiesSource propsSrc = initConfigPropertiesSource(context, configProps);

		// Read properties from properties source
		Properties props = propsSrc.getConfigProperties();
		// override the properties if needed
		if (this.overrideProperties != null) {
			props.putAll(overrideProperties);
		}

		// hang onto the propertiesSource for manual reloads
		this.propertiesSource = propsSrc;

		// Initialize the ConfigPropertyResolver
		initConfigPropertyResolver(context);

		initializeJawrContext(props);

		// Initialize the properties reloading checker daemon if specified
		if (!ThreadLocalJawrContext.isBundleProcessingAtBuildTime()
				&& null != props.getProperty(CONFIG_RELOAD_INTERVAL)) {
			int interval = Integer.parseInt(props.getProperty(CONFIG_RELOAD_INTERVAL));
			LOGGER.warn("Jawr started with configuration auto reloading on. "
					+ "Be aware that a daemon thread will be checking for changes to configuration every " + interval
					+ " seconds.");

			this.configChangeListenerThread = new ConfigChangeListenerThread(this.resourceType, propsSrc,
					this.overrideProperties, this, this.bundlesHandler, interval);
			configChangeListenerThread.start();
		}

		if (this.bundlesHandler != null && jawrConfig.getUseSmartBundling()) {

			this.watcher = new ResourceWatcher(this.bundlesHandler, this.rsReaderHandler);
			this.bundlesHandler.setResourceWatcher(watcher);
			try {
				this.watcher.initPathToResourceBundleMap(this.bundlesHandler.getGlobalBundles());
				this.watcher.initPathToResourceBundleMap(this.bundlesHandler.getContextBundles());
			} catch (IOException e) {
				throw new BundlingProcessException("Impossible to initialize Jawr Resource Watcher", e);
			}

			this.watcher.start();
		}

		if (LOGGER.isInfoEnabled()) {
			long totaltime = System.currentTimeMillis() - initialTime;
			LOGGER.info("Init method successful. jawr started in " + (totaltime / 1000) + " seconds....");
		}

		// Reset ThreadLocalJawrContext
		ThreadLocalJawrContext.reset();
	}
181069
@Override
	public final boolean configChanged() {
		int currentConfigHash = doReadConfig().hashCode();
		boolean configChanged = this.propsHashCode != currentConfigHash;

		if (configChanged && LOGGER.isDebugEnabled()){
			LOGGER.debug("Changes in Jawr configuration properties file detected.");
		}
		
		this.propsHashCode = currentConfigHash;

		return configChanged;
	}
1233671
public void setConfiguration(VirtualHost config) {
        this.config = config;
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "setConfiguration", "config set ->"+ this.config);
        }
    }
1092841
public static void inheritSessionDebugProperty(HttpServletRequest request) {

		HttpSession session = request.getSession(false);
		if (session != null) {
			String sessionId = session.getId();

			JawrApplicationConfigManager appConfigMgr = (JawrApplicationConfigManager) session.getServletContext()
					.getAttribute(JawrConstant.JAWR_APPLICATION_CONFIG_MANAGER);

			// If the session ID is a debuggable session ID, activate debug mode
			// for the request.
			if (appConfigMgr != null && appConfigMgr.isDebugSessionId(sessionId)) {
				ThreadLocalJawrContext.setDebugOverriden(true);
			}
		}
	}
1094264
public boolean requestShouldBeHandledByTAI(HttpServletRequest request, MicroProfileJwtTaiRequest mpJwtTaiRequest, boolean defaultConfig) {
        String methodName = "requestShouldBeHandledByTAI";
        if (tc.isDebugEnabled()) {
            Tr.entry(tc, methodName, request, mpJwtTaiRequest);
        }

        mpJwtTaiRequest = setTaiRequestConfigInfo(request, mpJwtTaiRequest, defaultConfig);
        boolean result = false;
        boolean ignoreAppAuthMethod = true;

        MicroProfileJwtConfig mpJwtConfig = null;
        try {
            mpJwtConfig = mpJwtTaiRequest.getOnlyMatchingConfig();
        } catch (MpJwtProcessingException e) {

        }
        if (mpJwtConfig != null) {
            if (shouldDeferToJwtSso(request, mpJwtConfig, mpJwtTaiRequest.getJwtSsoConfig())) {
                return false;
            }
            ignoreAppAuthMethod = mpJwtConfig.ignoreApplicationAuthMethod(); // true by default
            if (ignoreAppAuthMethod) {
                result = mpJwtTaiRequest.hasServices();
            } else {
                result = isMpJwtSpecifiedInLoginConfig(request);
            }
        }

        if (tc.isDebugEnabled()) {
            Tr.exit(tc, methodName, result);
        }
        return result;
    }
484671
private void setupDebugger(Debugger debugger) {
        if (debugger == null) {
            return;
        }

        this.debugger = debugger;
        JSObject globalObject = getGlobalContext().getObject();
        String debuggerName = getRuntime().getConfig().getExposeDebugAs();
        Object currentDebugger = globalObject.get(this, debuggerName);
        if (!(currentDebugger instanceof DebuggerAPI)) {
            DebuggerAPI api = new DebuggerAPI(getGlobalContext(), debugger);
            globalObject.put(this, debuggerName, api, false);
        }
    }
784773
public void configNormal(NormalConfig normalConfig) {
        normalConfig.setDebug(false).setPrintBanner(true).setPrintSqlInfo(true);
    }