Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2EDC418F55 for ; Sat, 5 Mar 2016 10:31:03 +0000 (UTC) Received: (qmail 26263 invoked by uid 500); 5 Mar 2016 10:31:02 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 26212 invoked by uid 500); 5 Mar 2016 10:31:02 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 26203 invoked by uid 99); 5 Mar 2016 10:31:02 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Mar 2016 10:31:02 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 829A4DFC6B; Sat, 5 Mar 2016 10:31:02 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: acosentino@apache.org To: commits@camel.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: camel git commit: Add Dozer Type Conversion docs to gitbook Date: Sat, 5 Mar 2016 10:31:02 +0000 (UTC) Repository: camel Updated Branches: refs/heads/master 2b67ee9c3 -> 8235ab54b Add Dozer Type Conversion docs to gitbook Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8235ab54 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8235ab54 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8235ab54 Branch: refs/heads/master Commit: 8235ab54b6536d2da9d84b828d16220541ef4bca Parents: 2b67ee9 Author: Andrea Cosentino Authored: Sat Mar 5 11:28:22 2016 +0100 Committer: Andrea Cosentino Committed: Sat Mar 5 11:28:22 2016 +0100 ---------------------------------------------------------------------- docs/user-manual/en/SUMMARY.md | 2 +- docs/user-manual/en/dozer-type-conversion.adoc | 228 ++++++++++++++++++++ 2 files changed, 229 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/8235ab54/docs/user-manual/en/SUMMARY.md ---------------------------------------------------------------------- diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md index c475f1c..0fee41b 100644 --- a/docs/user-manual/en/SUMMARY.md +++ b/docs/user-manual/en/SUMMARY.md @@ -6,6 +6,7 @@ * [Longer Getting Started Guide](book-getting-started.adoc) * [Architecture](architecture.adoc) + * [Dozer Type Conversion](dozer-type-conversion.adoc) * [Endpoint](endpoint.adoc) * [Exchange](exchange.adoc) * [Exchange Pattern](exchange-pattern.adoc) @@ -13,7 +14,6 @@ * [RX](rx.adoc) + + + + + + mapping.xml + + + +---------------------------------------------------------------------------------------------------- + +[[DozerTypeConversion-ConfiguringinOSGiblueprint]] +Configuring in OSGi blueprint ++++++++++++++++++++++++++++++ + +*Available as of Camel 2.12* + +When using Dozer with OSGi Blueprint then its works better by +configuring Dozer using the +`org.apache.camel.converter.dozer.DozerBeanMapperConfiguration` instead +of `org.dozer.DozerBeanMapper`, as shown below: + +[source,xml] +-------------------------------------------------------------------------------------------------- + + + + + + + + + mapping.xml + + + +  + + ... + +-------------------------------------------------------------------------------------------------- + +Now, where necessary, Camel will use Dozer to do conversions; In our +case between the new domain and legacy Customer types e.g. + +[source,java] +--------------------------------------------------------------------------------------------------------------------------------------------- +// given the following route +from("direct:legacy-service-in").bean(new CustomerProcessor()); + +// and a processor + +public class CustomerProcessor { + + public Customer processCustomer(org.apache.camel.converter.dozer.model.Customer customer) { + ... + } +} + +// service objects can be sent to the processor and automagically converted by Camel & Dozer +template.sendBody("direct:legacy-service-in",new org.apache.camel.converter.dozer.service.Customer("Bob", "Roberts", "12345", "1 Main st.")); +---------------------------------------------------------------------------------------------------------------------------------------------