users@jsr311.java.net

Re: RuntimeDelegate.createEndpoint()

From: Bill Burke <bburke_at_redhat.com>
Date: Fri, 30 May 2008 13:37:33 -0400

Sergey Beryozkin wrote:
> Hi,
>
>>
>> But that's exactly what we have now, e.g. you could do:
>>
>> javax.xml.ws.Endpoint = delegate.createEndpoint(applicationConfig,
>> javax.xml.ws.Endpoint.class);
>>
>> (assuming the impl supports javax.xml.ws.Endpoint as an endpoint type).
>
> Ok, this code would have a chance to be more portable :-) My only
> concern is that it might not be a solid portable code (given some of the
> robust feedback earlier :-)). Consider a TCK test case which would
> verify that the info passed in the ApplicationConfig is preprocessed
> properly (though Spring might help here). IMHO having a dedicated JAX-RS
> specific Endpoint interface wouldn't be too bad, though I appreciate the
> concerns about some duplication.
>
> I'm just looking now at a JAX-WS endpoint interface and it seems it may
> not fit perfectly well, at least initally with the
> JAX-RS view of the world, with its getBinding(), etc...
>
> Endpoint {
> ApplicationConfig getApplicationConfig();
> start();
> stop();
> boolean isStarted();
> // and then later add some more useful stuff
> }
>
> would possibly do...
>
> I'd like to be able to say basically this to the users of the JAX-RS
> based product :
> here's the mainline code, you right it and then you can substitute the
> underlying implementation from CXF to Jersey or to Restlets/RestEasy or
> the other way around. My concern that even though JAX-RS is a
> specification there's no 100% portable way to submit an aplication
> config and have an endpoint up and running with the Runtime.createEndpoint.
>

Just want to add that a createEndpoint() method may be useful in a
standalone, SE-like environment, but it is not needed (and actually
hurts) in a well-integrated environment like an application server where
packaging is much more simpler and lifecycle and dependency management
is handled by the app-server's kernel.

Its the same reason in JPA why the javax.persistence.Persistence class
is discouraged in EE and the injection annotations encouraged. Because
in EE we can provide a simpler integration point.

As far as JAX-WS goes, I don't think it should even be mentioned in the
specification. The Endpoint interface brings in a lot of baggage that we
  don't want/need in REST, or concepts (like Handlers) that we may want
a JAX-RS style/flavor for.

Bill

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com