On Mon, Dec 8, 2008 at 7:56 PM, Hiram Chirino <[EMAIL PROTECTED]> wrote:
>>>
>>> When we see "bean:" prefixing a key, then we treat myJpaRepo as bean
>>> id. If it can not be resolved, we will flag an error. If "bean:" is
>>> not there, the value is a string "myJpaRepo". Since ':' is not a
>>> valid Java variable name, we don't have to worry about "bean:"
>>> clashing with key name.
>>
>> Yeah the bean: convention is also nice at it clearly highlights that
>> it's a bean reference, and no problems if end users want a string
>> literal starting with #.
>>
>> When I first thought of this I used the convetion that if the
>> parameter name ended with Ref then it was a bean reference. So it
>> should be:
>> file://inbox/?idempotent=true&idempotentRepositoryRef=myJpaRepo
>>
>> That is why currently we have the xxxRef options added manually on
>> some of the components.
>>
>
>
> I like where this is going. My personal preference would be to use a
> "key:ref=value" syntax. That way you avoid the escaping issues with #
> in the value and you avoid the property name clash issues with the
> Property name. Plus is reads nicely.
>
> example:
> file://inbox/?idempotent=true&idempotentRepository:ref=myJpaRepo
Yeah that is a nice idea as well. It's a variation of the xxxRef
syntax but much more clearly state this is a reference to both end
user can Camel as well. Using this Camel knows its 100% a reference
and can use mandatoryLookup as the bean should be there in the
registry.
BTW: The # escaping, in my point of view is not an issue. With the
current # syntax Camel will try to find a bean in the registry, and
only if there is:
- a bean found
- AND a setter on the endpoint with the given parameter type of the
bean, then it will call the setXXX method
Example if there is such a method:
(setIdempotentRepository(IdempotentRepository repo)
- If NOT iIt fall backs to regular introspection properties setter
that will call the String setter with the #value.
Example: If there is such a method:
(setIdempotentRepository(String repo)
>
> --
> Regards,
> Hiram
>
> Blog: http://hiramchirino.com
>
> Open Source SOA
> http://open.iona.com
>