本文整理匯總了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;
}