/** * Adds a new context parameter to my list. */ public void addContextParameter(ContextParameter contextParameter) { getContextParametersSet().add(contextParameter); }
/** * Removes the given context parameter from my list. */ public void removeContextParameter(ContextParameter contextParameter) { getContextParametersSet().remove(contextParameter); }
/** * @return my Context Parameters in an enumeration. */ public Enumeration<ContextParameter> getContextParameters() { return (new Vector(getContextParametersSet())).elements(); }
/** * Configure application environment entry, as represented by * an <code><env-entry></code> element in the deployment descriptor. */ protected static void configureContextEnvironment(WebModule webModule, WebBundleDescriptor wmd) { for (ContextParameter envRef : wmd.getContextParametersSet()) { webModule.addEnvironment(new ContextEnvironmentDecorator( (EnvironmentProperty) envRef)); } }
/** * Configure context parameter defined in the deployment descriptor. */ protected static void configureContextParam(WebModule webModule, WebBundleDescriptor wmd) { for (ContextParameter ctxParam : wmd.getContextParametersSet()) { if ("com.sun.faces.injectionProvider".equals( ctxParam.getName()) && "com.sun.faces.vendor.GlassFishInjectionProvider".equals( ctxParam.getValue())) { // Ignore, see IT 9641 continue; } webModule.addParameter(ctxParam.getName(), ctxParam.getValue()); } }
/** * Applies application config customization (stored temporarily in the * start-up context's start-up parameters) to the web app's descriptor. * @param appContext */ private void applyApplicationConfig(ApplicationContext appContext) { WebBundleDescriptor descriptor = wmInfo.getDescriptor(); try { if (appConfigCustomizations != null) { EnvEntryCustomizer envEntryCustomizer = new EnvEntryCustomizer( descriptor.getEnvironmentEntrySet(), appConfigCustomizations.getEnvEntry()); ContextParamCustomizer contextParamCustomizer = new ContextParamCustomizer( descriptor.getContextParametersSet(), appConfigCustomizations.getContextParam()); envEntryCustomizer.applyCustomizations(); contextParamCustomizer.applyCustomizations(); } } catch (ClassCastException ex) { /* * If the user specified an env-entry value that does not * work with the env-entry type it can cause a class cast * exception. Log the warning but continue working. */ logger.log(Level.WARNING, "", ex); } }
addInitParam(jarNode, WebTagNames.CONTEXT_PARAM, webBundleDesc.getContextParametersSet());
getContextParametersSet().addAll(webBundleDescriptor.getContextParametersSet());