本文整理汇总了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;
}
示例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;
}