camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CAMEL-1708) Allow for the selection of Routes during package scan using Ant like Path matching
Date Mon, 15 Jun 2009 04:14:35 GMT

    [ https://issues.apache.org/activemq/browse/CAMEL-1708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52245#action_52245
] 

Claus Ibsen commented on CAMEL-1708:
------------------------------------

Stephen

Very good work. Its definitely great.

Just a few comments:
- I think we should name the includes like the file based one: so they should end with and
s: *includes* and *excludes*.
- The patch includes changes to files that hasn't anything with this new feature (I saw 1
unit test). The problem is that it looks like some auto code formatter has been applied and
it changes the existing format. So is it possible to tone down this? For instance could you
look into you changes files and revert the changes where it is not needed to respect the existing
code format.
- And could you run: {{mvn compile -Psourcecheck}} that runs a checkstyle that all Camel code
should adhere to.
- Good idea about the sub scan package and leveraging what we got in there.  :)

By again cool feature, great work and we love it. You got great skills!

Would you also be willing to help with documenting this new feature?

> Allow for the selection of Routes during package scan using Ant like Path matching
> ----------------------------------------------------------------------------------
>
>                 Key: CAMEL-1708
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1708
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-spring
>    Affects Versions: 2.0-M1
>            Reporter: Stephen Gargan
>         Attachments: patch.txt
>
>
> Attached is a patch to allow for Routes to be included and excluded using ant like path
patterns. Packages to be scanned are supplied as ususal, but whether the Route classes discovered
in these packages are included is now also controlled by sets of include and exclude filters.

> This mechanism is defined as a subelement of the CamelContext definition in Spring context
as follows. 
> <camelContext xmlns="http://camel.apache.org/schema/spring">
>     <packageScan>
>       <packages>org.apache.camel.spring.config.scan</packages>
>       <exclude>**/*Excluded*</exclude>
>       <include>**/*Included*</include>
>     </packageScan>
>     ....
> </camelContext>
> It leverages Spring's AntPathMatcher to match fully qualified class names against the
supplied patterns. The existing <package></package> definition has been deprecated
and will emit a log message suggesting the new mechanism.
> This patch also includes code to allow Routes to be selectively excluded via class matching
at test time. i.e.
> public class RouteExcludingSpringTest extends SpringTestSupport {
>     @Override
>     protected AbstractXmlApplicationContext createApplicationContext() {
>         return new ClassPathXmlApplicationContext(new String[] {"routes-context.xml"},
getRouteExcludingApplicationContext());
>     }
>     ....
>     @Override
>     protected Class excludeRoute() {
>         return MyExcludedRouteBuilder.class;
>     }
> }  
> I hope you can find this usefull. I'll be happy to make any changes you might suggest.
> rgds,
> Stephen

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


Mime
View raw message