• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DeferredProcessingAware类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中ch.qos.logback.core.spi.DeferredProcessingAware的典型用法代码示例。如果您正苦于以下问题:Java DeferredProcessingAware类的具体用法?Java DeferredProcessingAware怎么用?Java DeferredProcessingAware使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DeferredProcessingAware类属于ch.qos.logback.core.spi包,在下文中一共展示了DeferredProcessingAware类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: subAppend

import ch.qos.logback.core.spi.DeferredProcessingAware; //导入依赖的package包/类
/**
 * Actual writing occurs here.
 * <p>
 * Most subclasses of <code>WriterAppender</code> will need to override this
 * method.
 * 
 * @since 0.9.0
 */
protected void subAppend(E event) {
  if (!isStarted()) {
    return;
  }
  try {
    // this step avoids LBCLASSIC-139
    if (event instanceof DeferredProcessingAware) {
      ((DeferredProcessingAware) event).prepareForDeferredProcessing();
    }
    // the synchronization prevents the OutputStream from being closed while we
    // are writing. It also prevents multiple threads from entering the same
    // converter. Converters assume that they are in a synchronized block.
    lock.lock();
    try {
      writeOut(event);
    } finally {
      lock.unlock();
    }
  } catch (IOException ioe) {
    // as soon as an exception occurs, move to non-started state
    // and add a single ErrorStatus to the SM.
    this.started = false;
    addStatus(new ErrorStatus("IO failure in appender", this, ioe));
  }
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:34,代码来源:OutputStreamAppender.java


示例2: append

import ch.qos.logback.core.spi.DeferredProcessingAware; //导入依赖的package包/类
@Override
protected synchronized void append(final E event) {
    if (!isStarted()) {
        return;
    }
    try {
        if (event instanceof DeferredProcessingAware) {
            ((DeferredProcessingAware) event).prepareForDeferredProcessing();
        }
        this.encoder.doEncode(event);
    } catch (final IOException ex) {
        stop();
        addStatus(new ErrorStatus("IO failure in appender named \"" + this.name + "\".",
                this, ex));
    }
}
 
开发者ID:dkmfbk,项目名称:knowledgestore,代码行数:17,代码来源:Logging.java


示例3: subAppend

import ch.qos.logback.core.spi.DeferredProcessingAware; //导入依赖的package包/类
/**
 * 
 * @param eventObject
 */
private void subAppend(ILoggingEvent eventObject) {
  if (!isStarted()) {
    return;
  }

  try {
    // this step avoids LBCLASSIC-139
    if (eventObject instanceof DeferredProcessingAware) {
      ((DeferredProcessingAware) eventObject).prepareForDeferredProcessing();
    }

    this.encoder.doEncode(eventObject);

  } catch (IOException ioe) {
    this.started = false;
    addStatus(new ErrorStatus("IO failure in appender", this, ioe));
  }
}
 
开发者ID:scizeron,项目名称:logback-sqs,代码行数:23,代码来源:SqsAppender.java


示例4: writeTo

import ch.qos.logback.core.spi.DeferredProcessingAware; //导入依赖的package包/类
@Override
public void writeTo(JsonGenerator generator, DeferredProcessingAware deferredProcessingAware) throws IOException {
    generator.writeFieldName("service");
    generator.writeString(serviceName);
    generator.writeFieldName("service-version");
    generator.writeString(serviceVersion);
    generator.writeFieldName("service-id");
    generator.writeString(serviceInstanceId);
}
 
开发者ID:Sixt,项目名称:ja-micro,代码行数:10,代码来源:ServicePropertiesProvider.java


示例5: withName

import ch.qos.logback.core.spi.DeferredProcessingAware; //导入依赖的package包/类
private <T extends DeferredProcessingAware> AbstractFieldJsonProvider<T> withName(
    String name,
    AbstractFieldJsonProvider<T> provider,
    LoggerContext context
  ) {

  provider.setContext(context);
  provider.setFieldName(name);
  return provider;
}
 
开发者ID:atgse,项目名称:sam,代码行数:11,代码来源:JsonAccessLogAppender.java


示例6: appendUnsafe

import ch.qos.logback.core.spi.DeferredProcessingAware; //导入依赖的package包/类
/**
 * Appends an event in order to be logged. This method is unsafe concerning the fact that the event is lost
 * if the Jedis client connection has timed out due to a redis connection timeout (configured on the
 * redis server).
 *
 * @param event event to be appended
 */
private void appendUnsafe(DeferredProcessingAware event) {
    if (event != null) {
        rpushAndSyncIfBatchFinished(event);
    } else {
        sendBatch(batchConfig.getProcessedBatchItemsCount());
    }
}
 
开发者ID:idealo,项目名称:logback-redis,代码行数:15,代码来源:RedisBatchAppender.java


示例7: rpushAndSyncIfBatchFinished

import ch.qos.logback.core.spi.DeferredProcessingAware; //导入依赖的package包/类
private void rpushAndSyncIfBatchFinished(DeferredProcessingAware event) {
    pipeline.rpush(connectionConfig.getKey(), createEncodedEvent(event));
    batchConfig.addBatchItem();

    final int batchSize = batchConfig.getProcessedBatchItemsCount();
    if (batchConfig.isBatchFinished()) {
        sendBatch(batchSize);
    }
}
 
开发者ID:idealo,项目名称:logback-redis,代码行数:10,代码来源:RedisBatchAppender.java


示例8: createEncodedEvent

import ch.qos.logback.core.spi.DeferredProcessingAware; //导入依赖的package包/类
private String createEncodedEvent(DeferredProcessingAware event) {
    try (ByteArrayOutputStream eventOutputStream = new ByteArrayOutputStream(BUFFER_SIZE)) {
        encoder.init(eventOutputStream);
        encoder.doEncode(event);

        return eventOutputStream.toString("UTF-8");
    } catch (IOException e) {
        throw new IllegalStateException("error while initializing the event encoder", e);
    }
}
 
开发者ID:idealo,项目名称:logback-redis,代码行数:11,代码来源:RedisBatchAppender.java


示例9: subAppend

import ch.qos.logback.core.spi.DeferredProcessingAware; //导入依赖的package包/类
private void subAppend(E event) {
	if (event instanceof DeferredProcessingAware) {
		((DeferredProcessingAware) event).prepareForDeferredProcessing();
	}
	append(this.encoder.encode(event));
}
 
开发者ID:future-architect,项目名称:uroborosql,代码行数:7,代码来源:AbstractEncodedAppender.java


示例10: getEncoder

import ch.qos.logback.core.spi.DeferredProcessingAware; //导入依赖的package包/类
public Encoder<DeferredProcessingAware> getEncoder() {
    return encoder;
}
 
开发者ID:idealo,项目名称:logback-redis,代码行数:4,代码来源:RedisBatchAppender.java


示例11: setEncoder

import ch.qos.logback.core.spi.DeferredProcessingAware; //导入依赖的package包/类
public void setEncoder(Encoder<DeferredProcessingAware> encoder) {
    this.encoder = encoder;
}
 
开发者ID:idealo,项目名称:logback-redis,代码行数:4,代码来源:RedisBatchAppender.java



注:本文中的ch.qos.logback.core.spi.DeferredProcessingAware类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ReadOptions类代码示例发布时间:2022-05-21
下一篇:
Java FurnaceSmeltEvent类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap