[jira] Created: (CAMEL-1417) StreamCache causes to many type converters not possible

2009-03-04 Thread Claus Ibsen (JIRA)
StreamCache causes to many type converters not possible
---

 Key: CAMEL-1417
 URL: https://issues.apache.org/activemq/browse/CAMEL-1417
 Project: Apache Camel
  Issue Type: Bug
  Components: camel-core
Affects Versions: 1.6.0, 1.6.1
Reporter: Claus Ibsen
Assignee: Claus Ibsen
Priority: Critical
 Fix For: 2.0.0


Since StreamCache is default turned on it cause to many convters attempt that 
fails in MessageSupport.

No type converter available to convert from type: java.lang.Integer to the 
required type: org.apache.camel.StreamCache with value 1

It hurts performance to much. 

See nabble:
http://www.nabble.com/Performance-and-MessageSupport.getBody-%281.6.0%29-td22291841s22882.html


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (CAMEL-1417) StreamCache causes to many type converters not possible

2009-03-04 Thread Claus Ibsen (JIRA)

 [ 
https://issues.apache.org/activemq/browse/CAMEL-1417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-1417:
---

Affects Version/s: (was: 1.6.1)
Fix Version/s: 1.6.1

 StreamCache causes to many type converters not possible
 ---

 Key: CAMEL-1417
 URL: https://issues.apache.org/activemq/browse/CAMEL-1417
 Project: Apache Camel
  Issue Type: Bug
  Components: camel-core
Affects Versions: 1.6.0
Reporter: Claus Ibsen
Assignee: Claus Ibsen
Priority: Critical
 Fix For: 2.0.0, 1.6.1


 Since StreamCache is default turned on it cause to many convters attempt that 
 fails in MessageSupport.
 No type converter available to convert from type: java.lang.Integer to the 
 required type: org.apache.camel.StreamCache with value 1
 It hurts performance to much. 
 See nabble:
 http://www.nabble.com/Performance-and-MessageSupport.getBody-%281.6.0%29-td22291841s22882.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (CAMEL-1416) Using # notation to reference CXF serviceClass is not working

2009-03-04 Thread Charles Moulliard (JIRA)

[ 
https://issues.apache.org/activemq/browse/CAMEL-1416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=50204#action_50204
 ] 

Charles Moulliard commented on CAMEL-1416:
--

I have retested and everything is ok.

 Using # notation to reference CXF serviceClass is not working
 -

 Key: CAMEL-1416
 URL: https://issues.apache.org/activemq/browse/CAMEL-1416
 Project: Apache Camel
  Issue Type: Bug
  Components: camel-cxf
Affects Versions: 2.0.0
Reporter: William Tam
Assignee: William Tam
 Fix For: 2.0.0


 See issue reported in mailing list.
 http://www.nabble.com/camel-cxf-endpoint---error-%3A-Failed-to-convert-property-value-of-type--...-tp22312601p22312601.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (CAMEL-1418) Allow usage of any IoFilter in camel-mina, not only ProtocolCodecFilter

2009-03-04 Thread Nicolas Bouillon (JIRA)

 [ 
https://issues.apache.org/activemq/browse/CAMEL-1418?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nicolas Bouillon updated CAMEL-1418:


Attachment: UseFilters.patch

Patch against camel-mina component

Added an endpoint param filters of type Listorg.apache.mina.common.IoFilter

The filters are added at the end of the filter chain, after the 
ProtocolCodecFilter (codec param) or the  
org.apache.mina.filter.LoggingFilter (minaLogger param).

If the user want to change the order, he can create its own ProtocolCodecFilter 
instance and put in in the chain at the place of its choice.

 Allow usage of any IoFilter in camel-mina, not only ProtocolCodecFilter
 ---

 Key: CAMEL-1418
 URL: https://issues.apache.org/activemq/browse/CAMEL-1418
 Project: Apache Camel
  Issue Type: New Feature
  Components: camel-mina
Affects Versions: 2.0.0
Reporter: Nicolas Bouillon
 Attachments: UseFilters.patch


 This should be possible to use any kind of IoFilter in a Mina endpoint.
 See http://mina.apache.org/iofilter.html for more information on Mina filters.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (CAMEL-1418) Allow usage of any IoFilter in camel-mina, not only ProtocolCodecFilter

2009-03-04 Thread Nicolas Bouillon (JIRA)

 [ 
https://issues.apache.org/activemq/browse/CAMEL-1418?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nicolas Bouillon updated CAMEL-1418:


Attachment: TestCase.patch

Test case for filter.
Patch against : components/camel-mina/src/test/java

 Allow usage of any IoFilter in camel-mina, not only ProtocolCodecFilter
 ---

 Key: CAMEL-1418
 URL: https://issues.apache.org/activemq/browse/CAMEL-1418
 Project: Apache Camel
  Issue Type: New Feature
  Components: camel-mina
Affects Versions: 2.0.0
Reporter: Nicolas Bouillon
 Attachments: TestCase.patch, UseFilters.patch


 This should be possible to use any kind of IoFilter in a Mina endpoint.
 See http://mina.apache.org/iofilter.html for more information on Mina filters.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (CAMEL-1411) CamelContext - Add ClassResolver to be used when you need to load a class instead of ObjectHelper.loadClass to work in OSGi environments

2009-03-04 Thread Hadrian Zbarcea (JIRA)

[ 
https://issues.apache.org/activemq/browse/CAMEL-1411?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=50207#action_50207
 ] 

Hadrian Zbarcea commented on CAMEL-1411:


@Charles, yes, there should be no difference if the deployment is in an osgi 
container or not.

 CamelContext - Add ClassResolver to be used when you need to load a class 
 instead of ObjectHelper.loadClass to work in OSGi environments
 

 Key: CAMEL-1411
 URL: https://issues.apache.org/activemq/browse/CAMEL-1411
 Project: Apache Camel
  Issue Type: Bug
  Components: camel-osgi
Affects Versions: 1.6.0
Reporter: Claus Ibsen
Assignee: Claus Ibsen
Priority: Critical
 Fix For: 2.0.0


 Add the skeleton and let Willem add the stuff in camel-osgi

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Resolved: (CAMEL-1421) Cxf Endpoint String bean properites are not merged

2009-03-04 Thread William Tam (JIRA)

 [ 
https://issues.apache.org/activemq/browse/CAMEL-1421?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

William Tam resolved CAMEL-1421.


Resolution: Fixed

Committed revision 750147.

 Cxf Endpoint String bean properites are not merged
 --

 Key: CAMEL-1421
 URL: https://issues.apache.org/activemq/browse/CAMEL-1421
 Project: Apache Camel
  Issue Type: Bug
  Components: camel-cxf
Affects Versions: 2.0.0
Reporter: William Tam
Assignee: William Tam
 Fix For: 2.0.0


 CxfEndpointBeanDefinitionParser maintains a property map that can be 
 overridden by user provided property map.  They should be merged.
 Please see the email thread. 
 http://www.nabble.com/camel-cxf---dataformat-tp22332652p22332652.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Work started: (CAMEL-1421) Cxf Endpoint String bean properites are not merged

2009-03-04 Thread William Tam (JIRA)

 [ 
https://issues.apache.org/activemq/browse/CAMEL-1421?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Work on CAMEL-1421 started by William Tam.

 Cxf Endpoint String bean properites are not merged
 --

 Key: CAMEL-1421
 URL: https://issues.apache.org/activemq/browse/CAMEL-1421
 Project: Apache Camel
  Issue Type: Bug
  Components: camel-cxf
Affects Versions: 2.0.0
Reporter: William Tam
Assignee: William Tam
 Fix For: 2.0.0


 CxfEndpointBeanDefinitionParser maintains a property map that can be 
 overridden by user provided property map.  They should be merged.
 Please see the email thread. 
 http://www.nabble.com/camel-cxf---dataformat-tp22332652p22332652.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



Re: svn commit: r750021 - in /camel/branches/camel-1.x: ./ camel-core/src/main/java/org/apache/camel/util/ components/camel-spring/src/test/java/org/apache/camel/spring/processor/onexception/ componen

2009-03-04 Thread Willem Jiang
Hi Claus,

Since Camel 1.x doesn't support the onException, I'd like to revert the
SpringOnExceptionNotNormalizedClassNameTest part and keep the change of
ObjectHelper.

Willem

davscl...@apache.org wrote:
 Author: davsclaus
 Date: Wed Mar  4 14:25:18 2009
 New Revision: 750021
 
 URL: http://svn.apache.org/viewvc?rev=750021view=rev
 Log:
 Merged revisions 750017 via svnmerge from 
 https://svn.apache.org/repos/asf/camel/trunk
 
 
   r750017 | davsclaus | 2009-03-04 15:20:14 +0100 (Wed, 04 Mar 2009) | 1 line
   
   CAMEL-1418: Normalizes class names before loading to avoid \n or other 
 chars by Spring DSL configuration with xml tags on newlines or hidden spaces 
 etc.
 
 
 Added:
 
 camel/branches/camel-1.x/components/camel-spring/src/test/java/org/apache/camel/spring/processor/onexception/SpringOnExceptionNotNormalizedClassNameTest.java
   - copied unchanged from r750017, 
 camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/onexception/SpringOnExceptionNotNormalizedClassNameTest.java
 
 camel/branches/camel-1.x/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/onexception/onExceptionNotNormalizedClassNameTest.xml
   - copied unchanged from r750017, 
 camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/onexception/onExceptionNotNormalizedClassNameTest.xml
 Modified:
 camel/branches/camel-1.x/   (props changed)
 
 camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
 
 Propchange: camel/branches/camel-1.x/
 --
 --- svn:mergeinfo (original)
 +++ svn:mergeinfo Wed Mar  4 14:25:18 2009
 @@ -1 +1 @@
 -/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749956
 +/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749956,750017
 
 Propchange: camel/branches/camel-1.x/
 --
 Binary property 'svnmerge-integrated' - no diff available.
 
 Modified: 
 camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
 URL: 
 http://svn.apache.org/viewvc/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java?rev=750021r1=750020r2=750021view=diff
 ==
 --- 
 camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
  (original)
 +++ 
 camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
  Wed Mar  4 14:25:18 2009
 @@ -478,6 +478,9 @@
   * @return the class or null if it could not be loaded
   */
  public static Class? loadClass(String name, ClassLoader loader) {
 +// must clean the name so its pure java name, eg remoing \n or 
 whatever people can do in the Spring XML
 +name = normalizeClassName(name);
 +
  // try context class loader first
  Class clazz = doLoadClass(name, 
 Thread.currentThread().getContextClassLoader());
  if (clazz == null) {
 @@ -843,4 +846,23 @@
  }
  }
  
 +/**
 + * Cleans the string to pure java identifier so we can use it for 
 loading class names.
 + * p/
 + * Especially from Sping DSL people can have \n \t or other characters 
 that otherwise
 + * would result in ClassNotFoundException
 + *
 + * @param name the class name
 + * @return normalized classname that can be load by a class loader.
 + */
 +public static String normalizeClassName(String name) {
 +StringBuffer sb = new StringBuffer(name.length());
 +for (char ch : name.toCharArray()) {
 +if (ch == '.' || Character.isJavaIdentifierPart(ch)) {
 +sb.append(ch);
 +}
 +}
 +return sb.toString();
 +}
 +
  }
 
 
 



Re: svn commit: r749973 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/component/mock/ main/java/org/apache/camel/processor/interceptor/ test/java/org/apache/camel/component/mock/ test/j

2009-03-04 Thread Willem Jiang
Hi Claus,

Does this change need to be merge in to 1.x branch ?

Thanks,

Willem

davscl...@apache.org wrote:
 Author: davsclaus
 Date: Wed Mar  4 12:06:11 2009
 New Revision: 749973
 
 URL: http://svn.apache.org/viewvc?rev=749973view=rev
 Log:
 CAMEL-1417: Fixed failing unit test as we can not use the lookup in type 
 converter registry. Improved expectedHeader to allow all types instead of 
 only string values. So now you can compare real numbers and whatelse.
 
 Modified:
 
 camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
 
 camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/StreamCachingInterceptor.java
 
 camel/trunk/camel-core/src/test/java/org/apache/camel/component/mock/MockEndpointTest.java
 
 camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RoutePerformanceTest.java
 
 Modified: 
 camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
 URL: 
 http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java?rev=749973r1=749972r2=749973view=diff
 ==
 --- 
 camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
  (original)
 +++ 
 camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
  Wed Mar  4 12:06:11 2009
 @@ -74,7 +74,7 @@
  private List actualBodyValues;
  private PropertyChangeSupport propertyChangeSupport = new 
 PropertyChangeSupport(this);
  private String headerName;
 -private String headerValue;
 +private Object headerValue;
  private Object actualHeader;
  private Processor reporter;
  
 @@ -308,7 +308,7 @@
   * Adds an expectation that the given header name  value are received 
 by this
   * endpoint
   */
 -public void expectedHeaderReceived(String name, String value) {
 +public void expectedHeaderReceived(final String name, final Object 
 value) {
  this.headerName = name;
  this.headerValue = value;
  
 @@ -316,7 +316,8 @@
  public void run() {
  assertTrue(No header with name  + headerName +  found., 
 actualHeader != null);
  
 -assertEquals(Header of message, headerValue, 
 actualHeader.toString());
 +Object actualValue = 
 getCamelContext().getTypeConverter().convertTo(actualHeader.getClass(), 
 headerValue);
 +assertEquals(Header of message, actualValue, actualHeader);
  }
  });
  }
 
 Modified: 
 camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/StreamCachingInterceptor.java
 URL: 
 http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/StreamCachingInterceptor.java?rev=749973r1=749972r2=749973view=diff
 ==
 --- 
 camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/StreamCachingInterceptor.java
  (original)
 +++ 
 camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/StreamCachingInterceptor.java
  Wed Mar  4 12:06:11 2009
 @@ -24,7 +24,6 @@
  import org.apache.camel.NoTypeConversionAvailableException;
  import org.apache.camel.Processor;
  import org.apache.camel.StreamCache;
 -import org.apache.camel.TypeConverter;
  import org.apache.camel.model.InterceptorRef;
  import org.apache.camel.model.InterceptorType;
  import org.apache.camel.processor.DelegateProcessor;
 @@ -64,39 +63,28 @@
  }
  }
  }
 -
 +
  @Override
  public void process(Exchange exchange) throws Exception {
  AsyncProcessorHelper.process(this, exchange);
  }
  
  public boolean process(Exchange exchange, AsyncCallback callback) {
 -// Change the body to StreamCache if possible
 -// important to lookup for the type converter to avoid excessive 
 overhead of trying to covnert if not possible
 -// as Camel will throw NoTypeConversionAvailableException that we 
 just ignores. So we want to avoid this
 -// exception handling as it hurts performance dramatically for high 
 throughput
 -// See also MessageSupport#getBody and CAMEL-1417
 -Object body = exchange.getIn().getBody();
 -if (body != null) {
 -TypeConverter tc = 
 exchange.getContext().getTypeConverterRegistry().lookup(StreamCache.class, 
 body.getClass());
 -if (tc != null) {
 -try {
 -StreamCache newBody = tc.convertTo(StreamCache.class, 
 exchange, body);
 -if (newBody != null) {
 -exchange.getIn().setBody(newBody);
 -}
 -MessageHelper.resetStreamCache(exchange.getIn());
 -} catch (NoTypeConversionAvailableException ex) {

[jira] Updated: (CAMEL-1422) Update the cxf endpoint's schema's target name space

2009-03-04 Thread Willem Jiang (JIRA)

 [ 
https://issues.apache.org/activemq/browse/CAMEL-1422?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Willem Jiang updated CAMEL-1422:


Fix Version/s: 2.0.0

 Update the cxf endpoint's schema's target name space
 

 Key: CAMEL-1422
 URL: https://issues.apache.org/activemq/browse/CAMEL-1422
 Project: Apache Camel
  Issue Type: Wish
  Components: camel-cxf
Reporter: Willem Jiang
Assignee: Willem Jiang
 Fix For: 2.0.0


 We need to use the http://camel.apache.org/schema/cxf; as the 
 cxfEndpoint.xsd's target namespace.
 Since it will break the compatibilities of  old camel 1.x configuration file. 
 we  need to update the wiki page for this change.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



Re: svn commit: r749973 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/component/mock/ main/java/org/apache/camel/processor/interceptor/ test/java/org/apache/camel/component/mock/ test

2009-03-04 Thread Claus Ibsen
On Thu, Mar 5, 2009 at 2:52 AM, Willem Jiang willem.ji...@gmail.com wrote:
 Hi Claus,

 Does this change need to be merge in to 1.x branch ?
No as the code change in StreamCachingInterceptor does not exists in
1.x. It was using a TypeConverterRegistry which does not exist in 1.x.

The other change to only wait 2 sec instead of 20 sec will of course
cut 18 sec on unit testing
+// wait at most 2 sec to speedup unit testing
+resultEndpoint.setResultWaitTime(2000);

And the last change to support Object instead of only String values
for expected header is fine only on trunk.



 Thanks,

 Willem

 davscl...@apache.org wrote:
 Author: davsclaus
 Date: Wed Mar  4 12:06:11 2009
 New Revision: 749973

 URL: http://svn.apache.org/viewvc?rev=749973view=rev
 Log:
 CAMEL-1417: Fixed failing unit test as we can not use the lookup in type 
 converter registry. Improved expectedHeader to allow all types instead of 
 only string values. So now you can compare real numbers and whatelse.

 Modified:
     
 camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
     
 camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/StreamCachingInterceptor.java
     
 camel/trunk/camel-core/src/test/java/org/apache/camel/component/mock/MockEndpointTest.java
     
 camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RoutePerformanceTest.java

 Modified: 
 camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
 URL: 
 http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java?rev=749973r1=749972r2=749973view=diff
 ==
 --- 
 camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
  (original)
 +++ 
 camel/trunk/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
  Wed Mar  4 12:06:11 2009
 @@ -74,7 +74,7 @@
      private List actualBodyValues;
      private PropertyChangeSupport propertyChangeSupport = new 
 PropertyChangeSupport(this);
      private String headerName;
 -    private String headerValue;
 +    private Object headerValue;
      private Object actualHeader;
      private Processor reporter;

 @@ -308,7 +308,7 @@
       * Adds an expectation that the given header name  value are received 
 by this
       * endpoint
       */
 -    public void expectedHeaderReceived(String name, String value) {
 +    public void expectedHeaderReceived(final String name, final Object 
 value) {
          this.headerName = name;
          this.headerValue = value;

 @@ -316,7 +316,8 @@
              public void run() {
                  assertTrue(No header with name  + headerName +  found., 
 actualHeader != null);

 -                assertEquals(Header of message, headerValue, 
 actualHeader.toString());
 +                Object actualValue = 
 getCamelContext().getTypeConverter().convertTo(actualHeader.getClass(), 
 headerValue);
 +                assertEquals(Header of message, actualValue, 
 actualHeader);
              }
          });
      }

 Modified: 
 camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/StreamCachingInterceptor.java
 URL: 
 http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/StreamCachingInterceptor.java?rev=749973r1=749972r2=749973view=diff
 ==
 --- 
 camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/StreamCachingInterceptor.java
  (original)
 +++ 
 camel/trunk/camel-core/src/main/java/org/apache/camel/processor/interceptor/StreamCachingInterceptor.java
  Wed Mar  4 12:06:11 2009
 @@ -24,7 +24,6 @@
  import org.apache.camel.NoTypeConversionAvailableException;
  import org.apache.camel.Processor;
  import org.apache.camel.StreamCache;
 -import org.apache.camel.TypeConverter;
  import org.apache.camel.model.InterceptorRef;
  import org.apache.camel.model.InterceptorType;
  import org.apache.camel.processor.DelegateProcessor;
 @@ -64,39 +63,28 @@
              }
          }
      }
 -
 +
     �...@override
      public void process(Exchange exchange) throws Exception {
          AsyncProcessorHelper.process(this, exchange);
      }

      public boolean process(Exchange exchange, AsyncCallback callback) {
 -        // Change the body to StreamCache if possible
 -        // important to lookup for the type converter to avoid excessive 
 overhead of trying to covnert if not possible
 -        // as Camel will throw NoTypeConversionAvailableException that we 
 just ignores. So we want to avoid this
 -        // exception handling as it hurts performance dramatically for high 
 throughput
 -        // See also MessageSupport#getBody and CAMEL-1417
 -        Object body = exchange.getIn().getBody();
 -        if (body != null) {
 -            

Re: svn commit: r750021 - in /camel/branches/camel-1.x: ./ camel-core/src/main/java/org/apache/camel/util/ components/camel-spring/src/test/java/org/apache/camel/spring/processor/onexception/ compon

2009-03-04 Thread Claus Ibsen
On Thu, Mar 5, 2009 at 2:10 AM, Willem Jiang willem.ji...@gmail.com wrote:
 Hi Claus,

 Since Camel 1.x doesn't support the onException, I'd like to revert the
 SpringOnExceptionNotNormalizedClassNameTest part and keep the change of
 ObjectHelper.
Ah I got it, the problem was that onexception did not exists as a
package name for unit testing 1.x.
Yeah that is fine to remove the unit tests. We have them in trunk.

The feature onException for error handling is of course also available
in Camel 1.x


 Willem

 davscl...@apache.org wrote:
 Author: davsclaus
 Date: Wed Mar  4 14:25:18 2009
 New Revision: 750021

 URL: http://svn.apache.org/viewvc?rev=750021view=rev
 Log:
 Merged revisions 750017 via svnmerge from
 https://svn.apache.org/repos/asf/camel/trunk

 
   r750017 | davsclaus | 2009-03-04 15:20:14 +0100 (Wed, 04 Mar 2009) | 1 line

   CAMEL-1418: Normalizes class names before loading to avoid \n or other 
 chars by Spring DSL configuration with xml tags on newlines or hidden spaces 
 etc.
 

 Added:
     
 camel/branches/camel-1.x/components/camel-spring/src/test/java/org/apache/camel/spring/processor/onexception/SpringOnExceptionNotNormalizedClassNameTest.java
       - copied unchanged from r750017, 
 camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/onexception/SpringOnExceptionNotNormalizedClassNameTest.java
     
 camel/branches/camel-1.x/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/onexception/onExceptionNotNormalizedClassNameTest.xml
       - copied unchanged from r750017, 
 camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/onexception/onExceptionNotNormalizedClassNameTest.xml
 Modified:
     camel/branches/camel-1.x/   (props changed)
     
 camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java

 Propchange: camel/branches/camel-1.x/
 --
 --- svn:mergeinfo (original)
 +++ svn:mergeinfo Wed Mar  4 14:25:18 2009
 @@ -1 +1 @@
 -/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749956
 +/camel/trunk:736980,739733,739904,740251,740295,740306,740596,740663,741848,742231,742705,742739,742854,742856,742898,742906,743613,743762,743773,743920,743959-743960,744123,745105,745367,745541,745751,745826,745978,746269,746872,746895,746962,747258,747678-747704,748392,748436,748821,749563-749564,749574,749628-749629,749956,750017

 Propchange: camel/branches/camel-1.x/
 --
 Binary property 'svnmerge-integrated' - no diff available.

 Modified: 
 camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
 URL: 
 http://svn.apache.org/viewvc/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java?rev=750021r1=750020r2=750021view=diff
 ==
 --- 
 camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
  (original)
 +++ 
 camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
  Wed Mar  4 14:25:18 2009
 @@ -478,6 +478,9 @@
       * @return the class or null if it could not be loaded
       */
      public static Class? loadClass(String name, ClassLoader loader) {
 +        // must clean the name so its pure java name, eg remoing \n or 
 whatever people can do in the Spring XML
 +        name = normalizeClassName(name);
 +
          // try context class loader first
          Class clazz = doLoadClass(name, 
 Thread.currentThread().getContextClassLoader());
          if (clazz == null) {
 @@ -843,4 +846,23 @@
          }
      }

 +    /**
 +     * Cleans the string to pure java identifier so we can use it for 
 loading class names.
 +     * p/
 +     * Especially from Sping DSL people can have \n \t or other characters 
 that otherwise
 +     * would result in ClassNotFoundException
 +     *
 +     * @param name the class name
 +     * @return normalized classname that can be load by a class loader.
 +     */
 +    public static String normalizeClassName(String name) {
 +        StringBuffer sb = new StringBuffer(name.length());
 +        for (char ch : name.toCharArray()) {
 +            if (ch == '.' || Character.isJavaIdentifierPart(ch)) {
 +                sb.append(ch);
 +            }
 +        }
 +        return sb.toString();
 +    }
 +
  }








-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/


[jira] Assigned: (CAMEL-1418) Allow usage of any IoFilter in camel-mina, not only ProtocolCodecFilter

2009-03-04 Thread Claus Ibsen (JIRA)

 [ 
https://issues.apache.org/activemq/browse/CAMEL-1418?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen reassigned CAMEL-1418:
--

Assignee: Claus Ibsen

 Allow usage of any IoFilter in camel-mina, not only ProtocolCodecFilter
 ---

 Key: CAMEL-1418
 URL: https://issues.apache.org/activemq/browse/CAMEL-1418
 Project: Apache Camel
  Issue Type: New Feature
  Components: camel-mina
Affects Versions: 2.0.0
Reporter: Nicolas Bouillon
Assignee: Claus Ibsen
 Attachments: TestCase.patch, UseFilters.patch


 This should be possible to use any kind of IoFilter in a Mina endpoint.
 See http://mina.apache.org/iofilter.html for more information on Mina filters.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Resolved: (CAMEL-1418) Allow usage of any IoFilter in camel-mina, not only ProtocolCodecFilter

2009-03-04 Thread Claus Ibsen (JIRA)

 [ 
https://issues.apache.org/activemq/browse/CAMEL-1418?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-1418.


   Resolution: Fixed
Fix Version/s: 2.0.0

Applied patch with thanks to Nicolas

Committed revision 750338.


 Allow usage of any IoFilter in camel-mina, not only ProtocolCodecFilter
 ---

 Key: CAMEL-1418
 URL: https://issues.apache.org/activemq/browse/CAMEL-1418
 Project: Apache Camel
  Issue Type: New Feature
  Components: camel-mina
Affects Versions: 2.0.0
Reporter: Nicolas Bouillon
Assignee: Claus Ibsen
 Fix For: 2.0.0

 Attachments: TestCase.patch, UseFilters.patch


 This should be possible to use any kind of IoFilter in a Mina endpoint.
 See http://mina.apache.org/iofilter.html for more information on Mina filters.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



Edit wiki

2009-03-04 Thread Nicolas Bouillon
Hi,

I would like to have rights to edit the wiki. I would like to add some
example for mina filters.

My Confluence username is my email address, and my JIRA username is bouil.

Regards
Nicolas.