svn commit: r962423 - /camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/

2010-07-09 Thread davsclaus
Author: davsclaus
Date: Fri Jul  9 06:03:52 2010
New Revision: 962423

URL: http://svn.apache.org/viewvc?rev=962423view=rev
Log:
CAMEL-2927: Fixed examples a bit.

Modified:

camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateGroupedExchangeBatchSizeTest.java

camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateGroupedExchangeMultipleCorrelationTest.java

camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateGroupedExchangeSizePredicateTest.java

camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateGroupedExchangeSizeTest.java

camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateGroupedExchangeTest.java

camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/DefaultAggregatorCollectionTest.java

Modified: 
camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateGroupedExchangeBatchSizeTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateGroupedExchangeBatchSizeTest.java?rev=962423r1=962422r2=962423view=diff
==
--- 
camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateGroupedExchangeBatchSizeTest.java
 (original)
+++ 
camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateGroupedExchangeBatchSizeTest.java
 Fri Jul  9 06:03:52 2010
@@ -74,8 +74,9 @@ public class AggregateGroupedExchangeBat
 // START SNIPPET: e1
 // our route is aggregating from the direct queue and sending 
the response to the mock
 from(direct:start)
+.log(Aggregator received ${body})
 // aggregated all use same expression
-.aggregate().constant(true).completionSize(2)
+.aggregate(constant(true)).completionSize(2)
 // wait for 0.5 seconds to aggregate
 .completionTimeout(500L)
 // group the exchanges so we get one single exchange 
containing all the others

Modified: 
camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateGroupedExchangeMultipleCorrelationTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateGroupedExchangeMultipleCorrelationTest.java?rev=962423r1=962422r2=962423view=diff
==
--- 
camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateGroupedExchangeMultipleCorrelationTest.java
 (original)
+++ 
camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateGroupedExchangeMultipleCorrelationTest.java
 Fri Jul  9 06:03:52 2010
@@ -78,7 +78,7 @@ public class AggregateGroupedExchangeMul
 // our route is aggregating from the direct queue and sending 
the response to the mock
 from(direct:start)
 // aggregate all using the foo header
-.aggregate().header(foo)
+.aggregate(header(foo))
 // group the exchanges so we get one single exchange 
containing all the others
 .groupExchanges()
 // wait for 1 seconds to aggregate

Modified: 
camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateGroupedExchangeSizePredicateTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateGroupedExchangeSizePredicateTest.java?rev=962423r1=962422r2=962423view=diff
==
--- 
camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateGroupedExchangeSizePredicateTest.java
 (original)
+++ 
camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateGroupedExchangeSizePredicateTest.java
 Fri Jul  9 06:03:52 2010
@@ -64,7 +64,7 @@ public class AggregateGroupedExchangeSiz
 public void configure() throws Exception {
 from(direct:start)
 // must use eagerCheckCompletion so we can check the 
groupSize header on the incoming exchange 
-
.aggregate().constant(true).groupExchanges().eagerCheckCompletion().completionSize(header(groupSize))
+
.aggregate(constant(true)).groupExchanges().eagerCheckCompletion().completionSize(header(groupSize))
 .to(mock:result)
 .end();
 }

Modified: 
camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateGroupedExchangeSizeTest.java
URL: 

svn commit: r962425 - /camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultDebugger.java

2010-07-09 Thread davsclaus
Author: davsclaus
Date: Fri Jul  9 06:12:52 2010
New Revision: 962425

URL: http://svn.apache.org/viewvc?rev=962425view=rev
Log:
CAMEL-2919: Polished

Modified:

camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultDebugger.java

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultDebugger.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultDebugger.java?rev=962425r1=962424r2=962425view=diff
==
--- 
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultDebugger.java 
(original)
+++ 
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultDebugger.java 
Fri Jul  9 06:12:52 2010
@@ -330,6 +330,8 @@ public class DefaultDebugger implements 
 camelContext.addService(tracer);
 camelContext.addInterceptStrategy(tracer);
 }
+// make sure tracer is enabled so the debugger can leverage the tracer 
for debugging purposes
+tracer.setEnabled(true);
 }
 
 public void stop() throws Exception {




svn commit: r962430 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/language/bean/ main/java/org/apache/camel/model/ main/java/org/apache/camel/model/language/ test/java/org/apache/camel/

2010-07-09 Thread davsclaus
Author: davsclaus
Date: Fri Jul  9 07:24:18 2010
New Revision: 962430

URL: http://svn.apache.org/viewvc?rev=962430view=rev
Log:
CAMEL-2920: Eager validation for beanRef and method ref that the bean ref 
exists in registry.

Added:

camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanRefNotFoundTest.java
   (with props)

camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/MethodCallBeanRefNotFoundTest.java
   (with props)
Modified:

camel/trunk/camel-core/src/main/java/org/apache/camel/language/bean/BeanExpression.java

camel/trunk/camel-core/src/main/java/org/apache/camel/model/BeanDefinition.java

camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/MethodCallExpression.java
camel/trunk/camel-core/src/test/java/org/apache/camel/view/DotViewTest.java

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/language/bean/BeanExpression.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/language/bean/BeanExpression.java?rev=962430r1=962429r2=962430view=diff
==
--- 
camel/trunk/camel-core/src/main/java/org/apache/camel/language/bean/BeanExpression.java
 (original)
+++ 
camel/trunk/camel-core/src/main/java/org/apache/camel/language/bean/BeanExpression.java
 Fri Jul  9 07:24:18 2010
@@ -190,7 +190,7 @@ public class BeanExpression implements E
 // keep up with how far are we doing
 ognlPath += methodName;
 
-// get rid of leading ?. or . as we only needed that to 
determine if elvis was enabled or not
+// get rid of leading ?. or . as we only needed that to 
determine if null safe was enabled or not
 methodName = OgnlHelper.removeLeadingOperators(methodName);
 
 // are we doing an index lookup (eg in Map/List/array etc)?
@@ -264,7 +264,7 @@ public class BeanExpression implements E
 return list.get(num);
 }
 if (!nullSafe) {
-// not elvis then its mandatory so thrown out of 
bounds exception
+// not null safe then its mandatory so thrown out of 
bounds exception
 throw new IndexOutOfBoundsException(Index:  + num + 
, Size:  + list.size()
 +  out of bounds with List from bean:  + 
bean + using OGNL path [ + ognlPath + ]);
 }

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/model/BeanDefinition.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/BeanDefinition.java?rev=962430r1=962429r2=962430view=diff
==
--- 
camel/trunk/camel-core/src/main/java/org/apache/camel/model/BeanDefinition.java 
(original)
+++ 
camel/trunk/camel-core/src/main/java/org/apache/camel/model/BeanDefinition.java 
Fri Jul  9 07:24:18 2010
@@ -22,6 +22,7 @@ import javax.xml.bind.annotation.XmlAttr
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlTransient;
 
+import org.apache.camel.NoSuchBeanException;
 import org.apache.camel.Processor;
 import org.apache.camel.component.bean.BeanProcessor;
 import org.apache.camel.component.bean.RegistryBean;
@@ -148,6 +149,10 @@ public class BeanDefinition extends Outp
 public Processor createProcessor(RouteContext routeContext) {
 BeanProcessor answer;
 if (ObjectHelper.isNotEmpty(ref)) {
+// if its a ref then check that the ref exists
+if (routeContext.getCamelContext().getRegistry().lookup(ref) == 
null) {
+throw new NoSuchBeanException(ref);
+}
 answer = new BeanProcessor(new 
RegistryBean(routeContext.getCamelContext(), ref));
 } else {
 if (bean == null) {

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/MethodCallExpression.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/MethodCallExpression.java?rev=962430r1=962429r2=962430view=diff
==
--- 
camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/MethodCallExpression.java
 (original)
+++ 
camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/MethodCallExpression.java
 Fri Jul  9 07:24:18 2010
@@ -24,6 +24,7 @@ import javax.xml.bind.annotation.XmlTran
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.Expression;
+import org.apache.camel.NoSuchBeanException;
 import org.apache.camel.Predicate;
 import org.apache.camel.language.bean.BeanExpression;
 import org.apache.camel.util.ObjectHelper;
@@ -102,7 +103,12 @@ public class MethodCallExpression extend
 } else if (instance != 

[CONF] Apache Camel Camel 2.4.0 Release

2010-07-09 Thread confluence







Camel 2.4.0 Release
Page edited by Claus Ibsen


 Changes (1)
 



...
* [camel-jms|JMS] now supports Oracle AQ * Added a [Debugger|Camel 2.x - Debugger API] API to be leveraged by 3rd party tooling. 
* The {{beanRef}} and {{methodCall}} DSLs will eager check on startup, the bean reference exists in [Registry] and the provided method name is a valid method name on the bean as well. This helps to fail fast if end users have a typo in their routes. 
 h3. New [Enterprise Integration Patterns] 
...

Full Content

Camel 2.4.0 release (currently in progress)




New and Noteworthy

Welcome to the 2.4.0 release which approx XXX issues resolved (new features, improvements and bug fixes such as...)


	Fully non blocking asynchronous routing engine which all EIPs and some Camel Components supported.
	New feature to use scheduled delayed redelivery attempts (they are fully asynchronous and non blocking). You need to enable this using the option asyncDelayedRedelivery.
	Fixed a potential dead-lock when using Aggregator with timeout completion set.
	The camel-spring module now supports OSGi out of box, which renders camel-osgi as @deprecated.
	OSGi blueprint is now supported
	Added new contextScan to scan the Registry for RouteBuilder instances, just as scanning the classpath etc.
	Manually started routes is now also Graceful Shutdown by Camel
	Fixed issue using RouteContextRef with multiple CamelContext from the same Spring ApplicationContext.
	Bindy now supports Fixed-Length format message with padding, alignment (Left or Right)
	Improved and fixes some issues with the FTP component.
	Improved and fixed some issues using MultiPartForm with Jetty.
	Add ability to configure Bindy to remove whitespace when binding Numeric positions
	Added option useOriginalBody to OnCompletion
	Fixed issue when using mockito for testing when it uses CGLib proxies
	Fixed issue with @Consume not running in an unit of work to ensure callbacks is invoked when its done
	Routing Slip now uses _expression_ to define the slip. This is similar to the Recipient List pattern
	The security context can be passed from CXF to other camel Components.
	ManagementAgent settings can now be set using setters from Java, instead of having to use JVM system properties. See tip in Camel JMX wiki page.
	Resequencer in batch mode has two new options allowDuplicates and reverse which allows you to use it for re-ordering messages from JMS queues based on JMSPriority
	Tighten up the ProducerTemplate API a bit, see more details in the section Important changes to consider when upgrading.
	HTTP now better supports sending binary files.
	Fixed problem with using Quartz in OSGi and having Camel applications being hot-deployed which potentially could cause Quartz to stop scheduling in applications which haven't been stopped.
	Fixed issue with pausing and resuming jobs when running Quartz in clustered mode
	Added options on Quartz component to specify location of custom quartz.properties file to load from classpath.
	Upgraded to latest Quartz release 1.8.3.
	Introduced StartupListener to allow components/endpoints/producers/consumers etc. as a listener to be notified when CamelContext have just been started. This allows any custom logic to be executed as a late starter. This ensures Quartz scheduler is only started when all the routes and so forth is started and running.
	Fixed issue with FTP configuring starting directory from uri not accepting an absolute path. In the endpoint uri just define two leading / to indicate absolute, eg "ftp:admin:sec...@someserver//absolutepath/foo/bar".
	Added fromRoute to NotifyBuilder.
	Improved the CSV component.
	Fixed issue with Direct endpoint having no consumers if endpoint have been evicted from CamelContext internal LRUCache.
	The RouteBuilder now have simple and xpath _expression_ builder methods out of the box.
	Upgraded to latest release of Scala 2.8.0RC7 in Scala DSL
	camel-hawtdb updated to HawtDB 1.1 picks up several bug fixes that improves stability and performance.
	Fixed issue with splitting files using tokenizer not being able to delete/move file after processing is done on Windows platform.
	maxMessagesPerPoll is now applied eagerly to limit intaking files earlier for the File and FTP components, Thus avoid excessive memory consumption if you poll directories which contains 100.000+ files.
	Added connectTimeout, soTimeout and timeout to FTP so its easier to configure timeouts.
	Consolidated support for per platform disabling of tests across the entire test suite.
	Introduced ProcessorFactory to be able to use a custom factory to be able to manipulate Processor creation process. For example to add additional outputs or manipulate the route model.
	camel-jms now supports Oracle AQ
	Added a 

svn commit: r962445 - in /camel/trunk: components/camel-spring-javaconfig/ examples/camel-example-spring-javaconfig/ parent/ platforms/karaf/features/ platforms/karaf/features/src/main/resources/

2010-07-09 Thread ningjiang
Author: ningjiang
Date: Fri Jul  9 08:36:35 2010
New Revision: 962445

URL: http://svn.apache.org/viewvc?rev=962445view=rev
Log:
CAMEL-2928 Upgrade to Spring 3.0.x as default Spring version

Added:

camel/trunk/platforms/karaf/features/src/main/resources/features-spring2.xml   
(props changed)
  - copied unchanged from r962294, 
camel/trunk/platforms/karaf/features/src/main/resources/features.xml
camel/trunk/platforms/karaf/features/src/main/resources/features.xml   
(props changed)
  - copied unchanged from r962294, 
camel/trunk/platforms/karaf/features/src/main/resources/features-spring3.xml
Removed:
camel/trunk/platforms/karaf/features/src/main/resources/features-spring3.xml
Modified:
camel/trunk/components/camel-spring-javaconfig/pom.xml
camel/trunk/examples/camel-example-spring-javaconfig/pom.xml
camel/trunk/parent/pom.xml
camel/trunk/platforms/karaf/features/pom.xml

Modified: camel/trunk/components/camel-spring-javaconfig/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-spring-javaconfig/pom.xml?rev=962445r1=962444r2=962445view=diff
==
--- camel/trunk/components/camel-spring-javaconfig/pom.xml (original)
+++ camel/trunk/components/camel-spring-javaconfig/pom.xml Fri Jul  9 08:36:35 
2010
@@ -40,7 +40,7 @@
 *
 /camel.osgi.import
 spring-version3.0.0.RELEASE/spring-version
-junit-version4.6/junit-version
+junit-version4.8.1/junit-version
   /properties
   
   repositories

Modified: camel/trunk/examples/camel-example-spring-javaconfig/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-spring-javaconfig/pom.xml?rev=962445r1=962444r2=962445view=diff
==
--- camel/trunk/examples/camel-example-spring-javaconfig/pom.xml (original)
+++ camel/trunk/examples/camel-example-spring-javaconfig/pom.xml Fri Jul  9 
08:36:35 2010
@@ -38,11 +38,11 @@
org.springframework.osgi.*;version=[1.2,2),
org.springframework.*;version=[3,4),

org.apache.activemq.xbean,org.apache.activemq.broker,org.apache.activemq.pool
-/camel.osgi.import
+/camel.osgi.import
!-- avoid to import the bunch of spring related package --
camel.osgi.dynamic*/camel.osgi.dynamic
spring-version3.0.0.RELEASE/spring-version
-   junit-version4.6/junit-version
+   junit-version4.8.1/junit-version
/properties
 
dependencies

Modified: camel/trunk/parent/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=962445r1=962444r2=962445view=diff
==
--- camel/trunk/parent/pom.xml (original)
+++ camel/trunk/parent/pom.xml Fri Jul  9 08:36:35 2010
@@ -87,8 +87,7 @@
 jettison-version1.2/jettison-version
 jruby-version1.4.0/jruby-version
 juel-version2.1.2/juel-version
-!-- spring 2.5.x is only compatible with junit 4.4 or lower - see 
SPR-5145 --
-junit-version4.4/junit-version
+junit-version4.8.1/junit-version
 log4j-version1.2.16/log4j-version
 lucene-version3.0.1/lucene-version
 mina-version1.1.7/mina-version
@@ -112,7 +111,7 @@
 spring-ehcache-version1.6.2/spring-ehcache-version
 spring-integration-version1.0.4.RELEASE/spring-integration-version
 spring-javaconfig-version1.0.0-20090215/spring-javaconfig-version
-spring-version2.5.6/spring-version
+spring-version3.0.2.RELEASE/spring-version
 spring-osgi-version1.2.0/spring-osgi-version
 stax-api-version1.0.1/stax-api-version
 stringtemplate-version3.0/stringtemplate-version
@@ -1521,17 +1520,12 @@
   /build
 /profile
 profile
-  idspring-3.x/id
+  idspring-2.x/id
   properties
- spring-version3.0.3.RELEASE/spring-version
- junit-version4.8.1/junit-version 
+ spring-version2.5.6/spring-version
+ !-- spring 2.5.x is only compatible with junit 4.4 or lower - see 
SPR-5145 --
+ junit-version4.4/junit-version 
   /properties
-  !--repositories
- repository
-   idSpringSource Enterprise Bundle Repositorys/id
-   urlhttp://repository.springsource.com/maven/bundles/release/url
- /repository
-  /repositories--
 /profile
 profile
   idon-sunjdk/id

Modified: camel/trunk/platforms/karaf/features/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/platforms/karaf/features/pom.xml?rev=962445r1=962444r2=962445view=diff
==
--- camel/trunk/platforms/karaf/features/pom.xml (original)
+++ camel/trunk/platforms/karaf/features/pom.xml Fri Jul  9 08:36:35 2010
@@ -216,7 +216,7 @@
classifierfeatures/classifier
   

[CONF] Apache Camel Architecture

2010-07-09 Thread confluence







Architecture
Page edited by Claus Ibsen


 Changes (1)
 



...
The following links are to the individual parts of the Architecture.  
{children:sort=title} 
 h2. Diagram 
...

Full Content

Architecture

Camel uses a Java based Routing Domain Specific Language (DSL) or an Xml Configuration to configure routing and mediation rules which are added to a CamelContext to implement the various Enterprise Integration Patterns. 

At a high level Camel consists of a CamelContext which contains a collection of Component instances. A Component is essentially a factory of Endpoint instances. You can explicitly configure Component instances in Java code or an IoC container like Spring or Guice, or they can be auto-discovered using URIs. 

An Endpoint acts rather like a URI or URL in a web application or a Destination in a JMS system; you can communicate with an endpoint; either sending messages to it or consuming messages from it. You can then create a Producer or Consumer on an Endpoint to exchange messages with it.

The DSL makes heavy use of pluggable Languages to create an _expression_ or Predicate to make a truly powerful DSL which is extensible to the most suitable language depending on your needs. The following languages are supported


	Bean Language for using Java for expressions
	Constant
	the unified EL from JSP and JSF
	Header
	JXPath
	Mvel
	OGNL
	Property
	Scala DSL
	Scripting Languages such as
	
		BeanShell
		_javascript_
		Groovy
		Python
		PHP
		Ruby
	
	
	Simple
	
		File Language
	
	
	SQL
	XPath
	XQuery



Most of these languages is also supported used as Annotation Based _expression_ Language.

Contents

The following links are to the individual parts of the Architecture.

AOPAsyncAsynchronous Routing EngineBAMBatch ConsumerBrowsableEndpointCamelContextCamel-CoreClustering and loadbalancingComponentData FormatDebuggerDelay InterceptorDependency InjectionDozer Type ConversionDSLEndpointError HandlerExchangeExchange Pattern_expression_InjectorInterceptInversion Of Control With Smart DefaultsLanguagesLifecycleOnCompletionPluggable Class ResolversPredicateProcessorProcessorFactoryRegistryRouteBuilderRoutePolicyRoutesServicePoolStream cachingThreading ModelToAsyncTracerTransportType ConverterURIsXml Configuration

Diagram






Change Notification Preferences

View Online
|
View Changes
|
Add Comment









svn commit: r962451 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/component/bean/ main/java/org/apache/camel/model/ main/java/org/apache/camel/model/language/ test/java/org/apache/camel

2010-07-09 Thread davsclaus
Author: davsclaus
Date: Fri Jul  9 08:54:31 2010
New Revision: 962451

URL: http://svn.apache.org/viewvc?rev=962451view=rev
Log:
CAMEL-2920: beanRef and method call DSL now validate method name is a valid 
method on startup. Better to fail fast.

Added:

camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanRefMethodNotFoundTest.java
  - copied, changed from r962430, 
camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanRefNotFoundTest.java

camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/MethodCallBeanRefMethodNotFoundTest.java
  - copied, changed from r962430, 
camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/MethodCallBeanRefNotFoundTest.java
Removed:

camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatorBeanThrowExceptionTest.java
Modified:

camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java

camel/trunk/camel-core/src/main/java/org/apache/camel/model/BeanDefinition.java

camel/trunk/camel-core/src/main/java/org/apache/camel/model/language/MethodCallExpression.java

camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanInfoTest.java

camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/BeanWithMethodHeaderTest.java

camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/MethodCallBeanRefNotFoundTest.java
camel/trunk/camel-core/src/test/java/org/apache/camel/view/DotViewTest.java

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java?rev=962451r1=962450r2=962451view=diff
==
--- 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
 (original)
+++ 
camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
 Fri Jul  9 08:54:31 2010
@@ -23,6 +23,8 @@ import java.lang.reflect.Proxy;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -132,7 +134,7 @@ public class BeanInfo {
 
 String name = exchange.getIn().getHeader(Exchange.BEAN_METHOD_NAME, 
String.class);
 if (name != null) {
-if (hasOperations(name)) {
+if (hasMethod(name)) {
 ListMethodInfo methods = getOperations(name);
 if (methods != null  methods.size() == 1) {
 // only one method then choose it
@@ -231,7 +233,7 @@ public class BeanInfo {
 LOG.trace(Adding operation:  + opName +  for method:  + 
methodInfo);
 }
 
-if (hasOperations(opName)) {
+if (hasMethod(opName)) {
 // we have an overloaded method so add the method info to the same 
key
 ListMethodInfo existing = getOperations(opName);
 existing.add(methodInfo);
@@ -672,7 +674,7 @@ public class BeanInfo {
 }
 
 /**
- * Do we have an operation with the given name.
+ * Do we have a method with the given name.
  * p/
  * Shorthand method names for getters is supported, so you can pass in eg 
'name' and Camel
  * will can find the real 'getName' method instead.
@@ -680,11 +682,36 @@ public class BeanInfo {
  * @param methodName the method name
  * @return tttrue/tt if we have such a method.
  */
-private boolean hasOperations(String methodName) {
+public boolean hasMethod(String methodName) {
 return getOperations(methodName) != null;
 }
 
 /**
+ * Gets the list of methods sorted by A..Z method name.
+ *
+ * @return the methods.
+ */
+@SuppressWarnings(unchecked)
+public ListMethodInfo getMethods() {
+if (operations.isEmpty()) {
+return Collections.EMPTY_LIST;
+}
+
+ListMethodInfo methods = new ArrayListMethodInfo();
+for (CollectionMethodInfo col : operations.values()) {
+methods.addAll(col);
+}
+
+// sort the methods by name A..Z
+Collections.sort(methods, new ComparatorMethodInfo() {
+public int compare(MethodInfo o1, MethodInfo o2) {
+return 
o1.getMethod().getName().compareTo(o2.getMethod().getName());
+}
+});
+return methods;
+}
+
+/**
  * Get the operation(s) with the given name. We can have multiple when 
methods is overloaded.
  * p/
  * Shorthand method names for getters is supported, so you can pass in eg 
'name' and Camel

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/model/BeanDefinition.java
URL: 

[CONF] Apache Camel Asynchronous Routing Engine

2010-07-09 Thread confluence







Asynchronous Routing Engine
Page  added by Claus Ibsen

 

 Asynchronous Routing Engine
Available as of Camel 2.4

As of Camel 2.4 the asynchronous routing engine is back and kicking.
All the Enterprise Integration Patterns is supported as well a selected number of Components:

	JBI
	NMR
	CXF (requires Camel 2.5)
	Jetty
	Netty



When we say a component is supported, that means, the component is leveraging the asynchronous model. For example Jetty uses continuations and the async http client to be fully asynchronous and non blocked. That means no threads will ever be blocked while waiting for a reply.

In the future additional Components will be supported as well where it's applicable.


Background information

See Asynchronous Processing for additional information and the concepts behind the asynchronous model.



   
Change Notification Preferences
   
   View Online
  |
   Add Comment
   








svn commit: r962454 - in /camel/trunk: components/camel-spring-javaconfig/pom.xml examples/camel-example-spring-javaconfig/pom.xml parent/pom.xml

2010-07-09 Thread ningjiang
Author: ningjiang
Date: Fri Jul  9 09:03:01 2010
New Revision: 962454

URL: http://svn.apache.org/viewvc?rev=962454view=rev
Log:
CAMEL-2928 Upgrade spring version to 3.0.3.RELEASE by default

Modified:
camel/trunk/components/camel-spring-javaconfig/pom.xml
camel/trunk/examples/camel-example-spring-javaconfig/pom.xml
camel/trunk/parent/pom.xml

Modified: camel/trunk/components/camel-spring-javaconfig/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-spring-javaconfig/pom.xml?rev=962454r1=962453r2=962454view=diff
==
--- camel/trunk/components/camel-spring-javaconfig/pom.xml (original)
+++ camel/trunk/components/camel-spring-javaconfig/pom.xml Fri Jul  9 09:03:01 
2010
@@ -39,7 +39,7 @@
 org.springframework.*;version=[3,4),
 *
 /camel.osgi.import
-spring-version3.0.0.RELEASE/spring-version
+spring-version3.0.3.RELEASE/spring-version
 junit-version4.8.1/junit-version
   /properties
   

Modified: camel/trunk/examples/camel-example-spring-javaconfig/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-spring-javaconfig/pom.xml?rev=962454r1=962453r2=962454view=diff
==
--- camel/trunk/examples/camel-example-spring-javaconfig/pom.xml (original)
+++ camel/trunk/examples/camel-example-spring-javaconfig/pom.xml Fri Jul  9 
09:03:01 2010
@@ -41,7 +41,7 @@
 /camel.osgi.import
!-- avoid to import the bunch of spring related package --
camel.osgi.dynamic*/camel.osgi.dynamic
-   spring-version3.0.0.RELEASE/spring-version
+   spring-version3.0.3.RELEASE/spring-version
junit-version4.8.1/junit-version
/properties
 

Modified: camel/trunk/parent/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=962454r1=962453r2=962454view=diff
==
--- camel/trunk/parent/pom.xml (original)
+++ camel/trunk/parent/pom.xml Fri Jul  9 09:03:01 2010
@@ -111,7 +111,7 @@
 spring-ehcache-version1.6.2/spring-ehcache-version
 spring-integration-version1.0.4.RELEASE/spring-integration-version
 spring-javaconfig-version1.0.0-20090215/spring-javaconfig-version
-spring-version3.0.2.RELEASE/spring-version
+spring-version3.0.3.RELEASE/spring-version
 spring-osgi-version1.2.0/spring-osgi-version
 stax-api-version1.0.1/stax-api-version
 stringtemplate-version3.0/stringtemplate-version




[CONF] Apache Camel Building

2010-07-09 Thread confluence







Building
Page edited by willem jiang


Comment:
CAMEL-2928


 Changes (5)
 



...
{code}  
h3. Building with Spring 3.0 2.5.6 
Camel is shipped build with Spring 2.5.6. If you want Camel to be build against Spring 3.0 you have to build with the maven profile {{spring-3.x}}. 
From Camel 2.4.0, we switch the default Spring version to 3.0.x, If you want Camel to be build against Spring 2.5.6 you have to build with the maven profile {{spring-2.x}}. 
{code} 
mvn clean install -Pspring-32.x 
{code}  You may want to skip testing and do a fast build {code} 
mvn clean install -Pspring-32.x -Dtest=false 
{code}  
...

Full Content

Building 

Camel uses Maven as its build tool. If you don't fancy using Maven you can use your IDE directly or Download a distribution or JAR.

Prequisites

Required:

	Download and install Maven. (Currently Maven 2.0.9 is used to build the official releases, some components will not build with 2.1+)
	Get the latest Source
	Java 1.5



Optional:

	Prince should be in the executable PATH to generate the PDF documentation



Maven options

To build camel maven has to be configured to use more memory



set MAVEN_OPTS=-Xmx512m -XX:MaxPermSize=128m



A normal build



mvn install



Doing a Quick Build

The following avoids running all the unit test cases, we just skip the test running phase and not the building part


mvn -DskipTests clean install 



Using an IDE

If you prefer to use an IDE then you can auto-generate the IDE's project files using maven plugins. e.g.



mvn eclipse:eclipse



or



mvn idea:idea



Adding Camel Eclipse templates to your workspace



mvn -Psetup.eclipse -Declipse.workspace.dir=/path/to/your/workspace



You can also find some helpful notes on usage here. 

Importing into Eclipse
If you have not already done so, you will need to make Eclipse aware of the Maven repository so that it can build everything. In the preferences, go to Java-Build Path-Classpath and define a new Classpath Variable named M2_REPO that points to your local Maven repository (i.e., ~/.m2/repository on Unix and c:\Documents and Settings\user\.m2\repository on Windows).

You can also get Maven to do this for you:


mvn eclipse:add-maven-repo -Declipse.workspace=/path/to/the/workspace/ 



Building with checkstyle

To enable source style checking with checkstyle, build Camel with the -Psourcecheck parameter



mvn -Psourcecheck clean install



Building source jars
If you want to build jar files with the source code, that for instance Eclipse can important so you can debug the Camel code as well. Then you can run this command from the camel root folder:


mvn clean source:jar install -Dtest=false



Building with Spring 2.5.6
From Camel 2.4.0, we switch the default Spring version to 3.0.x, If you want Camel to be build against Spring 2.5.6 you have to build with the maven profile spring-2.x.


mvn clean install -Pspring-2.x



You may want to skip testing and do a fast build


mvn clean install -Pspring-2.x -Dtest=false



Working with features
If you change anything in the features.xml from platform/karaf you can run a validation step to ensure the generated features.xml file is correct. You can do this running the following maven goal from the platform directory.


mvn clean install -Pvalidate



See Also


	Running Unit Tests
	Source
	Examples






Change Notification Preferences

View Online
|
View Changes
|
Add Comment









svn commit: r962467 - in /camel/trunk/tests: ./ camel-itest-spring-2.0/ camel-itest-spring-2.0/src/test/java/org/apache/camel/itest/spring2/ camel-itest-spring-2.5/ camel-itest-spring-2.5/src/ camel-i

2010-07-09 Thread davsclaus
Author: davsclaus
Date: Fri Jul  9 09:47:06 2010
New Revision: 962467

URL: http://svn.apache.org/viewvc?rev=962467view=rev
Log:
CAMEL-2928: Added itest for spring 2.5

Added:
camel/trunk/tests/camel-itest-spring-2.5/   (with props)
camel/trunk/tests/camel-itest-spring-2.5/pom.xml   (with props)
camel/trunk/tests/camel-itest-spring-2.5/src/
camel/trunk/tests/camel-itest-spring-2.5/src/main/
camel/trunk/tests/camel-itest-spring-2.5/src/main/resources/
camel/trunk/tests/camel-itest-spring-2.5/src/main/resources/META-INF/

camel/trunk/tests/camel-itest-spring-2.5/src/main/resources/META-INF/LICENSE.txt
   (with props)

camel/trunk/tests/camel-itest-spring-2.5/src/main/resources/META-INF/NOTICE.txt 
  (with props)
camel/trunk/tests/camel-itest-spring-2.5/src/test/
camel/trunk/tests/camel-itest-spring-2.5/src/test/java/
camel/trunk/tests/camel-itest-spring-2.5/src/test/java/org/
camel/trunk/tests/camel-itest-spring-2.5/src/test/java/org/apache/
camel/trunk/tests/camel-itest-spring-2.5/src/test/java/org/apache/camel/

camel/trunk/tests/camel-itest-spring-2.5/src/test/java/org/apache/camel/itest/

camel/trunk/tests/camel-itest-spring-2.5/src/test/java/org/apache/camel/itest/spring2/

camel/trunk/tests/camel-itest-spring-2.5/src/test/java/org/apache/camel/itest/spring2/JmsRouteTest.java
   (with props)
camel/trunk/tests/camel-itest-spring-2.5/src/test/resources/

camel/trunk/tests/camel-itest-spring-2.5/src/test/resources/log4j.properties   
(with props)
Modified:
camel/trunk/tests/camel-itest-spring-2.0/pom.xml

camel/trunk/tests/camel-itest-spring-2.0/src/test/java/org/apache/camel/itest/spring2/JmsRouteTest.java
camel/trunk/tests/pom.xml

Modified: camel/trunk/tests/camel-itest-spring-2.0/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-spring-2.0/pom.xml?rev=962467r1=962466r2=962467view=diff
==
--- camel/trunk/tests/camel-itest-spring-2.0/pom.xml (original)
+++ camel/trunk/tests/camel-itest-spring-2.0/pom.xml Fri Jul  9 09:47:06 2010
@@ -90,7 +90,7 @@
scopetest/scope
/dependency
 
-   !-- specific Spring version to test --
+!-- specific Spring version to test (just use big jar) --
dependency
groupIdorg.springframework/groupId
artifactIdspring/artifactId
@@ -102,6 +102,20 @@
groupIdorg.apache.activemq/groupId
artifactIdactivemq-core/artifactId
scopetest/scope
+exclusions
+exclusion
+groupIdorg.springframework/groupId
+artifactIdspring-core/artifactId
+/exclusion
+exclusion
+groupIdorg.springframework/groupId
+artifactIdspring-beans/artifactId
+/exclusion
+exclusion
+groupIdorg.springframework/groupId
+artifactIdspring-context/artifactId
+/exclusion
+/exclusions
/dependency
dependency
groupIdorg.apache.activemq/groupId

Modified: 
camel/trunk/tests/camel-itest-spring-2.0/src/test/java/org/apache/camel/itest/spring2/JmsRouteTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-spring-2.0/src/test/java/org/apache/camel/itest/spring2/JmsRouteTest.java?rev=962467r1=962466r2=962467view=diff
==
--- 
camel/trunk/tests/camel-itest-spring-2.0/src/test/java/org/apache/camel/itest/spring2/JmsRouteTest.java
 (original)
+++ 
camel/trunk/tests/camel-itest-spring-2.0/src/test/java/org/apache/camel/itest/spring2/JmsRouteTest.java
 Fri Jul  9 09:47:06 2010
@@ -23,13 +23,14 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import static 
org.apache.camel.component.jms.JmsComponent.jmsComponentClientAcknowledge;
 
+import static 
org.apache.camel.component.jms.JmsComponent.jmsComponentClientAcknowledge;
 
 /**
  * @version $Revision$
  */
 public class JmsRouteTest extends ContextTestSupport {
+
 public void testSendAndReceiveMessage() throws Exception {
 assertSendAndReceiveBody(Hello there!);
 }
@@ -58,6 +59,7 @@ public class JmsRouteTest extends Contex
 return new RouteBuilder() {
 public void configure() throws Exception {
 from(activemq:queue:test.a).to(activemq:queue:test.b);
+
 from(activemq:queue:test.b).to(mock:result);
 }
 };

Propchange: camel/trunk/tests/camel-itest-spring-2.5/

svn commit: r962488 - /camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/spi/SpringInjector.java

2010-07-09 Thread jstrachan
Author: jstrachan
Date: Fri Jul  9 11:50:24 2010
New Revision: 962488

URL: http://svn.apache.org/viewvc?rev=962488view=rev
Log:
expose the application context, so from a CamelContext you can find the 
ApplicationContext if you need it

Modified:

camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/spi/SpringInjector.java

Modified: 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/spi/SpringInjector.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/spi/SpringInjector.java?rev=962488r1=962487r2=962488view=diff
==
--- 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/spi/SpringInjector.java
 (original)
+++ 
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/spi/SpringInjector.java
 Fri Jul  9 11:50:24 2010
@@ -65,4 +65,9 @@ public class SpringInjector implements I
 public void setDependencyCheck(boolean dependencyCheck) {
 this.dependencyCheck = dependencyCheck;
 }
+
+
+public ConfigurableApplicationContext getApplicationContext() {
+return applicationContext;
+}
 }




svn commit: r962496 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/builder/ main/java/org/apache/camel/management/ main/java/org/apache/camel/management/event/ main/java/org/apache/camel

2010-07-09 Thread davsclaus
Author: davsclaus
Date: Fri Jul  9 12:06:55 2010
New Revision: 962496

URL: http://svn.apache.org/viewvc?rev=962496view=rev
Log:
CAMEL-2932: Added event for redelivery attempt. Renamed ExchangeFailureEvent to 
ExchangeFailedEvent which is a better name.

Added:

camel/trunk/camel-core/src/main/java/org/apache/camel/management/event/ExchangeFailedEvent.java
   (contents, props changed)
  - copied, changed from r962466, 
camel/trunk/camel-core/src/main/java/org/apache/camel/management/event/ExchangeFailureEvent.java

camel/trunk/camel-core/src/main/java/org/apache/camel/management/event/ExchangeRedeliveryEvent.java
  - copied, changed from r962466, 
camel/trunk/camel-core/src/main/java/org/apache/camel/management/event/ExchangeSentEvent.java

camel/trunk/camel-core/src/test/java/org/apache/camel/management/EventNotifierRedeliveryEventsTest.java
  - copied, changed from r962466, 
camel/trunk/camel-core/src/test/java/org/apache/camel/management/EventNotifierFailureHandledEventsTest.java
Removed:

camel/trunk/camel-core/src/main/java/org/apache/camel/management/event/ExchangeFailureEvent.java
Modified:

camel/trunk/camel-core/src/main/java/org/apache/camel/builder/NotifyBuilder.java

camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultEventFactory.java

camel/trunk/camel-core/src/main/java/org/apache/camel/management/EventNotifierSupport.java

camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedEventNotifier.java

camel/trunk/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedEventNotifierMBean.java

camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
camel/trunk/camel-core/src/main/java/org/apache/camel/spi/EventFactory.java
camel/trunk/camel-core/src/main/java/org/apache/camel/spi/EventNotifier.java
camel/trunk/camel-core/src/main/java/org/apache/camel/util/EventHelper.java

camel/trunk/camel-core/src/test/java/org/apache/camel/management/EventNotifierEventsTest.java

camel/trunk/camel-core/src/test/java/org/apache/camel/management/EventNotifierExchangeSentTest.java

camel/trunk/camel-core/src/test/java/org/apache/camel/management/MultipleEventNotifierEventsTest.java

camel/trunk/camel-core/src/test/java/org/apache/camel/processor/interceptor/DebugExceptionEventBreakpointTest.java

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/builder/NotifyBuilder.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/NotifyBuilder.java?rev=962496r1=962495r2=962496view=diff
==
--- 
camel/trunk/camel-core/src/main/java/org/apache/camel/builder/NotifyBuilder.java
 (original)
+++ 
camel/trunk/camel-core/src/main/java/org/apache/camel/builder/NotifyBuilder.java
 Fri Jul  9 12:06:55 2010
@@ -35,7 +35,7 @@ import org.apache.camel.component.mock.M
 import org.apache.camel.management.EventNotifierSupport;
 import org.apache.camel.management.event.ExchangeCompletedEvent;
 import org.apache.camel.management.event.ExchangeCreatedEvent;
-import org.apache.camel.management.event.ExchangeFailureEvent;
+import org.apache.camel.management.event.ExchangeFailedEvent;
 import org.apache.camel.spi.EventNotifier;
 import org.apache.camel.util.EndpointHelper;
 import org.apache.camel.util.ObjectHelper;
@@ -288,7 +288,7 @@ public class NotifyBuilder {
 }
 
 @Override
-public boolean onExchangeFailure(Exchange exchange) {
+public boolean onExchangeFailed(Exchange exchange) {
 current++;
 return true;
 }
@@ -363,7 +363,7 @@ public class NotifyBuilder {
 private int current;
 
 @Override
-public boolean onExchangeFailure(Exchange exchange) {
+public boolean onExchangeFailed(Exchange exchange) {
 current++;
 return true;
 }
@@ -404,7 +404,7 @@ public class NotifyBuilder {
 }
 
 @Override
-public boolean onExchangeFailure(Exchange exchange) {
+public boolean onExchangeFailed(Exchange exchange) {
 current++;
 return true;
 }
@@ -473,7 +473,7 @@ public class NotifyBuilder {
 private int current;
 
 @Override
-public boolean onExchangeFailure(Exchange exchange) {
+public boolean onExchangeFailed(Exchange exchange) {
 current++;
 return true;
 }
@@ -528,7 +528,7 @@ public class NotifyBuilder {
 }
 
 @Override
-public boolean onExchangeFailure(Exchange exchange) {
+public boolean onExchangeFailed(Exchange exchange) {
 if (!received  !matches) {
 matches = predicate.matches(exchange);
 

[CONF] Apache Camel Camel 2.4.0 Release

2010-07-09 Thread confluence







Camel 2.4.0 Release
Page edited by Claus Ibsen


 Changes (2)
 



...
Welcome to the 2.4.0 release which approx XXX issues resolved (new features, improvements and bug fixes such as...)  
* Spring 3.0.3 is now the default Spring version used by Camel. 
* Fully non blocking [Asynchronous Routing Engine] which all [EIP]s and some Camel [Components] supported. * New feature to use scheduled [delayed redelivery attempts|Exception Clause] (they are fully asynchronous and non blocking). You need to enable this using the option {{asyncDelayedRedelivery}}. 
...
h2. Important changes to consider when upgrading  
Camel now uses Spring 3.0.3 as the default Spring version. Spring 2.5 is still supported. Spring 2.0.x support is now *...@deprecated* and will in future releases *not* be supported.  
{{IntrospectionSupport}} has been improved to be consistent for {{getProperty}} and {{getProperties}}. Also {{getProperties}} now find all relevant properties. This will often only be relevant for Camel end users who build their own components any may use {{IntrospectionSupport}}.  
...

Full Content

Camel 2.4.0 release (currently in progress)




New and Noteworthy

Welcome to the 2.4.0 release which approx XXX issues resolved (new features, improvements and bug fixes such as...)


	Spring 3.0.3 is now the default Spring version used by Camel.
	Fully non blocking Asynchronous Routing Engine which all EIPs and some Camel Components supported.
	New feature to use scheduled delayed redelivery attempts (they are fully asynchronous and non blocking). You need to enable this using the option asyncDelayedRedelivery.
	Fixed a potential dead-lock when using Aggregator with timeout completion set.
	The camel-spring module now supports OSGi out of box, which renders camel-osgi as @deprecated.
	OSGi blueprint is now supported
	Added new contextScan to scan the Registry for RouteBuilder instances, just as scanning the classpath etc.
	Manually started routes is now also Graceful Shutdown by Camel
	Fixed issue using RouteContextRef with multiple CamelContext from the same Spring ApplicationContext.
	Bindy now supports Fixed-Length format message with padding, alignment (Left or Right)
	Improved and fixes some issues with the FTP component.
	Improved and fixed some issues using MultiPartForm with Jetty.
	Add ability to configure Bindy to remove whitespace when binding Numeric positions
	Added option useOriginalBody to OnCompletion
	Fixed issue when using mockito for testing when it uses CGLib proxies
	Fixed issue with @Consume not running in an unit of work to ensure callbacks is invoked when its done
	Routing Slip now uses _expression_ to define the slip. This is similar to the Recipient List pattern
	The security context can be passed from CXF to other camel Components.
	ManagementAgent settings can now be set using setters from Java, instead of having to use JVM system properties. See tip in Camel JMX wiki page.
	Resequencer in batch mode has two new options allowDuplicates and reverse which allows you to use it for re-ordering messages from JMS queues based on JMSPriority
	Tighten up the ProducerTemplate API a bit, see more details in the section Important changes to consider when upgrading.
	HTTP now better supports sending binary files.
	Fixed problem with using Quartz in OSGi and having Camel applications being hot-deployed which potentially could cause Quartz to stop scheduling in applications which haven't been stopped.
	Fixed issue with pausing and resuming jobs when running Quartz in clustered mode
	Added options on Quartz component to specify location of custom quartz.properties file to load from classpath.
	Upgraded to latest Quartz release 1.8.3.
	Introduced StartupListener to allow components/endpoints/producers/consumers etc. as a listener to be notified when CamelContext have just been started. This allows any custom logic to be executed as a late starter. This ensures Quartz scheduler is only started when all the routes and so forth is started and running.
	Fixed issue with FTP configuring starting directory from uri not accepting an absolute path. In the endpoint uri just define two leading / to indicate absolute, eg "ftp:admin:sec...@someserver//absolutepath/foo/bar".
	Added fromRoute to NotifyBuilder.
	Improved the CSV component.
	Fixed issue with Direct endpoint having no consumers if endpoint have been evicted from CamelContext internal LRUCache.
	The RouteBuilder now have simple and xpath _expression_ builder methods out of the box.
	Upgraded to latest release of Scala 2.8.0RC7 in Scala DSL
	camel-hawtdb updated to HawtDB 1.1 picks up several bug fixes that improves stability and performance.
	Fixed issue with splitting files using 

[CONF] Apache Camel Camel 2.4.0 Release

2010-07-09 Thread confluence







Camel 2.4.0 Release
Page edited by Claus Ibsen


 Changes (2)
 



...
* Added a [Debugger|Camel 2.x - Debugger API] API to be leveraged by 3rd party tooling. * The {{beanRef}} and {{methodCall}} DSLs will eager check on startup, the bean reference exists in [Registry] and the provided method name is a valid method name on the bean as well. This helps to fail fast if end users have a typo in their routes. 
* [JMX|Camel JMX] now exposes notifications which listeners can receive. * Added {{ExchangeRedeliveryEvent}} event being emitted when Camel [Error Handler] attempts a redelivery. 
 h3. New [Enterprise Integration Patterns] 
...
{{org.apache.camel.spi.Policy}} now has an additional method {{beforeWrap}} which means you need to implement this method in your implementations. Just add a empty method to adapt.  
The class {{org.apache.camel.management.event.ExchangeFailureEvent}} has been renamed to {{org.apache.camel.management.event.ExchangeFailedEvent}}.  
h2. Known Issues  
...

Full Content

Camel 2.4.0 release (currently in progress)




New and Noteworthy

Welcome to the 2.4.0 release which approx XXX issues resolved (new features, improvements and bug fixes such as...)


	Fully non blocking Asynchronous Routing Engine which all EIPs and some Camel Components supported.
	New feature to use scheduled delayed redelivery attempts (they are fully asynchronous and non blocking). You need to enable this using the option asyncDelayedRedelivery.
	Fixed a potential dead-lock when using Aggregator with timeout completion set.
	The camel-spring module now supports OSGi out of box, which renders camel-osgi as @deprecated.
	OSGi blueprint is now supported
	Added new contextScan to scan the Registry for RouteBuilder instances, just as scanning the classpath etc.
	Manually started routes is now also Graceful Shutdown by Camel
	Fixed issue using RouteContextRef with multiple CamelContext from the same Spring ApplicationContext.
	Bindy now supports Fixed-Length format message with padding, alignment (Left or Right)
	Improved and fixes some issues with the FTP component.
	Improved and fixed some issues using MultiPartForm with Jetty.
	Add ability to configure Bindy to remove whitespace when binding Numeric positions
	Added option useOriginalBody to OnCompletion
	Fixed issue when using mockito for testing when it uses CGLib proxies
	Fixed issue with @Consume not running in an unit of work to ensure callbacks is invoked when its done
	Routing Slip now uses _expression_ to define the slip. This is similar to the Recipient List pattern
	The security context can be passed from CXF to other camel Components.
	ManagementAgent settings can now be set using setters from Java, instead of having to use JVM system properties. See tip in Camel JMX wiki page.
	Resequencer in batch mode has two new options allowDuplicates and reverse which allows you to use it for re-ordering messages from JMS queues based on JMSPriority
	Tighten up the ProducerTemplate API a bit, see more details in the section Important changes to consider when upgrading.
	HTTP now better supports sending binary files.
	Fixed problem with using Quartz in OSGi and having Camel applications being hot-deployed which potentially could cause Quartz to stop scheduling in applications which haven't been stopped.
	Fixed issue with pausing and resuming jobs when running Quartz in clustered mode
	Added options on Quartz component to specify location of custom quartz.properties file to load from classpath.
	Upgraded to latest Quartz release 1.8.3.
	Introduced StartupListener to allow components/endpoints/producers/consumers etc. as a listener to be notified when CamelContext have just been started. This allows any custom logic to be executed as a late starter. This ensures Quartz scheduler is only started when all the routes and so forth is started and running.
	Fixed issue with FTP configuring starting directory from uri not accepting an absolute path. In the endpoint uri just define two leading / to indicate absolute, eg "ftp:admin:sec...@someserver//absolutepath/foo/bar".
	Added fromRoute to NotifyBuilder.
	Improved the CSV component.
	Fixed issue with Direct endpoint having no consumers if endpoint have been evicted from CamelContext internal LRUCache.
	The RouteBuilder now have simple and xpath _expression_ builder methods out of the box.
	Upgraded to latest release of Scala 2.8.0RC7 in Scala DSL
	camel-hawtdb updated to HawtDB 1.1 picks up several bug fixes that improves stability and performance.
	Fixed issue with splitting files using tokenizer not being able to delete/move file after processing is done on Windows platform.
	maxMessagesPerPoll is now applied eagerly to limit intaking files 

svn commit: r962504 - in /camel/trunk/components/camel-xstream/src: main/java/org/apache/camel/dataformat/xstream/AbstractXStreamWrapper.java test/java/org/apache/camel/dataformat/xstream/XStreamConfi

2010-07-09 Thread davsclaus
Author: davsclaus
Date: Fri Jul  9 12:29:48 2010
New Revision: 962504

URL: http://svn.apache.org/viewvc?rev=962504view=rev
Log:
CAMEL-2915: Applied patch with thanks to Mark Proctor.

Modified:

camel/trunk/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/AbstractXStreamWrapper.java

camel/trunk/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/XStreamConfigurationTest.java

Modified: 
camel/trunk/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/AbstractXStreamWrapper.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/AbstractXStreamWrapper.java?rev=962504r1=962503r2=962504view=diff
==
--- 
camel/trunk/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/AbstractXStreamWrapper.java
 (original)
+++ 
camel/trunk/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/AbstractXStreamWrapper.java
 Fri Jul  9 12:29:48 2010
@@ -18,6 +18,8 @@ package org.apache.camel.dataformat.xstr
 
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -33,6 +35,7 @@ import org.apache.camel.Exchange;
 import org.apache.camel.converter.jaxp.StaxConverter;
 import org.apache.camel.spi.ClassResolver;
 import org.apache.camel.spi.DataFormat;
+import org.apache.camel.util.ObjectHelper;
 
 /**
  * An abstract class which implement a 
href=http://camel.apache.org/data-format.html;data format/a
@@ -40,7 +43,6 @@ import org.apache.camel.spi.DataFormat;
  *
  * @version $Revision$
  */
-
 public abstract class AbstractXStreamWrapper implements DataFormat {
 
 private XStream xstream;
@@ -86,16 +88,39 @@ public abstract class AbstractXStreamWra
 }
 
 if (this.converters != null) {
-for (String converter : this.converters) {
-
xstream.registerConverter(resolver.resolveMandatoryClass(converter, 
Converter.class).newInstance());
+for (String name : this.converters) {
+ClassConverter converterClass = 
resolver.resolveMandatoryClass(name, Converter.class);
+Converter converter;
+
+Constructor con = null;
+try {
+con = converterClass.getDeclaredConstructor(new 
Class[] {XStream.class});
+} catch (Exception e) {
+ //swallow as we null check in a moment.
+}
+if (con != null) {
+converter = (Converter) con.newInstance(xstream);
+} else {
+converter = converterClass.newInstance();
+try { 
+Method method = 
converterClass.getMethod(setXStream, new Class[] {XStream.class});
+if (method != null) {
+ObjectHelper.invokeMethod(method, converter, 
xstream);
+}
+} catch (Throwable e) {
+// swallow, as it just means the user never add an 
XStream setter, which is optional
+}
+}
+
+xstream.registerConverter(converter);
 }
 }
 } catch (Exception e) {
-throw new RuntimeException(Unable to build Xstream instance, e);
+throw new RuntimeException(Unable to build XStream instance, e);
 }
 
 return xstream;
-}
+}
 
 public StaxConverter getStaxConverter() {
 if (staxConverter == null) {

Modified: 
camel/trunk/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/XStreamConfigurationTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/XStreamConfigurationTest.java?rev=962504r1=962503r2=962504view=diff
==
--- 
camel/trunk/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/XStreamConfigurationTest.java
 (original)
+++ 
camel/trunk/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/XStreamConfigurationTest.java
 Fri Jul  9 12:29:48 2010
@@ -21,6 +21,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import com.thoughtworks.xstream.XStream;
 import com.thoughtworks.xstream.converters.Converter;
 import com.thoughtworks.xstream.converters.MarshallingContext;
 import com.thoughtworks.xstream.converters.UnmarshallingContext;
@@ -38,6 +39,21 @@ import org.junit.Test;
  */
 public class XStreamConfigurationTest 

svn commit: r962513 - /camel/trunk/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosEventNotifier.java

2010-07-09 Thread davsclaus
Author: davsclaus
Date: Fri Jul  9 13:08:16 2010
New Revision: 962513

URL: http://svn.apache.org/viewvc?rev=962513view=rev
Log:
Fixed compiler error due rename of a class

Modified:

camel/trunk/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosEventNotifier.java

Modified: 
camel/trunk/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosEventNotifier.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosEventNotifier.java?rev=962513r1=962512r2=962513view=diff
==
--- 
camel/trunk/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosEventNotifier.java
 (original)
+++ 
camel/trunk/components/camel-nagios/src/main/java/org/apache/camel/component/nagios/NagiosEventNotifier.java
 Fri Jul  9 13:08:16 2010
@@ -25,8 +25,9 @@ import com.googlecode.jsendnsca.core.Nag
 import org.apache.camel.management.EventNotifierSupport;
 import org.apache.camel.management.event.CamelContextStartupFailureEvent;
 import org.apache.camel.management.event.CamelContextStopFailureEvent;
-import org.apache.camel.management.event.ExchangeFailureEvent;
+import org.apache.camel.management.event.ExchangeFailedEvent;
 import org.apache.camel.management.event.ExchangeFailureHandledEvent;
+import org.apache.camel.management.event.ExchangeRedeliveryEvent;
 import org.apache.camel.management.event.ServiceStartupFailureEvent;
 import org.apache.camel.management.event.ServiceStopFailureEvent;
 
@@ -46,7 +47,7 @@ public class NagiosEventNotifier extends
 public void notify(EventObject eventObject) throws Exception {
 // create message payload to send
 String message = eventObject.toString();
-Level level = detemineLevel(eventObject);
+Level level = determineLevel(eventObject);
 MessagePayload payload = new MessagePayload(getHostName(), 
level.ordinal(), getServiceName(), message);
 
 if (log.isInfoEnabled()) {
@@ -62,9 +63,9 @@ public class NagiosEventNotifier extends
 return true;
 }
 
-protected Level detemineLevel(EventObject eventObject) {
+protected Level determineLevel(EventObject eventObject) {
 // failures is considered critical
-if (eventObject instanceof ExchangeFailureEvent
+if (eventObject instanceof ExchangeFailedEvent
 || eventObject instanceof CamelContextStartupFailureEvent
 || eventObject instanceof CamelContextStopFailureEvent
 || eventObject instanceof ServiceStartupFailureEvent
@@ -73,7 +74,9 @@ public class NagiosEventNotifier extends
 }
 
 // the failure was handled so its just a warning
-if (eventObject instanceof ExchangeFailureHandledEvent) {
+// and warn when a redelivery attempt is done
+if (eventObject instanceof ExchangeFailureHandledEvent
+|| eventObject instanceof ExchangeRedeliveryEvent) {
 return Level.WARNING;
 }
 




svn commit: r962547 - /camel/trunk/parent/pom.xml

2010-07-09 Thread davsclaus
Author: davsclaus
Date: Fri Jul  9 14:42:04 2010
New Revision: 962547

URL: http://svn.apache.org/viewvc?rev=962547view=rev
Log:
Upgraded to jruby 1.5.1

Modified:
camel/trunk/parent/pom.xml

Modified: camel/trunk/parent/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=962547r1=962546r2=962547view=diff
==
--- camel/trunk/parent/pom.xml (original)
+++ camel/trunk/parent/pom.xml Fri Jul  9 14:42:04 2010
@@ -85,7 +85,7 @@
 jaxen-version1.1.1/jaxen-version
 jetty-version7.1.4.v20100610/jetty-version
 jettison-version1.2/jettison-version
-jruby-version1.4.0/jruby-version
+jruby-version1.5.1/jruby-version
 juel-version2.1.2/juel-version
 junit-version4.8.1/junit-version
 log4j-version1.2.16/log4j-version




svn commit: r962550 - in /camel/trunk: components/camel-protobuf/ components/camel-protobuf/src/test/java/org/apache/camel/dataformat/protobuf/ components/camel-protobuf/src/test/java/org/apache/camel

2010-07-09 Thread davsclaus
Author: davsclaus
Date: Fri Jul  9 14:59:55 2010
New Revision: 962550

URL: http://svn.apache.org/viewvc?rev=962550view=rev
Log:
CAMEL-2931: Upgraded to google protobuf 2.3.0. Had to install the protoc 
compiler beforehand to generate the new generated addressbook java file.

Modified:
camel/trunk/components/camel-protobuf/pom.xml

camel/trunk/components/camel-protobuf/src/test/java/org/apache/camel/dataformat/protobuf/ProtobufMarshalTest.java

camel/trunk/components/camel-protobuf/src/test/java/org/apache/camel/dataformat/protobuf/generated/AddressBookProtos.java
camel/trunk/parent/pom.xml

Modified: camel/trunk/components/camel-protobuf/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-protobuf/pom.xml?rev=962550r1=962549r2=962550view=diff
==
--- camel/trunk/components/camel-protobuf/pom.xml (original)
+++ camel/trunk/components/camel-protobuf/pom.xml Fri Jul  9 14:59:55 2010
@@ -17,14 +17,14 @@
/properties
 
dependencies  
-  dependency
-   groupIdorg.apache.camel/groupId
+dependency
+   groupIdorg.apache.camel/groupId
artifactIdcamel-core/artifactId
/dependency
dependency
groupIdcom.google.protobuf/groupId
artifactIdprotobuf-java/artifactId
-   version2.2.0/version
+   version${protobuf-version}/version
/dependency
 
!-- testing --

Modified: 
camel/trunk/components/camel-protobuf/src/test/java/org/apache/camel/dataformat/protobuf/ProtobufMarshalTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-protobuf/src/test/java/org/apache/camel/dataformat/protobuf/ProtobufMarshalTest.java?rev=962550r1=962549r2=962550view=diff
==
--- 
camel/trunk/components/camel-protobuf/src/test/java/org/apache/camel/dataformat/protobuf/ProtobufMarshalTest.java
 (original)
+++ 
camel/trunk/components/camel-protobuf/src/test/java/org/apache/camel/dataformat/protobuf/ProtobufMarshalTest.java
 Fri Jul  9 14:59:55 2010
@@ -14,13 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.camel.dataformat.protobuf;
 
 import org.apache.camel.CamelException;
 import org.apache.camel.FailedToCreateRouteException;
-import org.apache.camel.InvalidPayloadException;
-import org.apache.camel.RoutesBuilder;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.dataformat.protobuf.generated.AddressBookProtos;
@@ -30,9 +27,6 @@ import org.junit.Test;
 
 public class ProtobufMarshalTest extends CamelTestSupport {
 
-/**
- * @throws Exception
- */
 @Test
 public void testMarshalAndUnmarshalWithDataFormat() throws Exception {
 marshalAndUnmarshal(direct:in, direct:back);
@@ -49,15 +43,13 @@ public class ProtobufMarshalTest extends
 }
 
 @Test
-public void testMarshalAndUnmashalWithDSL3() throws Exception {
+public void testMarshalAndUnmarshalWithDSL3() throws Exception {
 try {
 context.addRoutes(new RouteBuilder() {
-
 @Override
 public void configure() throws Exception {
 from(direct:unmarshalC).unmarshal().protobuf(new 
CamelException(wrong instance))
 .to(mock:reverse);
-
 }
 });
 fail(Expect the exception here);
@@ -90,10 +82,8 @@ public class ProtobufMarshalTest extends
 @Override
 protected RouteBuilder createRouteBuilder() throws Exception {
 return new RouteBuilder() {
-
 @Override
 public void configure() throws Exception {
-
 ProtobufDataFormat format = new 
ProtobufDataFormat(Person.getDefaultInstance());
 
 from(direct:in).marshal(format);
@@ -103,8 +93,6 @@ public class ProtobufMarshalTest extends
 
from(direct:unmarshalA).unmarshal().protobuf(org.apache.camel.dataformat.protobuf.generated.AddressBookProtos$Person).to(mock:reverse);
 
 
from(direct:unmarshalB).unmarshal().protobuf(Person.getDefaultInstance()).to(mock:reverse);
-
-
 }
 };
 }

Modified: 
camel/trunk/components/camel-protobuf/src/test/java/org/apache/camel/dataformat/protobuf/generated/AddressBookProtos.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-protobuf/src/test/java/org/apache/camel/dataformat/protobuf/generated/AddressBookProtos.java?rev=962550r1=962549r2=962550view=diff
==
--- 

svn commit: r962552 - /camel/trunk/parent/pom.xml

2010-07-09 Thread davsclaus
Author: davsclaus
Date: Fri Jul  9 15:06:41 2010
New Revision: 962552

URL: http://svn.apache.org/viewvc?rev=962552view=rev
Log:
Upgraded to lucene 3.0.2

Modified:
camel/trunk/parent/pom.xml

Modified: camel/trunk/parent/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=962552r1=962551r2=962552view=diff
==
--- camel/trunk/parent/pom.xml (original)
+++ camel/trunk/parent/pom.xml Fri Jul  9 15:06:41 2010
@@ -89,7 +89,7 @@
 juel-version2.1.2/juel-version
 junit-version4.8.1/junit-version
 log4j-version1.2.16/log4j-version
-lucene-version3.0.1/lucene-version
+lucene-version3.0.2/lucene-version
 mina-version1.1.7/mina-version
 mockito-version1.8.2/mockito-version
 mvel-version2.0.17/mvel-version




[CONF] Apache Camel Using PropertyPlaceholder

2010-07-09 Thread confluence







Using PropertyPlaceholder
Page edited by Claus Ibsen


 Changes (3)
 



...
 h3. PropertyResolver 
As usually Camel provides a pluggable mechanism which allows 3rd part to provide their own resolver to lookup properties. Camel provides a default implementation {{org.apache.camel.component.properties.DefaultPropertiesResolver}} which is capable of loading properties from the file system or classpath. You can prefix the locations with either {{file:}} or {{classpath:}} where {{classpath:}} is the default if no prefix is provided. 
As usually Camel provides a pluggable mechanism which allows 3rd part to provide their own resolver to lookup properties. Camel provides a default implementation {{org.apache.camel.component.properties.DefaultPropertiesResolver}} which is capable of loading properties from the file system, classpath or [Registry]. You can prefix the locations with either: - {{ref:}} *Camel 2.4:* to lookup in the [Registry] - {{file:}} to load the from file system - {{classpath:}} to load from classpath (this is also the default if no prefix is provided) 
 h3. Defining location 
...
{code}  
h3. Using a Properties from the [Registry] *Available as of Camel 2.4* For example in OSGi you may want to expose a service which returns the properties as a {{java.util.Properties}} object.  Then you could setup the [Properties] component as follows: {code:xml}propertyPlaceholder id=properties location=ref:myProperties/ {code} Where {{myProperties}} is the id to use for lookup in the OSGi registry. Notice we use the {{ref:}} prefix to tell Camel that it should lookup the properties for the [Registry].   
h3. Examples using properties component When using property placeholders in the endpoint URIs you can either use the {{properties:}} component or define the placeholders directly in the URI. We will show example of both cases, starting with the former. 
...

Full Content

Using PropertyPlaceholder
Available as of Camel 2.3

Camel now provides a new PropertiesComponent in camel-core which allows you to use property placeholders when defining Camel Endpoint URIs. 
This works much like you would do if using Spring's property-placeholder tag. However Spring have a limitation which prevents 3rd party frameworks to leverage Spring property placeholders to the fullest. See more at How do I use Spring Property Placeholder with Camel XML.

The property placeholder is generally in use when doing:

	lookup or creating endpoints
	lookup of beans in the Registry
	additional supported in Spring XML (see below in examples)



Syntax
The syntax to use Camel's property placeholder is to use {{key}} for example {{file.uri}} where file.uri is the property key.
You can use property placeholders in parts of the endpoint URI's which for example you can use placeholders for parameters in the URIs.

PropertyResolver
As usually Camel provides a pluggable mechanism which allows 3rd part to provide their own resolver to lookup properties. Camel provides a default implementation org.apache.camel.component.properties.DefaultPropertiesResolver which is capable of loading properties from the file system, classpath or Registry. You can prefix the locations with either:

	ref: Camel 2.4: to lookup in the Registry
	file: to load the from file system
	classpath: to load from classpath (this is also the default if no prefix is provided)



Defining location
The PropertiesResolver need to know a location(s) where to resolve the properties. You can define 1 to many locations. If you define the location in a single String property you can separate multiple locations with comma such as:


pc.setLocation("com/mycompany/myprop.properties,com/mycompany/other.properties");



Configuring in Java DSL
You have to create and register the PropertiesComponent under the name properties such as:


PropertiesComponent pc = new PropertiesComponent();
pc.setLocation("classpath:com/mycompany/myprop.properties");
context.addComponent("properties", pc);



Configuring in Spring XML
Spring XML offers two variations to configure. You can define a spring bean as a PropertiesComponent which resembles the way done in Java DSL. Or you can use the propertyPlaceholder tag.


bean id="properties" class="org.apache.camel.component.properties.PropertiesComponent"
property name="location" value="classpath:com/mycompany/myprop.properties"/
/bean



Using the propertyPlaceholder tag makes the configuration a bit more fresh such as:


camelContext ...
   propertyPlaceholder id="properties" location="com/mycompany/myprop.properties"/
/camelContext



Using a Properties from the Registry
Available as of Camel 2.4
For example in OSGi you may want to expose a service which returns the 

svn commit: r962660 - /camel/trunk/components/camel-atom/src/test/java/org/apache/camel/component/atom/AtomGoodBlogsTest.java

2010-07-09 Thread davsclaus
Author: davsclaus
Date: Fri Jul  9 19:27:16 2010
New Revision: 962660

URL: http://svn.apache.org/viewvc?rev=962660view=rev
Log:
Fixed test

Modified:

camel/trunk/components/camel-atom/src/test/java/org/apache/camel/component/atom/AtomGoodBlogsTest.java

Modified: 
camel/trunk/components/camel-atom/src/test/java/org/apache/camel/component/atom/AtomGoodBlogsTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-atom/src/test/java/org/apache/camel/component/atom/AtomGoodBlogsTest.java?rev=962660r1=962659r2=962660view=diff
==
--- 
camel/trunk/components/camel-atom/src/test/java/org/apache/camel/component/atom/AtomGoodBlogsTest.java
 (original)
+++ 
camel/trunk/components/camel-atom/src/test/java/org/apache/camel/component/atom/AtomGoodBlogsTest.java
 Fri Jul  9 19:27:16 2010
@@ -94,7 +94,7 @@ public class AtomGoodBlogsTest extends C
 MockEndpoint mock = context.getEndpoint(mock:result, 
MockEndpoint.class);
 
 // There should be two good blog entries from the feed
-mock.expectedMessageCount(2);
+mock.expectedMinimumMessageCount(2);
 
 // Asserts that the above expectations is true, will throw assertions 
exception if it failed
 // Camel will default wait max 20 seconds for the assertions to be 
true, if the conditions
@@ -112,7 +112,7 @@ public class AtomGoodBlogsTest extends C
  */
 public boolean isGoodBlog(Exchange exchange) {
 Entry entry = exchange.getIn().getBody(Entry.class);
-String title = entry.getTitle();
+String title = entry.getTitle();
 
 // We like blogs about Camel
 boolean good = title.toLowerCase().contains(camel);




svn commit: r962668 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/model/dataformat/ components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/ components/camel-xstream/

2010-07-09 Thread hadrian
Author: hadrian
Date: Fri Jul  9 19:38:52 2010
New Revision: 962668

URL: http://svn.apache.org/viewvc?rev=962668view=rev
Log:
CAMEL-2915. Fix misspelled api and set NO_REFERENCES for json

Modified:

camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/XStreamDataFormat.java

camel/trunk/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/JsonDataFormat.java

camel/trunk/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/XStreamConfigurationTest.java

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/XStreamDataFormat.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/XStreamDataFormat.java?rev=962668r1=962667r2=962668view=diff
==
--- 
camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/XStreamDataFormat.java
 (original)
+++ 
camel/trunk/camel-core/src/main/java/org/apache/camel/model/dataformat/XStreamDataFormat.java
 Fri Jul  9 19:38:52 2010
@@ -107,7 +107,7 @@ public class XStreamDataFormat extends D
 return implicitCollections;
 }
 
-public void setImplicitCollection(MapString, String[] 
implicitCollections) {
+public void setImplicitCollections(MapString, String[] 
implicitCollections) {
 this.implicitCollections = implicitCollections;
 }
 

Modified: 
camel/trunk/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/JsonDataFormat.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/JsonDataFormat.java?rev=962668r1=962667r2=962668view=diff
==
--- 
camel/trunk/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/JsonDataFormat.java
 (original)
+++ 
camel/trunk/components/camel-xstream/src/main/java/org/apache/camel/dataformat/xstream/JsonDataFormat.java
 Fri Jul  9 19:38:52 2010
@@ -23,6 +23,7 @@ import java.util.Map;
 
 import javax.xml.stream.XMLStreamException;
 
+import com.thoughtworks.xstream.XStream;
 import com.thoughtworks.xstream.io.HierarchicalStreamReader;
 import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
 import com.thoughtworks.xstream.io.xml.QNameMap;
@@ -30,6 +31,7 @@ import com.thoughtworks.xstream.io.xml.S
 import com.thoughtworks.xstream.io.xml.StaxWriter;
 
 import org.apache.camel.Exchange;
+import org.apache.camel.spi.ClassResolver;
 import org.codehaus.jettison.mapped.MappedXMLInputFactory;
 import org.codehaus.jettison.mapped.MappedXMLOutputFactory;
 
@@ -50,6 +52,13 @@ public class JsonDataFormat extends Abst
 mif = new MappedXMLInputFactory(nstjsons);
 }
 
+@Override
+protected XStream createXStream(ClassResolver resolver) {
+XStream xs = super.createXStream(resolver);
+xs.setMode(XStream.NO_REFERENCES);
+return xs;
+}
+
 protected HierarchicalStreamWriter createHierarchicalStreamWriter(Exchange 
exchange, Object body, OutputStream stream) throws XMLStreamException {
 return new StaxWriter(new QNameMap(), 
mof.createXMLStreamWriter(stream));
 }
@@ -57,5 +66,4 @@ public class JsonDataFormat extends Abst
 protected HierarchicalStreamReader createHierarchicalStreamReader(Exchange 
exchange, InputStream stream) throws XMLStreamException {
 return new StaxReader(new QNameMap(), 
mif.createXMLStreamReader(stream));
 }
-
 }

Modified: 
camel/trunk/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/XStreamConfigurationTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/XStreamConfigurationTest.java?rev=962668r1=962667r2=962668view=diff
==
--- 
camel/trunk/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/XStreamConfigurationTest.java
 (original)
+++ 
camel/trunk/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/XStreamConfigurationTest.java
 Fri Jul  9 19:38:52 2010
@@ -138,7 +138,7 @@ public class XStreamConfigurationTest ex
 
 MapString, String[] implicits = new HashMapString, 
String[]();
 implicits.put(PurchaseHistory.class.getName(), new String[] 
{history});
-xstreamDefinition.setImplicitCollection(implicits);
+xstreamDefinition.setImplicitCollections(implicits);
 
 
from(direct:marshal).marshal(xstreamDefinition).to(mock:result);
 
from(direct:unmarshal).unmarshal(xstreamDefinition).to(mock:result);




svn commit: r962676 - in /camel/trunk/components: camel-bindy/pom.xml camel-hl7/pom.xml

2010-07-09 Thread hadrian
Author: hadrian
Date: Fri Jul  9 20:00:54 2010
New Revision: 962676

URL: http://svn.apache.org/viewvc?rev=962676view=rev
Log:
More cleanup for forkMode=once

Modified:
camel/trunk/components/camel-bindy/pom.xml
camel/trunk/components/camel-hl7/pom.xml

Modified: camel/trunk/components/camel-bindy/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/pom.xml?rev=962676r1=962675r2=962676view=diff
==
--- camel/trunk/components/camel-bindy/pom.xml (original)
+++ camel/trunk/components/camel-bindy/pom.xml Fri Jul  9 20:00:54 2010
@@ -98,7 +98,7 @@
 configuration
 childDelegationfalse/childDelegation
 useFiletrue/useFile
-forkModepertest/forkMode
+forkModeonce/forkMode
 excludes
 exclude**/CommonBindyTest.*/exclude
 !-- exclude**/*Csv*Test.*/exclude

Modified: camel/trunk/components/camel-hl7/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-hl7/pom.xml?rev=962676r1=962675r2=962676view=diff
==
--- camel/trunk/components/camel-hl7/pom.xml (original)
+++ camel/trunk/components/camel-hl7/pom.xml Fri Jul  9 20:00:54 2010
@@ -134,7 +134,7 @@
 configuration
 childDelegationfalse/childDelegation
 useFiletrue/useFile
-forkModepertest/forkMode
+forkModeonce/forkMode
 includes
 include**/*Test.*/include
 /includes