當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。