activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: [camel] spring container
Date Mon, 30 Apr 2007 08:47:12 GMT
On 4/28/07, dr.jeff <jlansing@systechnologies.com> wrote:
>
> Is this logic in org.apache.camel.spring.RouteBuilderFinder correct?
>
>     /**
>      * Lets ignore beans that are not explicitly configured in the
> spring.xml
>      */
>     protected boolean shouldIgnoreBean(Class type) {
>         Map beans = applicationContext.getBeansOfType(type, true, true);
>         if (beans == null || beans.isEmpty()) {
>             return false;
>         }
>         // TODO apply some filter?
>         return true;
>     }
>
> If the application context finds beans of the requested type (which it does
> if they are defined in the xml configuration) then the method returns true,
> meaning "yes, should ignore".
> But isn't that just the opposite of what is desired? Or am I missing the
> whole point here?

So the idea is to avoid having to declare in the spring.xml every
single RouteBuilder you write. Instead you can just get the
RouteBuilderFinder to just find all of the RouteBuilder classes you
have and auto-wire them up.

However if you explicitly configure a RouteBuilder in your spring.xml
(e.g. to dependency inject it with something), then its not included
in the auto-wiring.

The intent is to just avoid developers having to write reams of XML
unless they really want to.

-- 
James
-------
http://macstrac.blogspot.com/

Mime
View raw message