当前位置: 首页>>代码示例>>Java>>正文


Java Log.isWarningEnabled方法代码示例

本文整理汇总了Java中org.jfree.util.Log.isWarningEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java Log.isWarningEnabled方法的具体用法?Java Log.isWarningEnabled怎么用?Java Log.isWarningEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jfree.util.Log的用法示例。


在下文中一共展示了Log.isWarningEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configure

import org.jfree.util.Log; //导入方法依赖的package包/类
/**
 * Configures the module and raises the state to STATE_CONFIGURED if the
 * module is not yet configured.
 *
 * @param subSystem  the sub-system.
 * 
 * @return true, if the module was configured, false otherwise.
 */
public boolean configure(final SubSystem subSystem)
{
  if (this.state == STATE_NEW)
  {
    try
    {
      this.module.configure(subSystem);
      this.state = STATE_CONFIGURED;
      return true;
    }
    catch (NoClassDefFoundError noClassDef)
    {
      Log.warn (new Log.SimpleMessage("Unable to load module classes for ",
              this.module.getName(), ":", noClassDef.getMessage()));
      this.state = STATE_ERROR;
    }
    catch (Exception e)
    {
      if (Log.isDebugEnabled())
      {
        // its still worth a warning, but now we are more verbose ...
        Log.warn("Unable to configure the module " + this.module.getName(), e);
      }
      else if (Log.isWarningEnabled())
      {
        Log.warn("Unable to configure the module " + this.module.getName());
      }
      this.state = STATE_ERROR;
    }
  }
  return false;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:41,代码来源:PackageState.java

示例2: initialize

import org.jfree.util.Log; //导入方法依赖的package包/类
/**
 * Initializes the contained module and raises the set of the module to
 * STATE_INITIALIZED, if the module was not yet initialized. In case of an
 * error, the module state will be set to STATE_ERROR and the module will
 * not be available.
 *
 * @param subSystem  the sub-system.
 * 
 * @return true, if the module was successfully initialized, false otherwise.
 */
public boolean initialize(final SubSystem subSystem)
{
  if (this.state == STATE_CONFIGURED)
  {
    try
    {
        this.module.initialize(subSystem);
        this.state = STATE_INITIALIZED;
        return true;
    }
    catch (NoClassDefFoundError noClassDef)
    {
      Log.warn (new Log.SimpleMessage("Unable to load module classes for ",
              this.module.getName(), ":", noClassDef.getMessage()));
      this.state = STATE_ERROR;
    }
    catch (ModuleInitializeException me)
    {
      if (Log.isDebugEnabled())
      {
        // its still worth a warning, but now we are more verbose ...
        Log.warn("Unable to initialize the module " + this.module.getName(), me);
      }
      else if (Log.isWarningEnabled())
      {
        Log.warn("Unable to initialize the module " + this.module.getName());
      }
      this.state = STATE_ERROR;
    }
    catch (Exception e)
    {
      if (Log.isDebugEnabled())
      {
        // its still worth a warning, but now we are more verbose ...
        Log.warn("Unable to initialize the module " + this.module.getName(), e);
      }
      else if (Log.isWarningEnabled())
      {
        Log.warn("Unable to initialize the module " + this.module.getName());
      }
      this.state = STATE_ERROR;
    }
  }
  return false;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:56,代码来源:PackageState.java


注:本文中的org.jfree.util.Log.isWarningEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。