You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Stephen Gargan (JIRA)" <ji...@apache.org> on 2009/06/15 03:58:35 UTC

[jira] Created: (CAMEL-1708) Allow for the selection of Routes during package scan using Ant like Path matching

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.


[jira] Assigned: (CAMEL-1708) Allow for the selection of Routes during package scan using Ant like Path matching

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1708?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned CAMEL-1708:
----------------------------------

    Assignee: Claus Ibsen

> 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
>            Assignee: Claus Ibsen
>            Priority: Minor
>         Attachments: patch.txt, 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.


[jira] Commented: (CAMEL-1708) Allow for the selection of Routes during package scan using Ant like Path matching

Posted by "Stephen Gargan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52261#action_52261 ] 

Stephen Gargan commented on CAMEL-1708:
---------------------------------------

Sounds good,  I'll sign up. Here's another patch, with those changes.



> 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
>            Priority: Minor
>         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.


[jira] Commented: (CAMEL-1708) Allow for the selection of Routes during package scan using Ant like Path matching

Posted by "Stephen Gargan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52324#action_52324 ] 

Stephen Gargan commented on CAMEL-1708:
---------------------------------------

That's strange, as I did run the sourcecheck and cleared out any warnings it gave. I'm also using the eclipse formatting settings from the etc/eclipse directory. Are the rules there not the latest? Anyhow, I understand though that changes to the comments are just noisy in a patch. Thetwo replacements should be clean. I'll up the line length to 140 to see if that helps.

rgds,

ste


> 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
>            Assignee: Claus Ibsen
>             Fix For: 2.0.0
>
>         Attachments: core-patch.txt, patch.txt, patch.txt, spring-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.


[jira] Updated: (CAMEL-1708) Allow for the selection of Routes during package scan using Ant like Path matching

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1708?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-1708:
-------------------------------

         Priority: Major  (was: Minor)
    Fix Version/s: 2.0.0

> 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
>            Assignee: Claus Ibsen
>             Fix For: 2.0.0
>
>         Attachments: core-patch.txt, patch.txt, patch.txt, spring-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.


[jira] Resolved: (CAMEL-1708) Allow for the selection of Routes during package scan using Ant like Path matching

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1708?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-1708.
--------------------------------

    Resolution: Fixed

Stephen have done the documentation now. Cool.
http://camel.apache.org/spring.html

> 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
>            Assignee: Claus Ibsen
>             Fix For: 2.0.0
>
>         Attachments: core-patch.txt, patch.txt, patch.txt, spring-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.


[jira] Commented: (CAMEL-1708) Allow for the selection of Routes during package scan using Ant like Path matching

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Updated: (CAMEL-1708) Allow for the selection of Routes during package scan using Ant like Path matching

Posted by "Stephen Gargan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1708?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephen Gargan updated CAMEL-1708:
----------------------------------

    Attachment: patch.txt

> 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.


[jira] Commented: (CAMEL-1708) Allow for the selection of Routes during package scan using Ant like Path matching

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52302#action_52302 ] 

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

Stephen,

I renamed the <packages> to <package> in the <packageScan> tag.
You can have 1..n package

For instance
{code}
<packageScan>
  <package>com.foo</package>
  <package>com.bar</package>
  <excludes>**/*JustForTest*</excludes>
<packageScan>
{code}



> 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
>            Assignee: Claus Ibsen
>             Fix For: 2.0.0
>
>         Attachments: core-patch.txt, patch.txt, patch.txt, spring-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.


[jira] Updated: (CAMEL-1708) Allow for the selection of Routes during package scan using Ant like Path matching

Posted by "Stephen Gargan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1708?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephen Gargan updated CAMEL-1708:
----------------------------------

    Priority: Minor  (was: Major)

> 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
>            Priority: Minor
>         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.


[jira] Updated: (CAMEL-1708) Allow for the selection of Routes during package scan using Ant like Path matching

Posted by "Stephen Gargan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1708?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephen Gargan updated CAMEL-1708:
----------------------------------

    Attachment: spring-patch.txt
                core-patch.txt

So I've undone any formatting changes not related to the patches.

 I've been using the formatting rules for eclipse from the project, are these not correct? Is there a beautifier I could run before submission to make sure the code was consistent with the project's standards? 

I've also got a small amount of documentation to add to the confluence wiki if I can get access.

> 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
>            Assignee: Claus Ibsen
>            Priority: Minor
>         Attachments: core-patch.txt, patch.txt, patch.txt, spring-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.


[jira] Issue Comment Edited: (CAMEL-1708) Allow for the selection of Routes during package scan using Ant like Path matching

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52301#action_52301 ] 

Claus Ibsen edited comment on CAMEL-1708 at 6/17/09 12:17 AM:
--------------------------------------------------------------

Thanks a lot for the patch and helping with providing the patch multiple times.

trunk: 785479, 785490.

You can run {{mvn compile -Psourcecheck}} to check if the code is formatted correct.

I guess your eclipse format is a bit extreme in the limit of line lengths. At Camel its like 140+ chars.

Before we can wrap this one we need to have the documentation in wiki as well.
Stephen if you could help here that would be great. Let me know when you have created an account on the wiki.



      was (Author: davsclaus):
    Thanks a lot for the patch and helping with providing the patch multiple times.

trunk: 785479.

You can run {{mvn compile -Psourcecheck}} to check if the code is formatted correct.

I guess your eclipse format is a bit extreme in the limit of line lengths. At Camel its like 140+ chars.

Before we can wrap this one we need to have the documentation in wiki as well.
Stephen if you could help here that would be great. Let me know when you have created an account on the wiki.


  
> 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
>            Assignee: Claus Ibsen
>             Fix For: 2.0.0
>
>         Attachments: core-patch.txt, patch.txt, patch.txt, spring-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.


[jira] Commented: (CAMEL-1708) Allow for the selection of Routes during package scan using Ant like Path matching

Posted by "Stephen Gargan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52248#action_52248 ] 

Stephen Gargan commented on CAMEL-1708:
---------------------------------------

Claus,

I can't really take credit, the scan framework lends itself nicely to extension. It's easy when its all laid out to begin with ;). 

Yeah, didn't mean to try and slip something in under the radar.  The test was failing on me for some reason. I took a quick look ad it seemed the routes were coming out in the reverse order so I added a little to grab it by name. I didn't figure it warranted its own patch, but I should have said it was attached.  I'll make the changes and upload a new patch.

I'd be happy to document it, just a couple of things; Where would you like it to go? How do you go about editing the confluence pages? Will my Jira credentials work?

thanks,

ste


> 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.


[jira] Commented: (CAMEL-1708) Allow for the selection of Routes during package scan using Ant like Path matching

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52252#action_52252 ] 

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

Stephen, cool.

AFAIR the JIRA and Confluence are not linked with username. So you gotta signup at confluence.

There is a link on the page about how do I edit the wiki pages
http://camel.apache.org/contributing.html

When you got a confluence username, then I can grant you karma so you can edit.

I guess the best spot to add docu about this new feature is at:
http://camel.apache.org/spring.html




> 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.


[jira] Updated: (CAMEL-1708) Allow for the selection of Routes during package scan using Ant like Path matching

Posted by "Stephen Gargan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-1708?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephen Gargan updated CAMEL-1708:
----------------------------------

    Attachment: patch.txt

> 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
>            Priority: Minor
>         Attachments: patch.txt, 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.


[jira] Commented: (CAMEL-1708) Allow for the selection of Routes during package scan using Ant like Path matching

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52301#action_52301 ] 

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

Thanks a lot for the patch and helping with providing the patch multiple times.

trunk: 785479.

You can run {{mvn compile -Psourcecheck}} to check if the code is formatted correct.

I guess your eclipse format is a bit extreme in the limit of line lengths. At Camel its like 140+ chars.

Before we can wrap this one we need to have the documentation in wiki as well.
Stephen if you could help here that would be great. Let me know when you have created an account on the wiki.



> 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
>            Assignee: Claus Ibsen
>            Priority: Minor
>         Attachments: core-patch.txt, patch.txt, patch.txt, spring-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.


[jira] Commented: (CAMEL-1708) Allow for the selection of Routes during package scan using Ant like Path matching

Posted by "Stephen Gargan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52295#action_52295 ] 

Stephen Gargan commented on CAMEL-1708:
---------------------------------------

Will do, Didn't really mean to format stuff I wasn't writing. I have a compulsive twitch that has me hit the formatter by default ;). I'll get back to you about the patches.

ste


> 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
>            Assignee: Claus Ibsen
>            Priority: Minor
>         Attachments: patch.txt, 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.


[jira] Commented: (CAMEL-1708) Allow for the selection of Routes during package scan using Ant like Path matching

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-1708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52280#action_52280 ] 

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

Hi

Could you split the patch into 2 files: 1 files for came-core and another for camel-spring?
I hate applying big patch to SVN its painful when it gets messy (looking forward to git)

And please also undo all the code formatting you have done in files that hasn't anything to do with this new feature.

For instance you should not change the existing code layout such as:
{code}
-        // do special preparation for some concepts such as interceptors and policies
-        // this is needed as JAXB does not build excaclty the same model definition as Spring DSL would do
-        // using route builders. So we have here a little custom code to fix the JAXB gaps
+        // do special preparation for some concepts such as interceptors and
+        // policies
+        // this is needed as JAXB does not build excaclty the same model
+        // definition as Spring DSL would do
+        // using route builders. So we have here a little custom code to fix the
+        // JAXB gaps
{code}

If not then I need to go over and do that manually. We want to keep the existing format and only
apply patches that fixes the issue its subject to.


And btw PackageScanDefinition should be added to {{jaxb.index}} file. Something that is very often forgotten.

> 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
>            Assignee: Claus Ibsen
>            Priority: Minor
>         Attachments: patch.txt, 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.