Support for processing list-based reference params in DefaultComponent.
-----------------------------------------------------------------------

                 Key: CAMEL-2244
                 URL: https://issues.apache.org/activemq/browse/CAMEL-2244
             Project: Apache Camel
          Issue Type: Improvement
    Affects Versions: 2.1.0
            Reporter: Martin Krasser
            Assignee: Martin Krasser
            Priority: Minor
             Fix For: 2.2.0


Add a new method 

{noformat}
<T> List<T> resolveAndRemoveReferenceListParameter(Map<String, Object> 
parameters, String key, Class<T> elementType, List<T>  defaultValue)
{noformat}

to DefaultComponent for processing list-based reference params. Here's an 
example of a Spring application context with bean definitions followed by URIs 
that reference these beans.

{code:xml}
<bean id="filter1" class="..."/>
<bean id="filter2" class="..."/>

<util:list id="filterList">
  <ref bean="filter1" />
  <ref bean="filter2" />
</util:list>
{code} 

The new {{resolveAndRemoveReferenceListParameter}} handles the following cases.

Resolve reference to a bean of type java.util.List and return that list. 

{noformat}
from("mina:tcp://localhost:6142?filters=#filterList")
{noformat}

Resolve reference to a bean of type {{elementType}} (see method signature) and 
return a list containing that element.

{noformat}
from("mina:tcp://localhost:6142?filters=#filter1")
{noformat}

Resolve comma-separated reference list to beans of type {{elementType}} (see 
method signature) and return a list containing these elements.

{noformat}
from("mina:tcp://localhost:6142?filters=#filter1,#filter2")
{noformat}


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

Reply via email to