private static void registerServlet(ServletContext context) { Dynamic dynamicRegistration = context.addServlet("AutoRegisteredResourceServlet", ResourceServlet.class); dynamicRegistration.addMapping(RICHFACES_RESOURCES_DEFAULT_MAPPING); if (LOGGER.isInfoEnabled()) { LOGGER.info("Auto-registered servlet " + ResourceServlet.class.getSimpleName() + " with mapping '" + RICHFACES_RESOURCES_DEFAULT_MAPPING + "'"); } } }
/** * Uses dynamic servlet registartaion for registering PushServlet automatically */ private static void registerPushServlet(ServletContext context) { Dynamic dynamicRegistration = context.addServlet("AutoRegisteredPushServlet", PushServlet.class); dynamicRegistration.addMapping(PUSH_CONTEXT_DEFAULT_MAPPING); dynamicRegistration.setAsyncSupported(true); if (LOGGER.isInfoEnabled()) { LOGGER.info("Auto-registered servlet " + PushServlet.class.getSimpleName() + " with mapping '" + PUSH_CONTEXT_DEFAULT_MAPPING + "'"); } }
if (LOGGER.isInfoEnabled()) { LOGGER.warn(MessageFormat.format("Failure loading properties from location: {0}", location), e);
private void logResourceProblem(FacesContext context, Throwable throwable, String messagePattern, Object... arguments) { boolean isProductionStage = context.isProjectStage(ProjectStage.Production); if (LOGGER.isWarnEnabled() || (!isProductionStage && LOGGER.isInfoEnabled())) { String formattedMessage = MessageFormat.format(messagePattern, arguments); if (throwable != null) { LOGGER.warn(formattedMessage, throwable); } else { if (isProductionStage) { LOGGER.info(formattedMessage); } else { LOGGER.warn(formattedMessage); } } } }
/** * Called on application startup */ protected void onStart() { JsfVersionInspector enforcer = new JsfVersionInspector(); if (!enforcer.verifyJsfImplVersion()) { throw new RuntimeException(String.format("The JSF implementation %s does not support the RichFaces ExtendedPartialViewContext. Please upgrade to at least Mojarra 2.1.28 or 2.2.6", enforcer.getVersionString())); } createFactory(); if (LOGGER.isInfoEnabled()) { String versionString = VersionBean.VERSION.toString(); if (versionString != null && versionString.length() != 0) { LOGGER.info(versionString); } } if (getConfiguration(executeAWTInitializer)) { initializeAWT(); } boolean jmsEnabled = getConfiguration(pushJMSEnabled) != null && getConfiguration(pushJMSEnabled); if (jmsEnabled || getConfiguration(pushInitializePushContextOnStartup)) { initializePushContext(); } if (getConfiguration(pushJMSEnabled) == null) { logWarningWhenConnectionFactoryPresent(); } }