本文整理汇总了Java中ch.qos.logback.classic.spi.LoggerContextListener类的典型用法代码示例。如果您正苦于以下问题:Java LoggerContextListener类的具体用法?Java LoggerContextListener怎么用?Java LoggerContextListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LoggerContextListener类属于ch.qos.logback.classic.spi包,在下文中一共展示了LoggerContextListener类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resetListenersExceptResetResistant
import ch.qos.logback.classic.spi.LoggerContextListener; //导入依赖的package包/类
private void resetListenersExceptResetResistant() {
ArrayList toRetain = new ArrayList();
Iterator i$ = this.loggerContextListenerList.iterator();
while(i$.hasNext()) {
LoggerContextListener lcl = (LoggerContextListener)i$.next();
if(lcl.isResetResistant()) {
toRetain.add(lcl);
}
}
this.loggerContextListenerList.retainAll(toRetain);
}
示例2: previouslyRegisteredListenerWithSameObjectName
import ch.qos.logback.classic.spi.LoggerContextListener; //导入依赖的package包/类
private boolean previouslyRegisteredListenerWithSameObjectName() {
List<LoggerContextListener> lcll = loggerContext.getCopyOfListenerList();
for (LoggerContextListener lcl : lcll) {
if (lcl instanceof JMXConfigurator) {
JMXConfigurator jmxConfigurator = (JMXConfigurator) lcl;
if (objectName.equals(jmxConfigurator.objectName)) {
return true;
}
}
}
return false;
}
示例3: begin
import ch.qos.logback.classic.spi.LoggerContextListener; //导入依赖的package包/类
@Override
public void begin(InterpretationContext ec, String name, Attributes attributes)
throws ActionException {
inError = false;
String className = attributes.getValue(CLASS_ATTRIBUTE);
if (OptionHelper.isEmpty(className)) {
addError("Mandatory \"" + CLASS_ATTRIBUTE
+ "\" attribute not set for <loggerContextListener> element");
inError = true;
return;
}
try {
lcl = (LoggerContextListener) OptionHelper.instantiateByClassName(
className, LoggerContextListener.class, context);
if(lcl instanceof ContextAware) {
((ContextAware) lcl).setContext(context);
}
ec.pushObject(lcl);
addInfo("Adding LoggerContextListener of type [" + className
+ "] to the object stack");
} catch (Exception oops) {
inError = true;
addError("Could not create LoggerContextListener of type " + className + "].", oops);
}
}
示例4: resetListenersExceptResetResistant
import ch.qos.logback.classic.spi.LoggerContextListener; //导入依赖的package包/类
private void resetListenersExceptResetResistant() {
List<LoggerContextListener> toRetain = new ArrayList<LoggerContextListener>();
for (LoggerContextListener lcl : loggerContextListenerList) {
if (lcl.isResetResistant()) {
toRetain.add(lcl);
}
}
loggerContextListenerList.retainAll(toRetain);
}
示例5: getCopyOfListenerList
import ch.qos.logback.classic.spi.LoggerContextListener; //导入依赖的package包/类
public List<LoggerContextListener> getCopyOfListenerList() {
return new ArrayList(this.loggerContextListenerList);
}
示例6: addListener
import ch.qos.logback.classic.spi.LoggerContextListener; //导入依赖的package包/类
public void addListener(LoggerContextListener listener) {
loggerContextListenerList.add(listener);
}
示例7: removeListener
import ch.qos.logback.classic.spi.LoggerContextListener; //导入依赖的package包/类
public void removeListener(LoggerContextListener listener) {
loggerContextListenerList.remove(listener);
}
示例8: getCopyOfListenerList
import ch.qos.logback.classic.spi.LoggerContextListener; //导入依赖的package包/类
public List<LoggerContextListener> getCopyOfListenerList() {
return new ArrayList<LoggerContextListener>(loggerContextListenerList);
}
示例9: fireOnLevelChange
import ch.qos.logback.classic.spi.LoggerContextListener; //导入依赖的package包/类
void fireOnLevelChange(Logger logger, Level level) {
for (LoggerContextListener listener : loggerContextListenerList) {
listener.onLevelChange(logger, level);
}
}
示例10: fireOnReset
import ch.qos.logback.classic.spi.LoggerContextListener; //导入依赖的package包/类
private void fireOnReset() {
for (LoggerContextListener listener : loggerContextListenerList) {
listener.onReset(this);
}
}
示例11: fireOnStart
import ch.qos.logback.classic.spi.LoggerContextListener; //导入依赖的package包/类
private void fireOnStart() {
for (LoggerContextListener listener : loggerContextListenerList) {
listener.onStart(this);
}
}
示例12: fireOnStop
import ch.qos.logback.classic.spi.LoggerContextListener; //导入依赖的package包/类
private void fireOnStop() {
for (LoggerContextListener listener : loggerContextListenerList) {
listener.onStop(this);
}
}