[prev in list] [next in list] [prev in thread] [next in thread] 

List:       activemq-dev
Subject:    Re: [camel] spring container
From:       "James Strachan" <james.strachan () gmail ! com>
Date:       2007-04-30 8:47:12
Message-ID: ec6e67fd0704300147q62013bf2y743612b2cb89f453 () mail ! gmail ! com
[Download RAW message or body]

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/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic