camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dusausoy <bdusau...@yp5.be>
Subject Re: Endpoint construction
Date Thu, 28 Oct 2010 09:25:36 GMT
On Thu, 28 Oct 2010 11:04:49 +0200, Claus Ibsen <claus.ibsen@gmail.com>
wrote:
[...]
> 
> You could most likely use setEndpointUriIfNotSpecified to set a pseudo
> id, to differentiate the 2 of them
> 
Indeed, it works.

I've searched the reason why it worked like this and found that the
toString() method in DefaultEndpoint is :

    @Override
    public String toString() {
        return "Endpoint[" + getEndpointUri() + "]";
    }

    public String getEndpointUri() {
        if (endpointUri == null) {
            endpointUri = createEndpointUri();
            if (endpointUri == null) {
                throw new IllegalArgumentException("endpointUri is not
specified and " + getClass().getName()
                        + " does not implement createEndpointUri() to
create a default value");
            }
        }
        return endpointUri;
    }

And in FileEndpoint :

    @Override
    protected String createEndpointUri() {
        return "file://" + getFile().getAbsolutePath();
    }

So indeed, it creates the same endpoint URI for both.

Thanks.
-- 
Bruno Dusausoy
YP5 Software
--
Pensez environnement : limitez l'impression de ce mail.
Please don't print this e-mail unless you really need to.

Mime
View raw message