Java 类org.apache.camel.language.Bean 实例源码

项目:camelinaction2    文件:JSonOrderService.java   
public String handleIncomingOrder(@JsonPath("$.order.customerId") int customerId,
                                  @JsonPath("$.order.item") String item,
                                  @Bean(ref = "guid", method = "generate") int orderId) {

    // convert the order to a CSV and inject the generated order id
    return String.format("%d,%d,%s", orderId, customerId, item);
}
项目:camelinaction2    文件:XmlOrderService.java   
public Document handleIncomingOrder(@Body Document xml,
                                    @XPath("/order/@customerId") int customerId,
                                    @Bean(ref = "guid", method = "generate") int orderId) {

    Attr attr = xml.createAttribute("orderId");
    attr.setValue("" + orderId);

    Node node = xml.getElementsByTagName("order").item(0);
    node.getAttributes().setNamedItem(attr);

    return xml;
}
项目:camelinaction2    文件:XmlOrderNamespaceService.java   
public Document handleIncomingOrder(@Body Document xml,
                                    @XPath(value = "/c:order/@customerId", 
                                           namespaces = @NamespacePrefix(
                                               prefix = "c",
                                               uri = "http://camelinaction.com/order")) int customerId,
                                    @Bean(ref = "guid", method = "generate") int orderId) {

    Attr attr = xml.createAttribute("orderId");
    attr.setValue("" + orderId);

    Node node = xml.getElementsByTagName("order").item(0);
    node.getAttributes().setNamedItem(attr);

    return xml;
}
项目:camelinaction    文件:XmlOrderService.java   
public Document handleIncomingOrder(@Body Document xml,
                                    @XPath("/order/@customerId") int customerId,
                                    @Bean(ref = "guid", method = "generate") int orderId) {

    Attr attr = xml.createAttribute("orderId");
    attr.setValue("" + orderId);

    Node node = xml.getElementsByTagName("order").item(0);
    node.getAttributes().setNamedItem(attr);

    return xml;
}
项目:camelinaction    文件:XmlOrderNamespaceService.java   
public Document handleIncomingOrder(@Body Document xml,
                                    @XPath(value = "/c:order/@customerId", 
                                           namespaces = @NamespacePrefix(
                                               prefix = "c",
                                               uri = "http://camelinaction.com/order")) int customerId,
                                    @Bean(ref = "guid", method = "generate") int orderId) {

    Attr attr = xml.createAttribute("orderId");
    attr.setValue("" + orderId);

    Node node = xml.getElementsByTagName("order").item(0);
    node.getAttributes().setNamedItem(attr);

    return xml;
}
项目:t4f-data    文件:XmlOrderService.java   
public Document handleIncomingOrder(@Body Document xml,
                                    @XPath("/order/@customerId") int customerId,
                                    @Bean(ref = "guid", method = "generate") int orderId) {

    Attr attr = xml.createAttribute("orderId");
    attr.setValue("" + orderId);

    Node node = xml.getElementsByTagName("order").item(0);
    node.getAttributes().setNamedItem(attr);

    return xml;
}
项目:t4f-data    文件:XmlOrderNamespaceService.java   
public Document handleIncomingOrder(@Body Document xml,
                                    @XPath(value = "/c:order/@customerId", 
                                           namespaces = @NamespacePrefix(
                                               prefix = "c",
                                               uri = "http://camelinaction.com/order")) int customerId,
                                    @Bean(ref = "guid", method = "generate") int orderId) {

    Attr attr = xml.createAttribute("orderId");
    attr.setValue("" + orderId);

    Node node = xml.getElementsByTagName("order").item(0);
    node.getAttributes().setNamedItem(attr);

    return xml;
}
项目:t4f-data    文件:XmlOrderService.java   
public Document handleIncomingOrder(@Body Document xml,
                                    @XPath("/order/@customerId") int customerId,
                                    @Bean(ref = "guid", method = "generate") int orderId) {

    Attr attr = xml.createAttribute("orderId");
    attr.setValue("" + orderId);

    Node node = xml.getElementsByTagName("order").item(0);
    node.getAttributes().setNamedItem(attr);

    return xml;
}
项目:Camel    文件:MyBeanBindingConsumer.java   
@Consume(uri = "direct:startBeanExpression")
public void doSomethingBeanExpression(String payload, @Bean(ref = "myCounter") int count) {
    template.sendBodyAndHeader("mock:result", "Bye " + payload, "count", count);
}