You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bv...@apache.org on 2013/10/21 13:55:13 UTC

[2/3] git commit: CAMEL-6877: For Camel Converter POJOs better prefer static methods over the instance methods.

CAMEL-6877: For Camel Converter POJOs better prefer static methods over the instance methods.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1d89b2e9
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1d89b2e9
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1d89b2e9

Branch: refs/heads/camel-2.12.x
Commit: 1d89b2e9f7930a30e949de2693635307b4a31df0
Parents: 05cb325
Author: Babak Vahdat <bv...@apache.org>
Authored: Mon Oct 21 13:27:20 2013 +0200
Committer: Babak Vahdat <bv...@apache.org>
Committed: Mon Oct 21 13:54:43 2013 +0200

----------------------------------------------------------------------
 .../java/org/apache/camel/example/etl/CustomerTransformer.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/1d89b2e9/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/CustomerTransformer.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/CustomerTransformer.java b/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/CustomerTransformer.java
index 05cc3fb..06b9c0e76 100644
--- a/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/CustomerTransformer.java
+++ b/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/CustomerTransformer.java
@@ -47,7 +47,7 @@ public class CustomerTransformer {
      * entity
      */
     @Converter
-    public CustomerEntity toCustomer(PersonDocument doc, Exchange exchange) throws Exception {
+    public static CustomerEntity toCustomer(PersonDocument doc, Exchange exchange) throws Exception {
         EntityManager entityManager = exchange.getIn().getHeader(JpaConstants.ENTITYMANAGER, EntityManager.class);
         TransactionTemplate transactionTemplate = exchange.getContext().getRegistry().lookupByNameAndType("transactionTemplate", TransactionTemplate.class);
 
@@ -67,7 +67,7 @@ public class CustomerTransformer {
     /**
      * Finds a customer for the given username
      */
-    protected CustomerEntity findCustomerByName(TransactionTemplate transactionTemplate, final EntityManager entityManager, final String userName) throws Exception {
+    private static CustomerEntity findCustomerByName(TransactionTemplate transactionTemplate, final EntityManager entityManager, final String userName) throws Exception {
         return transactionTemplate.execute(new TransactionCallback<CustomerEntity>() {
             public CustomerEntity doInTransaction(TransactionStatus status) {
                 entityManager.joinTransaction();