private void logMessage(ActionInvocation invocation, String baseMessage) { if (LOG.isInfoEnabled()) { StringBuilder message = new StringBuilder(baseMessage); String namespace = invocation.getProxy().getNamespace(); if ((namespace != null) && (namespace.trim().length() > 0)) { message.append(namespace).append("/"); } message.append(invocation.getProxy().getActionName()); if (LOG.isInfoEnabled()) { LOG.info(message.toString()); } } }
private boolean needReloadContainerProviders(List<ContainerProvider> providers) { for (ContainerProvider provider : providers) { if (provider.needsReload()) { if (LOG.isInfoEnabled()) { LOG.info("Detected container provider [#0] needs to be reloaded. Reloading all providers.", provider.toString()); } return true; } } return false; }
private boolean needReloadPackageProviders() { if (packageProviders != null) { for (PackageProvider provider : packageProviders) { if (provider.needsReload()) { if (LOG.isInfoEnabled()) { LOG.info("Detected package provider [#0] needs to be reloaded. Reloading all providers.", provider.toString()); } return true; } } } return false; }
@Override public Object setProperty(String key, String value) { String oldValue = getProperty(key); if (LOG.isInfoEnabled() && oldValue != null && !oldValue.equals(value) && !defaultFrameworkBeanName.equals(oldValue)) { LOG.info("Overriding property "+key+" - old value: "+oldValue+" new value: "+value); } return super.setProperty(key, value); }
switch (autowireStrategy) { case AutowireCapableBeanFactory.AUTOWIRE_AUTODETECT: if (LOG.isInfoEnabled()) { LOG.info("Setting autowire strategy to autodetect"); break; case AutowireCapableBeanFactory.AUTOWIRE_BY_NAME: if (LOG.isInfoEnabled()) { LOG.info("Setting autowire strategy to name"); break; case AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE: if (LOG.isInfoEnabled()) { LOG.info("Setting autowire strategy to type"); break; case AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR: if (LOG.isInfoEnabled()) { LOG.info("Setting autowire strategy to constructor"); break; case AutowireCapableBeanFactory.AUTOWIRE_NO: if (LOG.isInfoEnabled()) { LOG.info("Setting autowire strategy to none");
/** * Determines if we should log the time. * * @return true to log, false to not log. */ protected boolean shouldLog() { // default check first if (logLevel == null && logCategory == null) { return LOG.isInfoEnabled(); } // okay user have set some parameters return isLoggerEnabled(getLoggerToUse(), logLevel); }
String validatorRules = st.nextToken().trim(); if (LOG.isInfoEnabled()) { LOG.info("Loading validation rules file from '" + validatorRules + "'");
/** * Is the given logger enalbed at the given level? * * @param logger the logger. * @param level the level to check if <code>isXXXEnabled</code>. * @return <tt>true</tt> if enabled, <tt>false</tt> if not. */ private static boolean isLoggerEnabled(Logger logger, String level) { if ("debug".equalsIgnoreCase(level)) { return logger.isDebugEnabled(); } else if ("info".equalsIgnoreCase(level)) { return logger.isInfoEnabled(); } else if ("warn".equalsIgnoreCase(level)) { return logger.isWarnEnabled(); } else if ("error".equalsIgnoreCase(level)) { return logger.isErrorEnabled(); } else if ("fatal".equalsIgnoreCase(level)) { return logger.isFatalEnabled(); } else if ("trace".equalsIgnoreCase(level)) { return logger.isTraceEnabled(); } else { throw new IllegalArgumentException("LogLevel [" + level + "] is not supported"); } }
/** * Do a log (at INFO level) of the time taken for this particular profiling. * * @param currentTimer profiling timer bean */ private static void printTimes(ProfilingTimerBean currentTimer) { if (LOG.isInfoEnabled()) { LOG.info(currentTimer.getPrintable(getMinTime())); } }
if (LOG.isInfoEnabled()) { LOG.info("Scanning for classes in [" + urlPath + "] matching criteria: " + test);
public void register(ContainerBuilder containerBuilder, LocatableProperties props) throws ConfigurationException { if (LOG.isInfoEnabled()) { LOG.info("Parsing configuration file [" + configFileName + "]");
throw new ConfigurationException("Could not open files of the name " + fileName, ioException); } else { if (LOG.isInfoEnabled()) { LOG.info("Unable to locate configuration files of the name " + fileName + ", skipping");
/** * Determines the element class by looking for the value of @Element annotation for the given * class. * If no annotation is found, the element class is determined by using the generic parametrics. * * As fallback, it determines the key class by looking for the value of Element_${property} in the properties * file for the given class. Also looks for the deprecated Collection_${property} * * @param parentClass the Class which contains as a property the Map or Collection we are finding the key for. * @param property the property of the Map or Collection for the given parent class * @see com.opensymphony.xwork2.conversion.ObjectTypeDeterminer#getElementClass(Class, String, Object) */ public Class getElementClass(Class parentClass, String property, Object key) { Element annotation = getAnnotation(parentClass, property, Element.class); if (annotation != null) { return annotation.value(); } Class clazz = getClass(parentClass, property, true); if (clazz != null) { return clazz; } clazz = (Class) xworkConverter.getConverter(parentClass, ELEMENT_PREFIX + property); if (clazz == null) { clazz = (Class) xworkConverter.getConverter(parentClass, DEPRECATED_ELEMENT_PREFIX + property); if (LOG.isInfoEnabled() && clazz != null) { LOG.info("The Collection_xxx pattern for collection type conversion is deprecated. Please use Element_xxx!"); } } return clazz; }
} catch (RuntimeException ex) { if (LOG.isInfoEnabled()) { LOG.info("Unable to verify action class [#0] exists at initialization", className);