当前位置: 首页>>代码示例>>Java>>正文


Java DefaultExchangeFormatter类代码示例

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


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

示例1: testConfiguration

import org.apache.camel.processor.DefaultExchangeFormatter; //导入依赖的package包/类
public void testConfiguration() {
    DefaultExchangeFormatter formatter = new DefaultExchangeFormatter();

    assertFalse(formatter.isShowExchangeId());
    assertFalse(formatter.isShowProperties());
    assertFalse(formatter.isShowHeaders());
    assertTrue(formatter.isShowBodyType());
    assertTrue(formatter.isShowBody());
    assertFalse(formatter.isShowOut());
    assertFalse(formatter.isShowException());
    assertFalse(formatter.isShowCaughtException());
    assertFalse(formatter.isShowStackTrace());
    assertFalse(formatter.isShowAll());
    assertFalse(formatter.isMultiline());
    assertEquals(10000, formatter.getMaxChars());
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:17,代码来源:DefaultExchangeFormatterTest.java

示例2: DefaultAsyncProcessorAwaitManager

import org.apache.camel.processor.DefaultExchangeFormatter; //导入依赖的package包/类
public DefaultAsyncProcessorAwaitManager() {
    // setup exchange formatter to be used for message history dump
    DefaultExchangeFormatter formatter = new DefaultExchangeFormatter();
    formatter.setShowExchangeId(true);
    formatter.setMultiline(true);
    formatter.setShowHeaders(true);
    formatter.setStyle(DefaultExchangeFormatter.OutputStyle.Fixed);
    this.exchangeFormatter = formatter;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:10,代码来源:DefaultAsyncProcessorAwaitManager.java

示例3: AbstractBasicRoute

import org.apache.camel.processor.DefaultExchangeFormatter; //导入依赖的package包/类
protected AbstractBasicRoute() {
    // setup exchange formatter to be used for message history dump
    historyFormatter = new DefaultExchangeFormatter();
    historyFormatter.setShowExchangeId(true);
    historyFormatter.setMultiline(true);
    historyFormatter.setShowHeaders(true);
    historyFormatter.setStyle(DefaultExchangeFormatter.OutputStyle.Fixed);
}
 
开发者ID:integram,项目名称:cleverbus,代码行数:9,代码来源:AbstractBasicRoute.java

示例4: messageHistoryExpression

import org.apache.camel.processor.DefaultExchangeFormatter; //导入依赖的package包/类
/**
 * Returns the message history (including exchange details or not)
 */
public static Expression messageHistoryExpression(final boolean detailed) {
    return new ExpressionAdapter() {

        private ExchangeFormatter formatter;

        public Object evaluate(Exchange exchange) {
            ExchangeFormatter ef = null;
            if (detailed) {
                // use the exchange formatter to log exchange details
                ef = getOrCreateExchangeFormatter(exchange.getContext());
            }
            return MessageHelper.dumpMessageHistoryStacktrace(exchange, ef, false);
        }

        private ExchangeFormatter getOrCreateExchangeFormatter(CamelContext camelContext) {
            if (formatter == null) {
                Set<ExchangeFormatter> formatters = camelContext.getRegistry().findByType(ExchangeFormatter.class);
                if (formatters != null && formatters.size() == 1) {
                    formatter = formatters.iterator().next();
                } else {
                    // setup exchange formatter to be used for message history dump
                    DefaultExchangeFormatter def = new DefaultExchangeFormatter();
                    def.setShowExchangeId(true);
                    def.setMultiline(true);
                    def.setShowHeaders(true);
                    def.setStyle(DefaultExchangeFormatter.OutputStyle.Fixed);
                    try {
                        Integer maxChars = CamelContextHelper.parseInteger(camelContext, camelContext.getProperty(Exchange.LOG_DEBUG_BODY_MAX_CHARS));
                        if (maxChars != null) {
                            def.setMaxChars(maxChars);
                        }
                    } catch (Exception e) {
                        throw ObjectHelper.wrapRuntimeCamelException(e);
                    }
                    formatter = def;
                }
            }
            return formatter;
        }

        @Override
        public String toString() {
            return "messageHistory(" + detailed + ")";
        }
    };
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:50,代码来源:ExpressionBuilder.java

示例5: logMessageHistory

import org.apache.camel.processor.DefaultExchangeFormatter; //导入依赖的package包/类
public void logMessageHistory(Exchange exchange) {
    LOG.info(MessageHelper.dumpMessageHistoryStacktrace(exchange, new DefaultExchangeFormatter(), false));
}
 
开发者ID:garethahealy,项目名称:jboss-fuse-examples,代码行数:4,代码来源:ExampleThreading.java


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