You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by David Tombs <cy...@gmail.com> on 2011/01/12 16:09:14 UTC

DefaultEndpoint constructors

Hello all,

I'm currently writing my own camel component right now.

In all the example code I see, the constructor DefaultEndpoint(String
endpointUri, Component component) is used. I tried using the
constructor DefaultEndpoint() but then got some exceptions, so I'm
assuming that DefaultEndpoint() and DefaultEndpoint(String
endpointUri) are only to be used if the uri and CamelContext will
later be set via setters (as in dependency injection). Is this
correct? If so, I suggest that the DefaultEndpoint javadoc be updated
to mention this to avoid future confusion.

Thanks,
David

--
Wise men _still_ seek Him.

Re: DefaultEndpoint constructors

Posted by David Tombs <cy...@gmail.com>.
On Thu, Jan 13, 2011 at 1:03 AM, Claus Ibsen <cl...@gmail.com> wrote:
> The default ctr is used if you create the endpoints manually (without
> using a component), for example in a spring xml file using the <bean>
> style. Then its easier to avoid having to use the ugly
> <constructor-arg>
>
> If you do that you are responsible for setting all those options yourself.
>
> And not all endpoints support creating a bean without using the
> component (eg jetty). So they can omit having a default ctr.

Thanks for the reply, Claus. I have added a JIRA issue
<https://issues.apache.org/jira/browse/CAMEL-3587> with an attached
patch for improving the documentation here.

Hope it helps,
David

-- 
Wise men _still_ seek Him.

Re: DefaultEndpoint constructors

Posted by Claus Ibsen <cl...@gmail.com>.
The default ctr is used if you create the endpoints manually (without
using a component), for example in a spring xml file using the <bean>
style. Then its easier to avoid having to use the ugly
<constructor-arg>

If you do that you are responsible for setting all those options yourself.

And not all endpoints support creating a bean without using the
component (eg jetty). So they can omit having a default ctr.



On Wed, Jan 12, 2011 at 4:09 PM, David Tombs <cy...@gmail.com> wrote:
> Hello all,
>
> I'm currently writing my own camel component right now.
>
> In all the example code I see, the constructor DefaultEndpoint(String
> endpointUri, Component component) is used. I tried using the
> constructor DefaultEndpoint() but then got some exceptions, so I'm
> assuming that DefaultEndpoint() and DefaultEndpoint(String
> endpointUri) are only to be used if the uri and CamelContext will
> later be set via setters (as in dependency injection). Is this
> correct? If so, I suggest that the DefaultEndpoint javadoc be updated
> to mention this to avoid future confusion.
>
> Thanks,
> David
>
> --
> Wise men _still_ seek Him.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/