本文整理匯總了Java中org.jboss.logmanager.LogContext.getAttachment方法的典型用法代碼示例。如果您正苦於以下問題:Java LogContext.getAttachment方法的具體用法?Java LogContext.getAttachment怎麽用?Java LogContext.getAttachment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jboss.logmanager.LogContext
的用法示例。
在下文中一共展示了LogContext.getAttachment方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getConfigurationPersistence
import org.jboss.logmanager.LogContext; //導入方法依賴的package包/類
/**
* Gets the property configurator. If the {@link ConfigurationPersistence} does not exist a {@code null} is
* returned.
*
* @param logContext the log context used to find the property configurator or to attach it to.
*
* @return the property configurator or {@code null}
*/
public static ConfigurationPersistence getConfigurationPersistence(final LogContext logContext) {
if (logContext == null) return null;
return (ConfigurationPersistence) logContext.getAttachment(CommonAttributes.ROOT_LOGGER_NAME, Configurator.ATTACHMENT_KEY);
}
示例2: isDisabledHandler
import org.jboss.logmanager.LogContext; //導入方法依賴的package包/類
/**
* Checks to see if a handler is disabled
*
* @param handlerName the name of the handler to enable.
*/
static boolean isDisabledHandler(final LogContext logContext, final String handlerName) {
final Map<String, String> disableHandlers = logContext.getAttachment(CommonAttributes.ROOT_LOGGER_NAME, DISABLED_HANDLERS_KEY);
return disableHandlers != null && disableHandlers.containsKey(handlerName);
}