On 28 October 2010 10:25, Bruno Dusausoy <[email protected]> wrote: > On Thu, 28 Oct 2010 11:04:49 +0200, Claus Ibsen <[email protected]> > 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.
BTW there's also a constructor for most Endpoints which let you pass in a URI of your choosing. -- James ------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: jstrachan Blog: http://macstrac.blogspot.com/ Open Source Integration
