svn commit: r959878 - /camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPackageScanClassResolver.java
Author: ningjiang Date: Fri Jul 2 06:57:16 2010 New Revision: 959878 URL: http://svn.apache.org/viewvc?rev=959878&view=rev Log: CAMEL-2894 DefaultPackageScanClassResolver.addClassLoader should check the UnsupportedOperationException Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPackageScanClassResolver.java Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPackageScanClassResolver.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPackageScanClassResolver.java?rev=959878&r1=959877&r2=959878&view=diff == --- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPackageScanClassResolver.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultPackageScanClassResolver.java Fri Jul 2 06:57:16 2010 @@ -55,7 +55,12 @@ public class DefaultPackageScanClassReso private Set scanFilters; public void addClassLoader(ClassLoader classLoader) { -getClassLoaders().add(classLoader); +try { +getClassLoaders().add(classLoader); +} catch (UnsupportedOperationException ex) { +// Ignore this exception as the PackageScanClassResolver +// don't want use any other classloader +} } public void addFilter(PackageScanFilter filter) {
svn commit: r959731 - in /camel/trunk/camel-core/src/main/java/org/apache/camel: model/FromDefinition.java model/SendDefinition.java view/GraphSupport.java
Author: jstrachan Date: Thu Jul 1 17:26:41 2010 New Revision: 959731 URL: http://svn.apache.org/viewvc?rev=959731&view=rev Log: fix for CAMEL-2893 so that getUriOrRef will return non-null when there is a URI defined Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/FromDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/SendDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/view/GraphSupport.java Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/FromDefinition.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/FromDefinition.java?rev=959731&r1=959730&r2=959731&view=diff == --- camel/trunk/camel-core/src/main/java/org/apache/camel/model/FromDefinition.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/FromDefinition.java Thu Jul 1 17:26:41 2010 @@ -119,7 +119,7 @@ public class FromDefinition extends Opti * Returns the endpoint URI or the name of the reference to it */ public Object getUriOrRef() { -if (ObjectHelper.isEmpty(uri)) { +if (ObjectHelper.isNotEmpty(uri)) { return uri; } else if (endpoint != null) { return endpoint.getEndpointUri(); Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/SendDefinition.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/SendDefinition.java?rev=959731&r1=959730&r2=959731&view=diff == --- camel/trunk/camel-core/src/main/java/org/apache/camel/model/SendDefinition.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/SendDefinition.java Thu Jul 1 17:26:41 2010 @@ -105,7 +105,7 @@ public abstract class SendDefinitionhttp://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/view/GraphSupport.java?rev=959731&r1=959730&r2=959731&view=diff == --- camel/trunk/camel-core/src/main/java/org/apache/camel/view/GraphSupport.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/view/GraphSupport.java Thu Jul 1 17:26:41 2010 @@ -67,7 +67,10 @@ public class GraphSupport { ToDefinition toType = (ToDefinition) node; key = toType.getUriOrRef(); } -NodeData answer = nodeMap.get(key); +NodeData answer = null; +if (key != null) { +answer = nodeMap.get(key); +} if (answer == null) { String id = "node" + (nodeMap.size() + 1); answer = new NodeData(id, node, imagePrefix);
svn commit: r959702 - /camel/trunk/components/camel-web/pom.xml
Author: jstrachan Date: Thu Jul 1 15:47:56 2010 New Revision: 959702 URL: http://svn.apache.org/viewvc?rev=959702&view=rev Log: fix for CAMEL-2892 to remove warnings when running tests Modified: camel/trunk/components/camel-web/pom.xml Modified: camel/trunk/components/camel-web/pom.xml URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-web/pom.xml?rev=959702&r1=959701&r2=959702&view=diff == --- camel/trunk/components/camel-web/pom.xml (original) +++ camel/trunk/components/camel-web/pom.xml Thu Jul 1 15:47:56 2010 @@ -156,6 +156,12 @@ ${jetty-version} test + + org.eclipse.jetty + jetty-jsp-2.1 + ${jetty-version} + test + org.mortbay.jetty jsp-2.1-glassfish @@ -269,7 +275,24 @@ - + +org.codehaus.mojo +exec-maven-plugin +1.1.1 + + + + java + + + + + test + org.apache.camel.web.Main + + + + org.apache.maven.plugins maven-javadoc-plugin
svn commit: r959694 - in /camel/trunk/components/camel-web/src/main: java/org/apache/camel/web/resources/RoutesResource.java webapp/org/apache/camel/web/resources/RouteResource/index.jsp
Author: jstrachan Date: Thu Jul 1 15:27:48 2010 New Revision: 959694 URL: http://svn.apache.org/viewvc?rev=959694&view=rev Log: fix for CAMEL-2891 to use a URI template for languages which doesn't clash and preserves extensibility to other representations Modified: camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/resources/RoutesResource.java camel/trunk/components/camel-web/src/main/webapp/org/apache/camel/web/resources/RouteResource/index.jsp Modified: camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/resources/RoutesResource.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/resources/RoutesResource.java?rev=959694&r1=959693&r2=959694&view=diff == --- camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/resources/RoutesResource.java (original) +++ camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/resources/RoutesResource.java Thu Jul 1 15:27:48 2010 @@ -111,7 +111,7 @@ public class RoutesResource extends Came /** * Looks up an individual route with specified language */ -@Path("{id}/{language}") +@Path("{id}/lang/{language}") public RouteResource getRoute(@PathParam("id") String id, @PathParam("language") String language) { RouteResource routeResource = getRoute(id); if (routeResource != null) { Modified: camel/trunk/components/camel-web/src/main/webapp/org/apache/camel/web/resources/RouteResource/index.jsp URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-web/src/main/webapp/org/apache/camel/web/resources/RouteResource/index.jsp?rev=959694&r1=959693&r2=959694&view=diff == --- camel/trunk/components/camel-web/src/main/webapp/org/apache/camel/web/resources/RouteResource/index.jsp (original) +++ camel/trunk/components/camel-web/src/main/webapp/org/apache/camel/web/resources/RouteResource/index.jsp Thu Jul 1 15:27:48 2010 @@ -18,8 +18,8 @@ -Edit Route in Xml -Edit Route in Groovy +Edit Route in Xml +Edit Route in Groovy Edit Route in Ruby Edit Route in Scala
svn commit: r959651 - in /camel/trunk: components/camel-bean-validator/pom.xml components/camel-netty/pom.xml platforms/karaf/pom.xml
Author: davsclaus Date: Thu Jul 1 13:35:42 2010 New Revision: 959651 URL: http://svn.apache.org/viewvc?rev=959651&view=rev Log: Aligned jboss maven repo. Modified: camel/trunk/components/camel-bean-validator/pom.xml camel/trunk/components/camel-netty/pom.xml camel/trunk/platforms/karaf/pom.xml Modified: camel/trunk/components/camel-bean-validator/pom.xml URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bean-validator/pom.xml?rev=959651&r1=959650&r2=959651&view=diff == --- camel/trunk/components/camel-bean-validator/pom.xml (original) +++ camel/trunk/components/camel-bean-validator/pom.xml Thu Jul 1 13:35:42 2010 @@ -39,7 +39,7 @@ jboss JBoss Maven Repository -http://repository.jboss.com/maven2 +http://repository.jboss.org/nexus/content/groups/public/ true Modified: camel/trunk/components/camel-netty/pom.xml URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-netty/pom.xml?rev=959651&r1=959650&r2=959651&view=diff == --- camel/trunk/components/camel-netty/pom.xml (original) +++ camel/trunk/components/camel-netty/pom.xml Thu Jul 1 13:35:42 2010 @@ -39,7 +39,7 @@ - repository.jboss.org + jboss http://repository.jboss.org/nexus/content/groups/public/ false Modified: camel/trunk/platforms/karaf/pom.xml URL: http://svn.apache.org/viewvc/camel/trunk/platforms/karaf/pom.xml?rev=959651&r1=959650&r2=959651&view=diff == --- camel/trunk/platforms/karaf/pom.xml (original) +++ camel/trunk/platforms/karaf/pom.xml Thu Jul 1 13:35:42 2010 @@ -58,7 +58,7 @@ servicemix ServiceMix OSGi bundle Repository - http://repo2.maven.org/maven2 +http://repo2.maven.org/maven2 true @@ -70,7 +70,7 @@ servicemix.snapshot ServiceMix OSGi bundle snapshot Repository - http://repository.apache.org/content/groups/snapshots-group +http://repository.apache.org/content/groups/snapshots-group false @@ -94,7 +94,7 @@ jboss Jboss Repository - http://repository.jboss.org/maven2 + http://repository.jboss.org/nexus/content/groups/public/ true
[CONF] Apache Camel > Contributing
Contributing Page edited by Guillaume Nodet Changes (2) ... Why not dive in and try tackle some of our outstanding issues? {jiraissues:url="" {jiraissues:url="" h2. Becomming a committer ... Full Content There are many ways you can help make Camel a better piece of software - please dive in and help! Try surf the documentation - if somethings confusing or not clear, let us know. Download the code & try it out and see what you think. Browse the source code. Got an itch to scratch, want to tune some operation or add some feature? Want to do some hacking on Camel? Try surfing the our issue tracker for open issues or features that need to be implemented, take ownership of an issue and try fix it. If you'd rather a more gentle introduction to working on the Camel project, how about you try look at the test coverage report and help us get it even more green by supplying more test cases to get us closer to 100% coverage. Getting in touch There are various ways of communicating with the Camel community. join us on the Discussion Forums and take part in any conversations pop by on IRC and say hi add some comments to the wiki Improving the documentation Documentation is massively important to help users make the most of Apache Camel and its probably the area that needs the most help! So if you are interested in helping the documentation effort; whether its just to fix a page here or there, correct a link or even write a tutorial or improve what documentation is already there please do dive in and help! All of the documentation is stored on the wiki. See How does the website work or How do I edit the website for more details. To be able to edit the wiki you need to mail the dev list asking for an account (to prevent spam we only offer access to the wiki by folks sending mail to the mailing list). If you find a bug or problem Please raise a new issue in our issue tracker If you can create a JUnit test case then your issue is more likely to be resolved quicker. e.g. take a look at some of the existing unit tests cases Then we can add your issue to Subversion and then we'll know when its really fixed and we can ensure that the problem stays fixed in future releases. Working on the code Grab the Source and create a project in your IDE. e.g. if you are using Eclipse the following should do the trick... svn co https://svn.apache.org/repos/asf/camel/trunk camel cd camel mvn eclipse:eclipse Build the project. mvn install PS: You might need to build multiple times (if you get a build error) because sometimes maven fails to download all the files. Then import the projects into your workspace. Creating patches We gladly accept patches if you can find ways to improve, tune or fix Camel in some way. Most IDEs can create nice patches now very easily. e.g. in Eclipse just right click on a file/directory and select Team -> Create Patch. Then just save the patch as a file and then submit it. (You may have to click on Team -> Share... first to enable the Subversion options). Incidentally if you are an Eclipse user you should install the subclipse plugin. If you're a command line person try the following to create the patch diff -u Main.java.orig Main.java >> patchfile.txt or svn diff Main.java >> patchfile.txt Submitting patches The easiest way to submit a patch is to create a new JIRA issue (you will need to register), attach the patch or tarball as an attachment tick the Patch Attached button on the issue fire off an email to the Discussion Forums linking to the JIRA When a ticket is create in JIRA it automatically sends an email to the developer forum but an email always helps alert folks (as lots of emails are generated from every change to every JIRA). Remember to create and attach the patch in two steps, as JIRA does not support granting ASF license to the patch in the create ticket wizard. So after creating the ticket, then attach the patch and remember to tick off the grant ASF license, otherwise we can not commit the patch. We prefer patches has unit tests as well and that these unit tests have proper assertions as well, so remember to replace your system.out or logging with an assertion instead! Becoming a committer Once you've got involved as above, we may well invite you to be a committer. See How do I become a committer for more details. Using the issue tracker Before you can raise an issue in the issue tracker you need to register with it. This is quick & painless. If you want to have a go at fixing an issue you need to be in the list of activemq-developers on the issue tracker. To join the group, please mail the d...@camel.apache.org mail list with the email address you used to register with the issue t
[CONF] Apache Camel > Camel 2.4.0 Release
Camel 2.4.0 Release Page edited by Claus Ibsen Changes (1) ... * Fixed issue with [Direct] endpoint having no consumers if endpoint have been evicted from 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] 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 various EIP and Camel Components supports. 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. Added new 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 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 New Enterprise Integration Patterns New Components EJB to access EJB beans in a similar way as with the Bean component Class to invoke beans defined using the fully qualified class name New DSL New Annotations @RoutingSlip New Data Formats New Languages New Examples New Tutorials API breaking The ToAsync has been removed and replaced with a better asynchronous routing engine. Routing Slip now requires using _expression_ to specify the routing slip header, the XML DSL of Routing Slip is broken. "direct:a"/> "true"> myHeader The retryUntil method on onException have been renamed to retryWhile to better match what it does. It keeps retrying while the predicate returns true. Known Issues The Tracer may not output all details for some situations such as when using onCompletion or intercept etc. Not all Examples have ANT build.xml files to run the example using ANT. Important changes to consider when upgrading 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
[CONF] Apache Camel > Camel 2.4.0 Release
Camel 2.4.0 Release Page edited by Claus Ibsen Changes (1) ... {code} The {{retryUntil}} method on [onException|Exception Clause] have been renamed to {{retryWhile}} to better match what it does. It keeps retrying while the predicate returns {{true}}. 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 various EIP and Camel Components supports. 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. Added new 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 LRUCache. The RouteBuilder now have simple and xpath _expression_ builder methods out of the box. New Enterprise Integration Patterns New Components EJB to access EJB beans in a similar way as with the Bean component Class to invoke beans defined using the fully qualified class name New DSL New Annotations @RoutingSlip New Data Formats New Languages New Examples New Tutorials API breaking The ToAsync has been removed and replaced with a better asynchronous routing engine. Routing Slip now requires using _expression_ to specify the routing slip header, the XML DSL of Routing Slip is broken. "direct:a"/> "true"> myHeader The retryUntil method on onException have been renamed to retryWhile to better match what it does. It keeps retrying while the predicate returns true. Known Issues The Tracer may not output all details for some situations such as when using onCompletion or intercept etc. Not all Examples have ANT build.xml files to run the example using ANT. Important changes to consider when upgrading 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. The ProducerTemplate have been tighten up a bit. All send/request -body methods will now thr
svn commit: r959640 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/model/ camel-core/src/main/java/org/apache/camel/processor/ camel-core/src/test/java/org/apache/camel/issues/ camel-cor
Author: davsclaus Date: Thu Jul 1 12:47:49 2010 New Revision: 959640 URL: http://svn.apache.org/viewvc?rev=959640&view=rev Log: CAMEL-2889: Renamed retryUntil to retryWhile as its a more meaningful name what it does. Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RedeliveryPolicy.java camel/trunk/camel-core/src/test/java/org/apache/camel/issues/RetryContextScopedUntilRecipientListIssueTest.java camel/trunk/camel-core/src/test/java/org/apache/camel/issues/RetryContextScopedUntilRecipientListParallelIssueTest.java camel/trunk/camel-core/src/test/java/org/apache/camel/issues/RetryRouteScopedUntilRecipientListIssueTest.java camel/trunk/camel-core/src/test/java/org/apache/camel/issues/RetryRouteScopedUntilRecipientListParallelIssueTest.java camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionRetryUntilTest.java camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionRetryUntilWithDefaultErrorHandlerTest.java camel/trunk/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/handler/CamelNamespaceHandler.java camel/trunk/components/camel-scala/src/main/scala/org/apache/camel/scala/dsl/SOnExceptionDefinition.scala camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/OnExceptionTest.scala Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java?rev=959640&r1=959639&r2=959640&view=diff == --- camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java Thu Jul 1 12:47:49 2010 @@ -59,8 +59,8 @@ public class OnExceptionDefinition exten private List exceptions = new ArrayList(); @XmlElement(name = "onWhen", required = false) private WhenDefinition onWhen; -@XmlElement(name = "retryUntil", required = false) -private ExpressionSubElementDefinition retryUntil; +@XmlElement(name = "retryWhile", required = false) +private ExpressionSubElementDefinition retryWhile; @XmlElement(name = "redeliveryPolicy", required = false) private RedeliveryPolicyDefinition redeliveryPolicy; @XmlElement(name = "handled", required = false) @@ -82,7 +82,7 @@ public class OnExceptionDefinition exten @XmlTransient private Predicate continuedPolicy; @XmlTransient -private Predicate retryUntilPolicy; +private Predicate retryWhilePolicy; @XmlTransient private Processor onRedelivery; @@ -136,7 +136,7 @@ public class OnExceptionDefinition exten public void addRoutes(RouteContext routeContext, Collection routes) throws Exception { setHandledFromExpressionType(routeContext); setContinuedFromExpressionType(routeContext); -setRetryUntilFromExpressionType(routeContext); +setRetryWhileFromExpressionType(routeContext); // only one of handled or continued is allowed if (getHandledPolicy() != null && getContinuedPolicy() != null) { @@ -285,24 +285,28 @@ public class OnExceptionDefinition exten } /** - * Sets the retry until predicate. + * Sets the retry while predicate. + * + * Will continue retrying until predicate returns false. * - * @param until predicate that determines when to stop retrying + * @param retryWhile predicate that determines when to stop retrying * @return the builder */ -public OnExceptionDefinition retryUntil(Predicate until) { -setRetryUntilPolicy(until); +public OnExceptionDefinition retryWhile(Predicate retryWhile) { +setRetryWhilePolicy(retryWhile); return this; } /** - * Sets the retry until expression. + * Sets the retry while expression. + * + * Will continue retrying until expression evaluates to false. * - * @param until expression that determines when to stop retrying + * @param retryWhile expression that determines when to stop retrying * @return the builder */ -public OnExceptionDefinition retryUntil(Expression until) { -setRetryUntilPolicy(toPredicate(until)); +public OnExceptionDefinition retryWhile(Expression retryWhile) { +setRetryWhilePolicy(toPredicate(retryWhile)); return this; } @@ -636,20 +640,20 @@ public class OnExceptionDefinition exten this.onWhen = onWhen; } -public ExpressionSubElementDefinition getRetryUntil() { -return retryUntil; +
svn commit: r959624 - /camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/resources/RouteResource.java
Author: jstrachan Date: Thu Jul 1 11:43:20 2010 New Revision: 959624 URL: http://svn.apache.org/viewvc?rev=959624&view=rev Log: exposed the id property Modified: camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/resources/RouteResource.java Modified: camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/resources/RouteResource.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/resources/RouteResource.java?rev=959624&r1=959623&r2=959624&view=diff == --- camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/resources/RouteResource.java (original) +++ camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/resources/RouteResource.java Thu Jul 1 11:43:20 2010 @@ -376,4 +376,7 @@ public class RouteResource extends Camel return error; } +public String getId() { +return id; +} }
svn commit: r959583 - in /camel/trunk/tests: camel-itest-karaf/ camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/ camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/
Author: ningjiang Date: Thu Jul 1 10:03:53 2010 New Revision: 959583 URL: http://svn.apache.org/viewvc?rev=959583&view=rev Log: CAMEL-2882 camel-itest-karaf now supports to run tests with spring2.5 and spring3 Added: camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelNettyTest.java (with props) Modified: camel/trunk/tests/camel-itest-karaf/pom.xml camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelMailTest.java camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/MailRouteTest.java Modified: camel/trunk/tests/camel-itest-karaf/pom.xml URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-karaf/pom.xml?rev=959583&r1=959582&r2=959583&view=diff == --- camel/trunk/tests/camel-itest-karaf/pom.xml (original) +++ camel/trunk/tests/camel-itest-karaf/pom.xml Thu Jul 1 10:03:53 2010 @@ -64,17 +64,25 @@ pax-swissbox-tinybundles test - - org.osgi - org.osgi.compendium - 4.0.1 - compile - true - + +org.apache.felix +org.apache.felix.configadmin +test + org.osgi org.osgi.core 4.0.1 + test + + + org.apache.camel + camel-core + test + + + org.apache.camel + camel-spring test @@ -120,6 +128,10 @@ **/*Test.* + + **/*Cxf*.* + + **/*Scala*.* + + ${spring-version} + @@ -162,7 +177,10 @@ **/*Test.* - + + +${spring-version} + Modified: camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java?rev=959583&r1=959582&r2=959583&view=diff == --- camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java (original) +++ camel/trunk/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java Thu Jul 1 10:03:53 2010 @@ -26,14 +26,14 @@ import org.junit.After; import org.junit.Before; import org.ops4j.pax.exam.Inject; import org.ops4j.pax.exam.Option; +import org.ops4j.pax.exam.options.FrameworkOption; +import org.ops4j.pax.exam.options.UrlReference; import org.osgi.framework.BundleContext; import static org.junit.Assert.assertNotNull; -//import static org.ops4j.pax.exam.CoreOptions.equinox; import static org.ops4j.pax.exam.CoreOptions.felix; import static org.ops4j.pax.exam.CoreOptions.mavenBundle; import static org.ops4j.pax.exam.CoreOptions.options; -//import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.cleanCaches; import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.profile; import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.scanFeatures; import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.workingDirectory; @@ -130,22 +130,47 @@ public abstract class AbstractFeatureTes } return sb.toString(); } - + +public static UrlReference getCamelKarafFeatureUrl() { +String springVersion = System.getProperty("springVersion"); +System.out.println("*** The spring version is " + springVersion + " ***"); +String type = "xml/features"; +if (springVersion != null && springVersion.startsWith("3")) { +type = "xml/features-spring3"; +} +return mavenBundle().groupId("org.apache.camel.karaf"). +artifactId("apache-camel").versionAsInProject().type(type); +} + +public static FrameworkOption getFramework() { +return felix(); +} + public static Option[] configure(String feature) { +return configure(feature, getFramework()); +} + +public static Option[] configure(String feature, FrameworkOption framework) { Option[] options = options( profile("log").version("1.4"), // this is how you set the default log level when using pax logging (logProfile) org.ops4j.pax.exam.CoreOptions.systemProperty("or
svn commit: r959576 - in /camel/trunk/camel-core/src/test/java/org/apache/camel: component/file/ processor/aggregator/
Author: davsclaus Date: Thu Jul 1 09:48:22 2010 New Revision: 959576 URL: http://svn.apache.org/viewvc?rev=959576&view=rev Log: Polished Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileAbsoluteMoveDefaultIssueManual.java camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileBatchConsumerMemoryLeakTest.java camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerAbsoluteRootPathDefaultMoveTest.java camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatorExceptionInPredicateTest.java Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileAbsoluteMoveDefaultIssueManual.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileAbsoluteMoveDefaultIssueManual.java?rev=959576&r1=959575&r2=959576&view=diff == --- camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileAbsoluteMoveDefaultIssueManual.java (original) +++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileAbsoluteMoveDefaultIssueManual.java Thu Jul 1 09:48:22 2010 @@ -27,7 +27,7 @@ import org.apache.camel.language.simple. */ public class FileAbsoluteMoveDefaultIssueManual extends ContextTestSupport { -// TODO run this test manually +// run this test manually @Override protected void setUp() throws Exception { Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileBatchConsumerMemoryLeakTest.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileBatchConsumerMemoryLeakTest.java?rev=959576&r1=959575&r2=959576&view=diff == --- camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileBatchConsumerMemoryLeakTest.java (original) +++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileBatchConsumerMemoryLeakTest.java Thu Jul 1 09:48:22 2010 @@ -57,7 +57,7 @@ public class FileBatchConsumerMemoryLeak * or succeed fast */ public void xxxtestMemoryLeak() throws Exception { -// TODO: Run this manually and browse the memory usage, eg in IDEA there is a Statistics tab +// run this manually and browse the memory usage, eg in IDEA there is a Statistics tab deleteDirectory("target/filesorter/archiv"); for (int c = 0; c < 100; c++) { Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerAbsoluteRootPathDefaultMoveTest.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerAbsoluteRootPathDefaultMoveTest.java?rev=959576&r1=959575&r2=959576&view=diff == --- camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerAbsoluteRootPathDefaultMoveTest.java (original) +++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerAbsoluteRootPathDefaultMoveTest.java Thu Jul 1 09:48:22 2010 @@ -26,13 +26,14 @@ import org.apache.camel.component.mock.M */ public class FileConsumerAbsoluteRootPathDefaultMoveTest extends ContextTestSupport { +// run this test manually + private String base = "/tmp/mytemp"; public void testDummy() { // noop } -// TODO: Enable to test locally public void xxxTestConsumeFromAbsolutePath() throws Exception { deleteDirectory(base); Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatorExceptionInPredicateTest.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatorExceptionInPredicateTest.java?rev=959576&r1=959575&r2=959576&view=diff == --- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatorExceptionInPredicateTest.java (original) +++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatorExceptionInPredicateTest.java Thu Jul 1 09:48:22 2010 @@ -42,11 +42,7 @@ public class AggregatorExceptionInPredic private void testExceptionInFlow(String startUri) throws Exception { // failed first aggregation -// TODO Following assertion should be true while it is not. Instead -// exception handler set in BatchProcessor is used and it logs -// by default. - -// getMockEndpoint("mock:handled").expectedMessageCount(1); +getMockEndpoint("mock:handled").expectedMessageCount(1); // second aggregated getMockEndpoint("mock:result").expected
svn commit: r959571 - in /camel/trunk: ./ tests/camel-itest-osgi/ tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/ tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blu
Author: ningjiang Date: Thu Jul 1 09:42:48 2010 New Revision: 959571 URL: http://svn.apache.org/viewvc?rev=959571&view=rev Log: CAMEL-2882 support to run the osgi test with spring2.5 and spring3 Modified: camel/trunk/pom.xml camel/trunk/tests/camel-itest-osgi/pom.xml camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/LanguageTest.java camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/MailRouteTest.java camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/VelocityTest.java camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/AbstractIntegrationTest.java camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintTestSupport.java camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jaxb/JaxbFallbackConverterSpringTest.java camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jaxb/JaxbFallbackConverterTest.java camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jpa/JpaRouteTest.java camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/protobuf/ProtobufRouteTest.java camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/servlet/ServletComponentTest.java Modified: camel/trunk/pom.xml URL: http://svn.apache.org/viewvc/camel/trunk/pom.xml?rev=959571&r1=959570&r2=959571&view=diff == --- camel/trunk/pom.xml (original) +++ camel/trunk/pom.xml Thu Jul 1 09:42:48 2010 @@ -319,7 +319,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.4.3 + 2.5 org.codehaus.mojo @@ -368,7 +368,7 @@ org.apache.maven.plugins maven-surefire-report-plugin - 2.4.3 + 2.5 org.codehaus.mojo Modified: camel/trunk/tests/camel-itest-osgi/pom.xml URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/pom.xml?rev=959571&r1=959570&r2=959571&view=diff == --- camel/trunk/tests/camel-itest-osgi/pom.xml (original) +++ camel/trunk/tests/camel-itest-osgi/pom.xml Thu Jul 1 09:42:48 2010 @@ -147,10 +147,12 @@ org.apache.aries.blueprint org.apache.aries.blueprint +test org.apache.felix org.apache.felix.configadmin +test @@ -174,16 +176,21 @@ maven-surefire-plugin + pertest **/*Test.* **/JpaRouteTest.* - + + + ${spring-version} + + @@ -214,12 +221,15 @@ - **/*Test.* + **/*Test.* **/OSGiIntegrationSpringTest.* **/JaxbFallbackConverterTest.* + +${spring-version} + Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/LanguageTest.java URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/LanguageTest.java?rev=959571&r1=959570&r2=959571&view=diff == --- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/LanguageTest.java (original) +++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/LanguageTest.java Thu Jul 1 09:42:48 2010 @@ -70,8 +70,7 @@ public class LanguageTest extends OSGiIn org.ops4j.pax.exam.CoreOptions.systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"), // using the features to install the camel components -scanFeatures(mavenBundle().groupId("org.apache.camel.karaf"). - artifactId("apache-camel").versionAsInProject().type("xml/features"), +scanFeatures(getCamelKarafFeatureUrl(), "camel-core", "camel-spring", "camel-test", "camel-groovy"), workingDirectory("target/paxrunner/"), Modified
svn commit: r959570 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/processor/Enricher.java test/java/org/apache/camel/processor/async/AsyncEndpointEnricherTest.java
Author: davsclaus Date: Thu Jul 1 09:36:35 2010 New Revision: 959570 URL: http://svn.apache.org/viewvc?rev=959570&view=rev Log: CAMEL-2887: Enricher DSL support async routing engine. Added: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointEnricherTest.java - copied, changed from r959564, camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointTest.java Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Enricher.java Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Enricher.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Enricher.java?rev=959570&r1=959569&r2=959570&view=diff == --- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Enricher.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/Enricher.java Thu Jul 1 09:36:35 2010 @@ -16,15 +16,20 @@ */ package org.apache.camel.processor; +import org.apache.camel.AsyncCallback; +import org.apache.camel.AsyncProcessor; import org.apache.camel.Exchange; import org.apache.camel.ExchangePattern; -import org.apache.camel.Processor; import org.apache.camel.Producer; import org.apache.camel.impl.DefaultExchange; import org.apache.camel.impl.ServiceSupport; +import org.apache.camel.impl.converter.AsyncProcessorTypeConverter; import org.apache.camel.processor.aggregate.AggregationStrategy; +import org.apache.camel.util.AsyncProcessorHelper; import org.apache.camel.util.ExchangeHelper; import org.apache.camel.util.ServiceHelper; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import static org.apache.camel.util.ExchangeHelper.copyResultsPreservePattern; @@ -40,8 +45,9 @@ import static org.apache.camel.util.Exch * * @see PollEnricher */ -public class Enricher extends ServiceSupport implements Processor { +public class Enricher extends ServiceSupport implements AsyncProcessor { +private static final transient Log LOG = LogFactory.getLog(Enricher.class); private AggregationStrategy aggregationStrategy; private Producer producer; @@ -84,6 +90,10 @@ public class Enricher extends ServiceSup this.aggregationStrategy = defaultAggregationStrategy(); } +public void process(Exchange exchange) throws Exception { +AsyncProcessorHelper.process(this, exchange); +} + /** * Enriches the input data (exchange) by first obtaining * additional data from an endpoint represented by an endpoint @@ -93,12 +103,51 @@ public class Enricher extends ServiceSup * message exchange with the resource endpoint fails then no aggregation * will be done and the failed exchange content is copied over to the * original message exchange. - * + * * @param exchange input data. */ -public void process(Exchange exchange) throws Exception { -Exchange resourceExchange = createResourceExchange(exchange, ExchangePattern.InOut); -producer.process(resourceExchange); +public boolean process(final Exchange exchange, final AsyncCallback callback) { +final Exchange resourceExchange = createResourceExchange(exchange, ExchangePattern.InOut); + +AsyncProcessor ap = AsyncProcessorTypeConverter.convert(producer); +boolean sync = AsyncProcessorHelper.process(ap, resourceExchange, new AsyncCallback() { +public void done(boolean doneSync) { +// we only have to handle async completion of the routing slip +if (doneSync) { +return; +} + +if (resourceExchange.isFailed()) { +// copy resource exchange onto original exchange (preserving pattern) +copyResultsPreservePattern(exchange, resourceExchange); +} else { +prepareResult(exchange); + +// prepare the exchanges for aggregation +ExchangeHelper.prepareAggregation(exchange, resourceExchange); +Exchange aggregatedExchange = aggregationStrategy.aggregate(exchange, resourceExchange); +if (aggregatedExchange != null) { +// copy aggregation result onto original exchange (preserving pattern) +copyResultsPreservePattern(exchange, aggregatedExchange); +} +} + +callback.done(false); +} +}); + +if (!sync) { +if (LOG.isTraceEnabled()) { +LOG.trace("Processing exchangeId: " + exchange.getExchangeId() + " is continued being processed asynchronously"); +} +// the remainder of the routing slip will be completed async +// so we break out
svn commit: r959569 - in /camel/trunk/platforms/karaf/features: pom.xml src/main/resources/features-spring3.xml src/main/resources/features.xml
Author: ningjiang Date: Thu Jul 1 09:35:23 2010 New Revision: 959569 URL: http://svn.apache.org/viewvc?rev=959569&view=rev Log: Update the jetty bundle version of camel-feature, also fix some class not found exceptions of features-spring3.xml Modified: camel/trunk/platforms/karaf/features/pom.xml camel/trunk/platforms/karaf/features/src/main/resources/features-spring3.xml camel/trunk/platforms/karaf/features/src/main/resources/features.xml Modified: camel/trunk/platforms/karaf/features/pom.xml URL: http://svn.apache.org/viewvc/camel/trunk/platforms/karaf/features/pom.xml?rev=959569&r1=959568&r2=959569&view=diff == --- camel/trunk/platforms/karaf/features/pom.xml (original) +++ camel/trunk/platforms/karaf/features/pom.xml Thu Jul 1 09:35:23 2010 @@ -81,7 +81,6 @@ 1.0_2 1.1_2 1.2 - 7.0.1.v20091125 1.0.1_1 20030619_1 1.5.2_2 Modified: camel/trunk/platforms/karaf/features/src/main/resources/features-spring3.xml URL: http://svn.apache.org/viewvc/camel/trunk/platforms/karaf/features/src/main/resources/features-spring3.xml?rev=959569&r1=959568&r2=959569&view=diff == --- camel/trunk/platforms/karaf/features/src/main/resources/features-spring3.xml (original) +++ camel/trunk/platforms/karaf/features/src/main/resources/features-spring3.xml Thu Jul 1 09:35:23 2010 @@ -2,11 +2,14 @@ mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.aopalliance/${aopalliance-bundle-version} +mvn:org.springframework/spring-asm/${spring3-version} +mvn:org.springframework/spring-aop/${spring3-version} +mvn:org.springframework/spring-aspects/${spring3-version} mvn:org.springframework/spring-core/${spring3-version} mvn:org.springframework/spring-beans/${spring3-version} -mvn:org.springframework/spring-aop/${spring3-version} mvn:org.springframework/spring-context/${spring3-version} mvn:org.springframework/spring-context-support/${spring3-version} + mvn:org.springframework/spring-expression/${spring3-version} spring @@ -139,18 +142,18 @@ mvn:org.apache.geronimo.specs/geronimo-servlet_2.5_spec/${servlet-api-2.5-version} -mvn:org.eclipse.jetty/jetty-util/${jetty-bundle-version} -mvn:org.eclipse.jetty/jetty-io/${jetty-bundle-version} -mvn:org.eclipse.jetty/jetty-http/${jetty-bundle-version} -mvn:org.eclipse.jetty/jetty-client/${jetty-bundle-version} - mvn:org.eclipse.jetty/jetty-continuation/${jetty-bundle-version} -mvn:org.eclipse.jetty/jetty-jmx/${jetty-bundle-version} -mvn:org.eclipse.jetty/jetty-server/${jetty-bundle-version} - mvn:org.eclipse.jetty/jetty-security/${jetty-bundle-version} - mvn:org.eclipse.jetty/jetty-servlet/${jetty-bundle-version} - mvn:org.eclipse.jetty/jetty-servlets/${jetty-bundle-version} -mvn:org.eclipse.jetty/jetty-xml/${jetty-bundle-version} -mvn:org.eclipse.jetty/jetty-webapp/${jetty-bundle-version} +mvn:org.eclipse.jetty/jetty-util/${jetty-version} +mvn:org.eclipse.jetty/jetty-io/${jetty-version} +mvn:org.eclipse.jetty/jetty-http/${jetty-version} +mvn:org.eclipse.jetty/jetty-client/${jetty-version} +mvn:org.eclipse.jetty/jetty-continuation/${jetty-version} +mvn:org.eclipse.jetty/jetty-jmx/${jetty-version} +mvn:org.eclipse.jetty/jetty-server/${jetty-version} +mvn:org.eclipse.jetty/jetty-security/${jetty-version} +mvn:org.eclipse.jetty/jetty-servlet/${jetty-version} +mvn:org.eclipse.jetty/jetty-servlets/${jetty-version} +mvn:org.eclipse.jetty/jetty-xml/${jetty-version} +mvn:org.eclipse.jetty/jetty-webapp/${jetty-version} camel-core camel-http mvn:org.apache.camel/camel-jetty/${pom.version} @@ -209,14 +212,14 @@ mvn:org.apache.geronimo.specs/geronimo-servlet_2.5_spec/${servlet-api-2.5-version} -mvn:org.eclipse.jetty/jetty-util/${jetty-bundle-version} -mvn:org.eclipse.jetty/jetty-io/${jetty-bundle-version} -mvn:org.eclipse.jetty/jetty-http/${jetty-bundle-version} -mvn:org.eclipse.jetty/jetty-client/${jetty-bundle-version} - mvn:org.eclipse.jetty/jetty-continuation/${jetty-bundle-version} -mvn:org.eclipse.jetty/jetty-server/${jetty-bundle-version} - mvn:org.eclipse.jetty/jetty-security/${jetty-bundle-version} - mvn:org.eclipse.jetty/jetty-servlet/${jetty-bundle-version} +mvn:org.eclipse.jetty/jetty-util/${jetty-version} +mvn:org.eclipse.jetty/jetty-io/${jetty-version} +mvn:org.eclipse.jetty/jetty-http/${jetty-version} +mvn:org.eclipse.jetty/jetty-client/${jetty-version} +mvn:org.eclipse.jetty/jetty-continuation/${jetty-version} +mvn:org.eclipse.jetty/jetty-server/${jetty-version} +mvn:org.eclipse.jetty/jetty-security/${jetty-version} +mvn:org.eclipse.jetty/jetty-servlet/${jetty-version} mvn:org.apache.servicemix.bu
svn commit: r959567 - /camel/trunk/parent/pom.xml
Author: ningjiang Date: Thu Jul 1 09:32:16 2010 New Revision: 959567 URL: http://svn.apache.org/viewvc?rev=959567&view=rev Log: CAMEL-2888 camel-jetty and camel-cometd should import jetty version within [7.0, 8) Modified: camel/trunk/parent/pom.xml Modified: camel/trunk/parent/pom.xml URL: http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=959567&r1=959566&r2=959567&view=diff == --- camel/trunk/parent/pom.xml (original) +++ camel/trunk/parent/pom.xml Thu Jul 1 09:32:16 2010 @@ -140,6 +140,7 @@ org.apache.mina.*;version="[1.1.7,2.0)", org.apache.velocity.*;version="[1.6.2,2)", org.apache.xmlbeans.*;version="[2.4,3)", + org.eclipse.jetty.*;version="[7.0,8)", com.thoughtworks.xstream.*;version="[1.3,2)", org.antlr.stringtemplate.*;version="[3.0,4)", org.jivesoftware.smack.*;version="[3.0,4)",
svn commit: r959563 - in /camel/trunk: camel-core/src/main/java/org/apache/camel/model/ components/camel-bam/src/main/java/org/apache/camel/bam/rules/ components/camel-scala/src/test/scala/org/apache/
Author: jstrachan Date: Thu Jul 1 09:14:59 2010 New Revision: 959563 URL: http://svn.apache.org/viewvc?rev=959563&view=rev Log: fix for CAMEL-2883 along with a test case in camel-scala so that we can use the ProcessorDefintion typed methods in the model from Scala without getting compile errors due to bad use of generics Added: camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/UsingModelTest.scala - copied, changed from r959354, camel/trunk/components/camel-scala/src/test/scala/org/apache/camel/scala/ScalaTypeConverterTest.scala Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/AOPDefinition.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/ConvertBodyDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/FinallyDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/InterceptSendToEndpointDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/MarshalDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/OnExceptionDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/OtherwiseDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/OutputDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/PipelineDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/PolicyDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/RemoveHeaderDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/RemoveHeadersDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/RemovePropertyDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/ResequenceDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/RouteDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/SamplingDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/SendDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/SetExchangePatternDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/StopDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/ThreadsDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/ThrottleDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/TransactedDefinition.java camel/trunk/camel-core/src/main/java/org/apache/camel/model/UnmarshalDefinition.java camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/rules/TemporalRule.java Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/AOPDefinition.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/AOPDefinition.java?rev=959563&r1=959562&r2=959563&view=diff == --- camel/trunk/camel-core/src/main/java/org/apache/camel/model/AOPDefinition.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/model/AOPDefinition.java Thu Jul 1 09:14:59 2010 @@ -36,7 +36,7 @@ import org.apache.camel.spi.RouteContext @XmlRootElement(name = "aop") @XmlAccessorType(XmlAccessType.FIELD) @Deprecated -public class AOPDefinition extends OutputDefinition { +public class AOPDefinition extends OutputDefinition { @XmlAttribute(required = false) private String beforeUri; 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=959563&r1=959562&r2=959563&view=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 Thu Jul 1 09:14:59 2010 @@ -36,7 +36,7 @@ import org.apache.camel.util.ObjectHelpe */ @XmlRootElement(name = "bean") @XmlAccessorType(XmlAccessType.FIELD) -public class BeanDefinition extends OutputDefinition { +public class BeanDefinition extends OutputDefinition { @XmlAttribute(required = false) private String ref; @XmlAttribute(required = false) Modified: camel/trunk/camel-core/src/main/java/org/apache/came
svn commit: r959562 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java test/java/org/apache/camel/processor/async/AsyncEndpointIdempotentConsumer
Author: davsclaus Date: Thu Jul 1 09:07:45 2010 New Revision: 959562 URL: http://svn.apache.org/viewvc?rev=959562&view=rev Log: CAMEL-2886: idempotent consumer supports async routing engine Added: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointIdempotentConsumerTest.java - copied, changed from r959549, camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointTest.java Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java?rev=959562&r1=959561&r2=959562&view=diff == --- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/idempotent/IdempotentConsumer.java Thu Jul 1 09:07:45 2010 @@ -19,12 +19,16 @@ package org.apache.camel.processor.idemp import java.util.ArrayList; import java.util.List; +import org.apache.camel.AsyncCallback; +import org.apache.camel.AsyncProcessor; import org.apache.camel.Exchange; import org.apache.camel.Expression; import org.apache.camel.Navigate; import org.apache.camel.Processor; import org.apache.camel.impl.ServiceSupport; +import org.apache.camel.impl.converter.AsyncProcessorTypeConverter; import org.apache.camel.spi.IdempotentRepository; +import org.apache.camel.util.AsyncProcessorHelper; import org.apache.camel.util.ServiceHelper; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -35,21 +39,19 @@ import org.apache.commons.logging.LogFac * * @version $Revision$ */ -public class IdempotentConsumer extends ServiceSupport implements Processor, Navigate { +public class IdempotentConsumer extends ServiceSupport implements AsyncProcessor, Navigate { private static final transient Log LOG = LogFactory.getLog(IdempotentConsumer.class); private final Expression messageIdExpression; -private final Processor processor; +private final AsyncProcessor processor; private final IdempotentRepository idempotentRepository; private final boolean eager; -// TODO: should support async routing engine - -public IdempotentConsumer(Expression messageIdExpression, -IdempotentRepository idempotentRepository, boolean eager, Processor processor) { +public IdempotentConsumer(Expression messageIdExpression, IdempotentRepository idempotentRepository, + boolean eager, Processor processor) { this.messageIdExpression = messageIdExpression; this.idempotentRepository = idempotentRepository; this.eager = eager; -this.processor = processor; +this.processor = AsyncProcessorTypeConverter.convert(processor); } @Override @@ -58,6 +60,10 @@ public class IdempotentConsumer extends } public void process(Exchange exchange) throws Exception { +AsyncProcessorHelper.process(this, exchange); +} + +public boolean process(Exchange exchange, AsyncCallback callback) { final String messageId = messageIdExpression.evaluate(exchange, String.class); if (messageId == null) { throw new NoMessageIdException(exchange, messageIdExpression); @@ -75,14 +81,15 @@ public class IdempotentConsumer extends if (!newKey) { // we already have this key so its a duplicate message onDuplicateMessage(exchange, messageId); -return; +callback.done(true); +return true; } // register our on completion callback exchange.addOnCompletion(new IdempotentOnCompletion(idempotentRepository, messageId, eager)); // process the exchange -processor.process(exchange); +return processor.process(exchange, callback); } public List next() { Copied: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointIdempotentConsumerTest.java (from r959549, camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointTest.java) URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointIdempotentConsumerTest.java?p2=camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointIdempotentConsumerTest.java&p1=camel/trunk/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointTest.java&r1=959549&r2=959562&rev=959562&view=diff == --- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/as
[CONF] Apache Camel > AOP
AOP Page edited by Claus Ibsen Changes (1) ... *Available as of Camel 2.0* {warning:tit...@deprecated} The [AOP] has been marked as @deprecated in Camel 2.4 onwards and will be removed in a future release. The concept of the [AOP] did not go in the directs we liked, so sometimes its better to remove unused/less used features. {warning} Camel has a AOP concept in the DSL allowing you do do some custom *before* and/or *after* processing when routing an [Exchange]. It replaces the {{intercept}} from Camel 1.x that was more limited as it could was a fix around a single processor. ... Full Content AOP Available as of Camel 2.0 @deprecatedThe AOP has been marked as @deprecated in Camel 2.4 onwards and will be removed in a future release. The concept of the AOP did not go in the directs we liked, so sometimes its better to remove unused/less used features. Camel has a AOP concept in the DSL allowing you do do some custom before and/or after processing when routing an Exchange. It replaces the intercept from Camel 1.x that was more limited as it could was a fix around a single processor. This new AOP can span multiple processors (nodes in the route graph) and it uses endpoint URIs to allow invoking any kind of Camel component. The AOP supports the following callbacks in which you can use 1..n free of choice: before after afterFinally The difference between after and afterFinally is that afterFinally is invoked from a finally block so it will always be invoked no matter what, eg also in case of an exception occur. Using from Java DSL In this route we want to use the AOP to do a before and after logging. from("jms:queue:inbox") .aop().around("log:before", "log:after") .to("bean:order?method=validate") .to("bean:order?method=handle") .end() .to("jms:queue:order"); Notice that we use the end to indicate where the AOP around should end, for instance if we do more routing afterwards such as sending to another JMS queue. In the route below the AOP is only being around the bean processing. The aop in Java DSL have the following methods: around aroundFinally before after afterFinally Using from Spring DSL In Spring DSL its nearly the same as in the Java DSL however a bit differently "jms:queue:inbox"/> "log:before" afterUri="log:after"> "bean:order?method=validate"/> "bean:order?method=handle"/> "jms:queue:order"/> Notice we use attributes on the tag to chose with AOP concept to use. At runtime that resolves into this messages flow: inbox -> log:before -> bean.validate -> bean.handle -> log:after -> order The aop in Spring DSL have the following attributes: beforeUri afterUri afterFinallyUri So in order to do an around we use both the beforeUri and the afterUri. See Also Architecture Intercept Change Notification Preferences View Online | View Changes | Add Comment
svn commit: r959549 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/model/BeanDefinition.java test/java/org/apache/camel/processor/BeanValidateTypeTest.java
Author: davsclaus Date: Thu Jul 1 07:52:48 2010 New Revision: 959549 URL: http://svn.apache.org/viewvc?rev=959549&view=rev Log: CAMEL-2846: bean DSL validate that instance is not a String as a String is for beanRef DSL instead. Added: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/BeanValidateTypeTest.java (with props) Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/model/BeanDefinition.java 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=959549&r1=959548&r2=959549&view=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 Thu Jul 1 07:52:48 2010 @@ -152,6 +152,14 @@ public class BeanDefinition extends Outp ObjectHelper.notNull(beanType, "bean, ref or beanType", this); bean = CamelContextHelper.newInstance(routeContext.getCamelContext(), beanType); } +ObjectHelper.notNull(bean, "bean", this); + +// validate the bean type is not from java so you by mistake think its a reference +// to a bean name but the String is being invoke instead +if (bean instanceof String) { +throw new IllegalArgumentException("The bean instance is a java.lang.String type: " + bean ++ ". We suppose you want to refer to a bean instance by its id instead. Please use beanRef."); +} answer = new BeanProcessor(bean, routeContext.getCamelContext()); } if (method != null) { Added: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/BeanValidateTypeTest.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/BeanValidateTypeTest.java?rev=959549&view=auto == --- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/BeanValidateTypeTest.java (added) +++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/BeanValidateTypeTest.java Thu Jul 1 07:52:48 2010 @@ -0,0 +1,66 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.processor; + +import org.apache.camel.ContextTestSupport; +import org.apache.camel.FailedToCreateRouteException; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.impl.JndiRegistry; + +/** + * @version $Revision$ + */ +public class BeanValidateTypeTest extends ContextTestSupport { + +public static class MyCoolBean { + +public String hello(String s) { +return "Hello " + s; +} + +} + +@Override +public boolean isUseRouteBuilder() { +return false; +} + +@Override +protected JndiRegistry createRegistry() throws Exception { +JndiRegistry jndi = super.createRegistry(); +jndi.bind("cool", new MyCoolBean()); +return jndi; +} + +public void testBeanValidateType() throws Exception { +context.addRoutes(new RouteBuilder() { +@Override +public void configure() throws Exception { +// we should use beanRef instead to refer to cool +from("direct:start").bean("cool"); +} +}); +try { +context.start(); +fail("Should have thrown exception"); +} catch (FailedToCreateRouteException e) { +assertIsInstanceOf(IllegalArgumentException.class, e.getCause()); +assertTrue(e.getCause().getMessage().startsWith("The bean instance is a java.lang.String type: cool.")); +} +} + +} Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/BeanValidateTypeTest.java -- svn:eol-style = native Propchange: camel/trunk/camel-core/src/test/java/org/apache/camel/p
svn commit: r959540 - /camel/trunk/parent/pom.xml
Author: davsclaus Date: Thu Jul 1 07:04:16 2010 New Revision: 959540 URL: http://svn.apache.org/viewvc?rev=959540&view=rev Log: CAMEL-2885: Upgraded to slf4j 1.6.0 Modified: camel/trunk/parent/pom.xml Modified: camel/trunk/parent/pom.xml URL: http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=959540&r1=959539&r2=959540&view=diff == --- camel/trunk/parent/pom.xml (original) +++ camel/trunk/parent/pom.xml Thu Jul 1 07:04:16 2010 @@ -105,7 +105,7 @@ 9.1.0.8 2.8.0.RC7 2.9.1 -1.5.10 +1.6.0 3.1.0 1.8.1_3 1.6.2