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

svn commit: r883574 - in /websites/production/camel/content: cache/main.pageCache camel-2130-release.html etl-example.html

Author: buildbot
Date: Mon Oct 21 13:18:49 2013
New Revision: 883574

Log:
Production update by buildbot for camel

Modified:
    websites/production/camel/content/cache/main.pageCache
    websites/production/camel/content/camel-2130-release.html
    websites/production/camel/content/etl-example.html

Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/camel/content/camel-2130-release.html
==============================================================================
--- websites/production/camel/content/camel-2130-release.html (original)
+++ websites/production/camel/content/camel-2130-release.html Mon Oct 21 13:18:49 2013
@@ -94,12 +94,12 @@
 
 <p>Welcome to the 2.13.0 release which approx XXX issues resolved (new features, improvements and bug fixes such as...)</p>
 
-<ul><li>When using multiple OSGi Blueprint &lt;cm:property-placeholder&gt;'s then Camel now favors using non-default placeholders, or the last property-placeholder defined in the Blueprint XML file. This allows for example to define default properties in one placeholder, and override these values in other placeholders.</li><li><a shape="rect" href="ftp2.html" title="FTP2">FTP</a> consumer allow to download a single named file without using the FTP LIST command. This allows to download a known file from a FTP server even when the user account does not have permission to do FTP LIST command.</li><li><a shape="rect" href="ftp2.html" title="FTP2">FTP</a> consumer allow to ignore file not found or insufficient file permission errors.</li><li><a shape="rect" href="data-format.html" title="Data Format">Data Format</a> using marshal now leverages <a shape="rect" href="stream-caching.html" title="Stream caching">Stream caching</a> out of the box if enabled, which allows to marshal big stream
 s and spool to disk, instead of being pure in-memory based.</li><li>Improved using <a shape="rect" href="bean.html" title="Bean">Bean</a> when the bean is looked up in the <a shape="rect" href="registry.html" title="Registry">Registry</a>, when using concurrent processing in the route.</li><li>Added <tt>cache</tt> option to <tt>beanRef</tt> and <tt>&lt;bean&gt;</tt> in the DSL. This avoids looking up the <a shape="rect" href="bean.html" title="Bean">Bean</a> from the <a shape="rect" href="registry.html" title="Registry">Registry</a> on each usage; this can safely be done for singleton beans.</li><li>Configuring <a shape="rect" href="data-format.html" title="Data Format">Data Format</a>s in XML attributes now supports reference lookup using the # syntax, eg <tt>&lt;jaxb xmlStreamWriterWrapper="#myWriterWrapper" ..&gt;</tt></li><li><a shape="rect" href="jdbc.html" title="JDBC">JDBC</a> component now also support <tt>outputType</tt> to specify the expected output as either a List or si
 ngle Object. As well allow to map to a bean using a <tt>BeanRowMapper</tt> to control the mapping of ROW names to bean properties.</li><li>Both <a shape="rect" href="quartz.html" title="Quartz">Quartz</a> as well as <a shape="rect" href="quartz2.html" title="Quartz2">Quartz2</a> based <a shape="rect" href="scheduledroutepolicy.html" title="ScheduledRoutePolicy">ScheduledRoutePolicy</a> has been improved to better support cluster setups (e.g. to not schedule jobs being already scheduled through another node inside a given cluster).</li><li>Reduced the work the <a shape="rect" href="aggregator2.html" title="Aggregator2">Aggregate</a> EIP does while holding a lock during aggregation, which can lead to improved performance in some use-cases.</li><li><tt>JndiRegistry</tt> now implements all the find methods.</li><li><a shape="rect" href="vm.html" title="VM">VM</a> component now supports <tt>multipleConsumers=true</tt> across deployment units.</li><li>Added <tt>@PreConsumed</tt> to <a sha
 pe="rect" href="jpa.html" title="JPA">JPA</a> consumer.</li><li>Added CamelFileName header support to the <a shape="rect" href="hdfs.html" title="HDFS">HDFS</a> producer</li><li>Like as <tt>JpaConsumer</tt> now also <tt>JpaProducer</tt> of the <a shape="rect" href="jpa.html" title="JPA">JPA</a> component supports the <tt>CamelEntityManager</tt> header.</li></ul>
+<ul><li>When using multiple OSGi Blueprint &lt;cm:property-placeholder&gt;'s then Camel now favors using non-default placeholders, or the last property-placeholder defined in the Blueprint XML file. This allows for example to define default properties in one placeholder, and override these values in other placeholders.</li><li><a shape="rect" href="ftp2.html" title="FTP2">FTP</a> consumer allow to download a single named file without using the FTP LIST command. This allows to download a known file from a FTP server even when the user account does not have permission to do FTP LIST command.</li><li><a shape="rect" href="ftp2.html" title="FTP2">FTP</a> consumer allow to ignore file not found or insufficient file permission errors.</li><li><a shape="rect" href="data-format.html" title="Data Format">Data Format</a> using marshal now leverages <a shape="rect" href="stream-caching.html" title="Stream caching">Stream caching</a> out of the box if enabled, which allows to marshal big stream
 s and spool to disk, instead of being pure in-memory based.</li><li>Improved using <a shape="rect" href="bean.html" title="Bean">Bean</a> when the bean is looked up in the <a shape="rect" href="registry.html" title="Registry">Registry</a>, when using concurrent processing in the route.</li><li>Added <tt>cache</tt> option to <tt>beanRef</tt> and <tt>&lt;bean&gt;</tt> in the DSL. This avoids looking up the <a shape="rect" href="bean.html" title="Bean">Bean</a> from the <a shape="rect" href="registry.html" title="Registry">Registry</a> on each usage; this can safely be done for singleton beans.</li><li>Configuring <a shape="rect" href="data-format.html" title="Data Format">Data Format</a>s in XML attributes now supports reference lookup using the # syntax, eg <tt>&lt;jaxb xmlStreamWriterWrapper="#myWriterWrapper" ..&gt;</tt></li><li><a shape="rect" href="jdbc.html" title="JDBC">JDBC</a> component now also support <tt>outputType</tt> to specify the expected output as either a List or si
 ngle Object. As well allow to map to a bean using a <tt>BeanRowMapper</tt> to control the mapping of ROW names to bean properties.</li><li>Both <a shape="rect" href="quartz.html" title="Quartz">Quartz</a> as well as <a shape="rect" href="quartz2.html" title="Quartz2">Quartz2</a> based <a shape="rect" href="scheduledroutepolicy.html" title="ScheduledRoutePolicy">ScheduledRoutePolicy</a> has been improved to better support cluster setups (e.g. to not schedule jobs being already scheduled through another node inside a given cluster).</li><li>Reduced the work the <a shape="rect" href="aggregator2.html" title="Aggregator2">Aggregate</a> EIP does while holding a lock during aggregation, which can lead to improved performance in some use-cases.</li><li><tt>JndiRegistry</tt> now implements all the find methods.</li><li><a shape="rect" href="vm.html" title="VM">VM</a> component now supports <tt>multipleConsumers=true</tt> across deployment units.</li><li>Added <tt>@PreConsumed</tt> to <a sha
 pe="rect" href="jpa.html" title="JPA">JPA</a> consumer.</li><li>Added CamelFileName header support to the <a shape="rect" href="hdfs.html" title="HDFS">HDFS</a> producer</li><li>Like as <tt>JpaConsumer</tt> now also <tt>JpaProducer</tt> of the <a shape="rect" href="jpa.html" title="JPA">JPA</a> component supports the <tt>CamelEntityManager</tt> header.</li><li><a shape="rect" href="restlet.html" title="Restlet">Restlet</a> consumer now supports returning custom headers as HTTP headers from the Camel <a shape="rect" href="message.html" title="Message">Message</a>.</li></ul>
 
 
 <h3><a shape="rect" name="Camel2.13.0Release-FixedIssues"></a>Fixed Issues</h3>
 
-<ul><li>Fixed an <tt>ArrayIndexOutOfBoundsException</tt> with <a shape="rect" href="message-history.html" title="Message History">Message History</a> when using <a shape="rect" href="seda.html" title="SEDA">SEDA</a></li><li>Fixed <tt>requestTimeout</tt> on <a shape="rect" href="netty.html" title="Netty">Netty</a> not triggering when we have received message.</li><li>Fixed <a shape="rect" href="parameter-binding-annotations.html" title="Parameter Binding Annotations">Parameter Binding Annotations</a> on boolean types to evaluate as <a shape="rect" href="predicate.html" title="Predicate">Predicate</a> instead of <a shape="rect" href="expression.html" title="Expression">Expression</a></li><li>Fixed using <a shape="rect" href="file2.html" title="File2">File</a> consumer with <tt>delete=true&amp;readLock=fileLock</tt> not being able to delete the file on Windows.</li><li>Fixed <a shape="rect" href="throttler.html" title="Throttler">Throttler</a> to honor time slots after period expires (
 eg so it works consistently and as expected).</li><li>Fixed getting JMSXUserID property when consuming from <a shape="rect" href="activemq.html" title="ActiveMQ">ActiveMQ</a></li><li>Fixed <a shape="rect" href="intercept.html" title="Intercept">interceptFrom</a> to support property placeholders</li><li>Fixed a race condition in initializing <tt>SSLContext</tt> in <a shape="rect" href="netty.html" title="Netty">Netty</a> and <a shape="rect" href="netty-http.html" title="Netty HTTP">Netty HTTP</a></li><li>Fixed using <a shape="rect" href="recipient-list.html" title="Recipient List">Recipient List</a>, <a shape="rect" href="routing-slip.html" title="Routing Slip">Routing Slip</a> calling another route which is configured with <tt>NoErrorHandler</tt>, and an exception occurred in that route, would be propagated back as not-exhausted, allow the caller route to have its error handler react on the exception.</li><li>Fixed <a shape="rect" href="quartz.html" title="Quartz">Quartz</a> and exc
 eption was thrown when scheduling a job, would affect during shutdown, assuming the job was still in progress, and not shutdown the Quartz scheduler.</li><li>Fixed so you can configure <a shape="rect" href="stomp.html" title="Stomp">Stomp</a> endpoints using <a shape="rect" href="uris.html" title="URIs">URIs</a></li><li>Fixed memory leak when using <a shape="rect" href="language.html" title="Language">Language</a> component with <tt>camel-script</tt> languages and having <tt>contentCache=false</tt></li><li>Fixed <a shape="rect" href="error-handler.html" title="Error Handler">Error Handler</a> may log at <tt>WARN</tt> level "Cannot determine current route from Exchange" when using <a shape="rect" href="splitter.html" title="Splitter">Splitter</a></li><li>Fixed <tt>camel-fop</tt> to work in Apache <a shape="rect" href="karaf.html" title="Karaf">Karaf</a> and ServiceMix</li><li>Fixed <a shape="rect" href="hdfs.html" title="HDFS">HDFS</a> producer to use the configured <a shape="rect" h
 ref="uuidgenerator.html" title="UuidGenerator">UuidGenerator</a> when generating split file names to avoid filename collisions</li><li>Fixed <tt>JpaProducer</tt> and <tt>JpaConsumer</tt> of the <a shape="rect" href="jpa.html" title="JPA">JPA</a> component to not share/reuse the same <tt>EntityManager</tt> object which could cause problems if this would occur in the context of multiple/different threads.</li></ul>
+<ul><li>Fixed an <tt>ArrayIndexOutOfBoundsException</tt> with <a shape="rect" href="message-history.html" title="Message History">Message History</a> when using <a shape="rect" href="seda.html" title="SEDA">SEDA</a></li><li>Fixed <tt>requestTimeout</tt> on <a shape="rect" href="netty.html" title="Netty">Netty</a> not triggering when we have received message.</li><li>Fixed <a shape="rect" href="parameter-binding-annotations.html" title="Parameter Binding Annotations">Parameter Binding Annotations</a> on boolean types to evaluate as <a shape="rect" href="predicate.html" title="Predicate">Predicate</a> instead of <a shape="rect" href="expression.html" title="Expression">Expression</a></li><li>Fixed using <a shape="rect" href="file2.html" title="File2">File</a> consumer with <tt>delete=true&amp;readLock=fileLock</tt> not being able to delete the file on Windows.</li><li>Fixed <a shape="rect" href="throttler.html" title="Throttler">Throttler</a> to honor time slots after period expires (
 eg so it works consistently and as expected).</li><li>Fixed getting JMSXUserID property when consuming from <a shape="rect" href="activemq.html" title="ActiveMQ">ActiveMQ</a></li><li>Fixed <a shape="rect" href="intercept.html" title="Intercept">interceptFrom</a> to support property placeholders</li><li>Fixed a race condition in initializing <tt>SSLContext</tt> in <a shape="rect" href="netty.html" title="Netty">Netty</a> and <a shape="rect" href="netty-http.html" title="Netty HTTP">Netty HTTP</a></li><li>Fixed using <a shape="rect" href="recipient-list.html" title="Recipient List">Recipient List</a>, <a shape="rect" href="routing-slip.html" title="Routing Slip">Routing Slip</a> calling another route which is configured with <tt>NoErrorHandler</tt>, and an exception occurred in that route, would be propagated back as not-exhausted, allow the caller route to have its error handler react on the exception.</li><li>Fixed <a shape="rect" href="quartz.html" title="Quartz">Quartz</a> and exc
 eption was thrown when scheduling a job, would affect during shutdown, assuming the job was still in progress, and not shutdown the Quartz scheduler.</li><li>Fixed so you can configure <a shape="rect" href="stomp.html" title="Stomp">Stomp</a> endpoints using <a shape="rect" href="uris.html" title="URIs">URIs</a></li><li>Fixed memory leak when using <a shape="rect" href="language.html" title="Language">Language</a> component with <tt>camel-script</tt> languages and having <tt>contentCache=false</tt></li><li>Fixed <a shape="rect" href="error-handler.html" title="Error Handler">Error Handler</a> may log at <tt>WARN</tt> level "Cannot determine current route from Exchange" when using <a shape="rect" href="splitter.html" title="Splitter">Splitter</a></li><li>Fixed <tt>camel-fop</tt> to work in Apache <a shape="rect" href="karaf.html" title="Karaf">Karaf</a> and ServiceMix</li><li>Fixed <a shape="rect" href="hdfs.html" title="HDFS">HDFS</a> producer to use the configured <a shape="rect" h
 ref="uuidgenerator.html" title="UuidGenerator">UuidGenerator</a> when generating split file names to avoid filename collisions</li><li>Fixed <tt>JpaProducer</tt> and <tt>JpaConsumer</tt> of the <a shape="rect" href="jpa.html" title="JPA">JPA</a> component to not share/reuse the same <tt>EntityManager</tt> object which could cause problems if this would occur in the context of multiple/different threads.</li><li>Fixed <a shape="rect" href="http4.html" title="HTTP4">HTTP4</a> to support multiple custom component names in use, each configured using different <tt>SSLContext</tt>.</li></ul>
 
 
 <h3><a shape="rect" name="Camel2.13.0Release-NewEnterpriseIntegrationPatterns"></a>New <a shape="rect" href="enterprise-integration-patterns.html" title="Enterprise Integration Patterns">Enterprise Integration Patterns</a></h3>

Modified: websites/production/camel/content/etl-example.html
==============================================================================
--- websites/production/camel/content/etl-example.html (original)
+++ websites/production/camel/content/etl-example.html Mon Oct 21 13:18:49 2013
@@ -134,20 +134,19 @@ public class EtlRoutes extends SpringRou
 @Converter
 public class CustomerTransformer {
 
-    private static final transient Logger LOG = LoggerFactory.getLogger(CustomerTransformer.class);
+    private static final Logger LOG = LoggerFactory.getLogger(CustomerTransformer.class);
 
     /**
      * A transformation method to convert a person document into a customer
      * entity
-     * @throws Exception 
      */
     @Converter
-    public CustomerEntity toCustomer(PersonDocument doc, Exchange exchange) throws Exception {
-        JpaTemplate template = exchange.getIn().getHeader("CamelJpaTemplate", JpaTemplate.class);
+    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);
 
-        
         String user = doc.getUser();
-        CustomerEntity customer = findCustomerByName(template, user);
+        CustomerEntity customer = findCustomerByName(transactionTemplate, entityManager, user);
 
         // let's convert information from the document into the entity bean
         customer.setUserName(user);
@@ -155,23 +154,31 @@ public class CustomerTransformer {
         customer.setSurname(doc.getLastName());
         customer.setCity(doc.getCity());
 
-        LOG.debug("Created object customer: " + customer);
+        LOG.info("Created object customer: {}", customer);
         return customer;
     }
 
     /**
      * Finds a customer for the given username
      */
-    protected CustomerEntity findCustomerByName(JpaTemplate template, String user) throws Exception {
-        List&lt;CustomerEntity&gt; list = CastUtils.cast(template.find("select x from customer"
-                                                                 + " x where x.userName = ?1", user));
-        if (list.isEmpty()) {
-            CustomerEntity answer = new CustomerEntity();
-            answer.setUserName(user);
-            return answer;
-        } else {
-            return list.get(0);
-        }
+    private static CustomerEntity findCustomerByName(TransactionTemplate transactionTemplate, final EntityManager entityManager, final String userName) throws Exception {
+        return transactionTemplate.execute(new TransactionCallback&lt;CustomerEntity&gt;() {
+            public CustomerEntity doInTransaction(TransactionStatus status) {
+                entityManager.joinTransaction();
+                List&lt;CustomerEntity&gt; list = entityManager.createNamedQuery("findCustomerByUsername", CustomerEntity.class).setParameter("userName", userName).getResultList();
+                CustomerEntity answer;
+                if (list.isEmpty()) {
+                    answer = new CustomerEntity();
+                    answer.setUserName(userName);
+                    LOG.info("Created a new CustomerEntity {} as no matching persisted entity found.", answer);
+                } else {
+                    answer = list.get(0);
+                    LOG.info("Found a matching CustomerEntity {} having the userName {}.", answer, userName);
+                }
+
+                return answer;
+            }
+        });
     }
 
 }