| Method from com.sun.faces.config.ConfigureListener Detail: |
public void attributeAdded(ServletRequestAttributeEvent event) {
// ignored
}
|
public void attributeAdded(HttpSessionBindingEvent event) {
// ignored
}
|
public void attributeAdded(ServletContextAttributeEvent event) {
// ignored
}
|
public void attributeRemoved(ServletRequestAttributeEvent event) {
if (webAppListener != null) {
webAppListener.attributeRemoved(event);
}
}
|
public void attributeRemoved(HttpSessionBindingEvent event) {
if (webAppListener != null) {
webAppListener.attributeRemoved(event);
}
}
|
public void attributeRemoved(ServletContextAttributeEvent event) {
if (webAppListener != null) {
webAppListener.attributeRemoved(event);
}
}
|
public void attributeReplaced(ServletRequestAttributeEvent event) {
if (webAppListener != null) {
webAppListener.attributeReplaced(event);
}
}
|
public void attributeReplaced(HttpSessionBindingEvent event) {
if (webAppListener != null) {
webAppListener.attributeReplaced(event);
}
}
|
public void attributeReplaced(ServletContextAttributeEvent event) {
if (webAppListener != null) {
webAppListener.attributeReplaced(event);
}
}
|
public void contextDestroyed(ServletContextEvent sce) {
webAppListener.contextDestroyed(sce);
webAppListener = null;
ServletContext context = sce.getServletContext();
GroovyHelper helper = GroovyHelper.getCurrentInstance(context);
if (helper != null) {
helper.setClassLoader();
}
LOGGER.log(Level.FINE,
"ConfigureListener.contextDestroyed({0})",
context.getServletContextName());
try {
// Release any allocated application resources
FactoryFinder.releaseFactories();
//monitor.cancel(true);
//webResourcePool.purge();
webResourcePool.shutdown();
} finally {
FacesContext initContext = new InitFacesContext(context);
ApplicationAssociate
.clearInstance(initContext.getExternalContext());
ApplicationAssociate.setCurrentInstance(null);
// Release the initialization mark on this web application
ConfigManager.getInstance().destory(context);
initContext.release();
ReflectionUtils.clearCache(Thread.currentThread().getContextClassLoader());
WebConfiguration.clear(context);
}
}
|
public void contextInitialized(ServletContextEvent sce) {
// ------------------------------------------ ServletContextListener Methods
ServletContext context = sce.getServletContext();
webAppListener = new WebappLifecycleListener(context);
webAppListener.contextInitialized(sce);
Timer timer = Timer.getInstance();
if (timer != null) {
timer.startTiming();
}
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE,
MessageFormat.format(
"ConfigureListener.contextInitialized({0})",
getServletContextIdentifier(context)));
}
webConfig = WebConfiguration.getInstance(context);
ConfigManager configManager = ConfigManager.getInstance();
if (configManager.hasBeenInitialized(context)) {
return;
}
// Check to see if the FacesServlet is present in the
// web.xml. If it is, perform faces configuration as normal,
// otherwise, simply return.
if (!webConfig.isOptionEnabled(BooleanWebContextInitParameter.ForceLoadFacesConfigFiles)) {
WebXmlProcessor processor = new WebXmlProcessor(context);
if (!processor.isFacesServletPresent()) {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE,
"No FacesServlet found in deployment descriptor - bypassing configuration");
}
WebConfiguration.clear(context);
return;
} else {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE,
"FacesServlet found in deployment descriptor - processing configuration.");
}
}
}
FacesContext initContext = new InitFacesContext(context);
ReflectionUtils.initCache(Thread.currentThread().getContextClassLoader());
try {
if (LOGGER.isLoggable(Level.INFO)) {
LOGGER.log(Level.INFO,
"jsf.config.listener.version",
getServletContextIdentifier(context));
}
// see if we need to disable our TLValidator
Util.setHtmlTLVActive(
webConfig.isOptionEnabled(BooleanWebContextInitParameter.EnableHtmlTagLibraryValidator));
if (webConfig.isOptionEnabled(BooleanWebContextInitParameter.VerifyFacesConfigObjects)) {
if (LOGGER.isLoggable(Level.WARNING)) {
LOGGER.warning("jsf.config.verifyobjects.development_only");
}
// if we're verifying, force bean validation to occur at startup as well
webConfig.overrideContextInitParameter(BooleanWebContextInitParameter.EnableLazyBeanValidation, false);
Verifier.setCurrentInstance(new Verifier());
}
initScripting();
configManager.initialize(context);
initConfigMonitoring(context);
// Step 7, verify that all the configured factories are available
// and optionall that configured objects can be created.
Verifier v = Verifier.getCurrentInstance();
if (v != null && !v.isApplicationValid()) {
if (LOGGER.isLoggable(Level.SEVERE)) {
LOGGER.severe("jsf.config.verifyobjects.failures_detected");
StringBuilder sb = new StringBuilder(128);
for (String m : v.getMessages()) {
sb.append(m).append('\n");
}
LOGGER.severe(sb.toString());
}
}
registerELResolverAndListenerWithJsp(context, false);
ApplicationAssociate associate =
ApplicationAssociate.getInstance(context);
if (associate != null) {
associate.setContextName(getServletContextIdentifier(context));
}
RenderKitUtils.loadSunJsfJs(initContext.getExternalContext());
} finally {
Verifier.setCurrentInstance(null);
initContext.release();
LOGGER.log(Level.FINE,
"jsf.config.listener.version.complete");
if (timer != null) {
timer.stopTiming();
timer.logResult("Initialization of context " +
getServletContextIdentifier(context));
}
}
}
|
public void registerELResolverAndListenerWithJsp(ServletContext context,
boolean reloaded) {
if (webConfig.isSet(WebContextInitParameter.ExpressionFactory) ||
!isJspTwoOne()) {
// first try to load a factory defined in web.xml
if (!installExpressionFactory(context,
webConfig.getOptionValue(
WebContextInitParameter.ExpressionFactory))) {
throw new ConfigurationException(
MessageUtils.getExceptionMessageString(
MessageUtils.INCORRECT_JSP_VERSION_ID,
WebContextInitParameter.ExpressionFactory.getDefaultValue(),
WebContextInitParameter.ExpressionFactory.getQualifiedName()));
}
} else {
// JSP 2.1 specific check
if (JspFactory.getDefaultFactory().getJspApplicationContext(context) == null) {
return;
}
// register an empty resolver for now. It will be populated after the
// first request is serviced.
CompositeELResolver compositeELResolverForJsp =
new FacesCompositeELResolver(FacesCompositeELResolver.ELResolverChainType.JSP);
ApplicationAssociate associate =
ApplicationAssociate.getInstance(context);
if (associate != null) {
associate.setFacesELResolverForJsp(compositeELResolverForJsp);
}
// get JspApplicationContext.
JspApplicationContext jspAppContext = JspFactory.getDefaultFactory()
.getJspApplicationContext(context);
// cache the ExpressionFactory instance in ApplicationAssociate
if (associate != null) {
associate.setExpressionFactory(jspAppContext.getExpressionFactory());
}
// register compositeELResolver with JSP
try {
jspAppContext.addELResolver(compositeELResolverForJsp);
}
catch (IllegalStateException e) {
if (!Util.isUnitTestModeEnabled() && !reloaded) {
throw e;
}
}
// register JSF ELContextListenerImpl with Jsp
ELContextListenerImpl elContextListener = new ELContextListenerImpl();
jspAppContext.addELContextListener(elContextListener);
}
}
|
public void requestDestroyed(ServletRequestEvent event) {
if (webAppListener != null) {
webAppListener.requestDestroyed(event);
}
}
|
public void requestInitialized(ServletRequestEvent event) {
if (webAppListener != null) {
webAppListener.requestInitialized(event);
}
}
|
public void sessionCreated(HttpSessionEvent event) {
if (webAppListener != null) {
webAppListener.sessionCreated(event);
}
}
|
public void sessionDestroyed(HttpSessionEvent event) {
if (webAppListener != null) {
webAppListener.sessionDestroyed(event);
}
}
|