Java 类org.apache.camel.model.language.HeaderExpression 实例源码

项目:wildfly-swarm-camel    文件:RouteBuilderA.java   
@Override
public void configure() throws Exception {
    from("timer://foo?delay=0&repeatCount=1")
        .setBody(new HeaderExpression(Exchange.TIMER_COUNTER))
        .transform(body().prepend("Hello "))
        .process(new Processor() {
            @Override
            public void process(Exchange exchange) throws Exception {
                System.out.println("Writing " + exchange + " to " + System.getProperty("jboss.server.data.dir"));
            }
        })
        .to("file://{{jboss.server.data.dir}}/" + RouteBuilderA.class.getName() + "?fileName=fileA&doneFileName=fileA.done");
}
项目:wildfly-swarm    文件:RouteBuilderA.java   
@Override
public void configure() throws Exception {
    from("timer://foo?delay=0&repeatCount=1")
            .setBody(new HeaderExpression(Exchange.TIMER_COUNTER))
            .transform(body().prepend("Hello "))
            .process(new Processor() {
                @Override
                public void process(Exchange exchange) throws Exception {
                    System.out.println("Writing " + exchange + " to " + System.getProperty("jboss.server.data.dir"));
                }
            })
            .to("file://{{jboss.server.data.dir}}/" + RouteBuilderA.class.getName() + "?fileName=fileA&doneFileName=fileA.done");
}
项目:wildfly-swarm    文件:RouteBuilderA.java   
@Override
public void configure() throws Exception {
    from("timer://foo?delay=0&repeatCount=1")
        .setBody(new HeaderExpression(Exchange.TIMER_COUNTER))
        .transform(body().prepend("Hello "))
        .process(new Processor() {
            @Override
            public void process(Exchange exchange) throws Exception {
                System.out.println("Writing " + exchange + " to " + System.getProperty("jboss.server.data.dir"));
            }
        })
        .to("file://{{jboss.server.data.dir}}/" + RouteBuilderA.class.getName() + "?fileName=fileA&doneFileName=fileA.done");
}
项目:metasfresh    文件:XLSConfigurationContext.java   
/**
 * @return processor which sets the properties of this configuration as exchange properties.
 */
public Processor asSetPropertiesToExchangeProcessor()
{
    return new Processor()
    {
        private final HeaderExpression headerFileName = new HeaderExpression(Exchange.FILE_NAME);

        @Override
        public void process(Exchange exchange) throws Exception
        {
            // NOTE: use the Header FILE_NAME instead of our context property
            // because that's dynamic and also the filename is not set when creating the context from CamelContext
            exchange.setProperty(Exchange.FILE_NAME, headerFileName.evaluate(exchange, String.class));

            // exchange.setProperty(CONTEXT_EDIMessageDatePattern, EDIMessageDatePattern);
            exchange.setProperty(CONTEXT_AD_Client_Value, AD_Client_Value);
            exchange.setProperty(CONTEXT_AD_Org_ID, AD_Org_ID);
            exchange.setProperty(CONTEXT_ADInputDataDestination_InternalName, ADInputDataDestination_InternalName);
            exchange.setProperty(CONTEXT_ADInputDataSourceID, ADInputDataSourceID);
            exchange.setProperty(CONTEXT_ADUserEnteredByID, ADUserEnteredByID);
            exchange.setProperty(CONTEXT_DELIVERY_RULE, DeliveryRule);
            exchange.setProperty(CONTEXT_DELIVERY_VIA_RULE, DeliveryViaRule);
            //
            exchange.setProperty(CONTEXT_CurrencyISOCode, currencyISOCode);
        }
    };
}
项目:Camel    文件:RoutingSlipDefinition.java   
public RoutingSlipDefinition(String headerName, String uriDelimiter) {
    super(new HeaderExpression(headerName));
    setUriDelimiter(uriDelimiter);
}
项目:Camel    文件:ExpressionClauseSupport.java   
/**
 * An expression of an inbound message header of the given name
 */
public T header(String name) {
    return expression(new HeaderExpression(name));
}
项目:Camel    文件:BuilderSupport.java   
/**
 * Returns a value builder for the given header
 */
public ValueBuilder header(String name) {
    Expression exp = new HeaderExpression(name);
    return new ValueBuilder(exp);
}
项目:Camel    文件:Builder.java   
/**
 * Returns a predicate and value builder for headers on an exchange
 */
public static ValueBuilder header(String name) {
    Expression exp = new HeaderExpression(name);
    return new ValueBuilder(exp);
}