Hi Dan,

On 30/09/13 19:27, Daniel Kulp wrote:
On Sep 26, 2013, at 11:43 AM, Alessio Soldano <[email protected]> wrote:

Hi,
I currently have an integration requirement which basically imply having to 
perform some additional authorization checks just before invoking any JAXWS 
handler handleMessage method.

For achieving that, I've thought about using a custom HandlerChainInvoker 
overriding 'invokeLogicalHandlers' and 'invokeProtocolHandlers' methods.
For installing such a custom invoker, I thought about adding a custom 
AbstractPhaseInterceptor running just before the SOAPHandlerInterceptor in the 
PRE_PROTOCOL_FRONTEND phase; the new handler would install my invoker in the 
Exchange, similarly to what is done in 
AbstractJAXWSHandlerInterceptor#getInvoker.
The problem I have, however, is that ofcourse I need a handle to the handler chain 
(List<Handler>) to build the invoker: the handler chain is available from the 
Endpoint stored in the current exchange, if the endpoint is an instance of 
JaxWsEndpointImpl. Any idea / hint on how to get that there easily for other Endpoint 
types?
Would there ever be these things for anything other than a JaxWsEndpointImpl?   
 Within the CXF codebase, the only calls to the constructors of any of the 
subclasses of AbstractJAXWSHandlerInterceptor are from JaxWsEndpointImpl.   
Does the JBoss integration use something other than JaxWsEndpointImpl?     The 
other subclasses of Endpoint are non JAX-WS (simple frontend or  jaxrs) and 
thus wouldn't have handler chains anyway.

Mostly curious on that.
Well, I was actually mainly wondering if I could be missing something here, as I initially simply casted the endpoint to JaxWsEndpointImpl and noticed some failures. Now I checked and basically I happen to get a WrappedEndpoint instance (when running some WS-RM tests) and a EndpointImpl instance (in a WS-SecureConversation test). Both are actually internal things the user can't add jaxws handlers to. To answer your questions, the JBossWS integration does not directly creates these endpoints at all. Instead, it uses the org.apache.cxf.jaxws.EndpointImpl#publish() to deploy endpoints (we have a custom class extending the org.apache.cxf.jaxws22.EndpointImpl version). Any other server side integration customization is performed at the bus level, by installing additional interceptors and a custom configurer (org.apache.cxf.configuration.Configurer) in the Bus created using a specific Bus factory. So in this case I'm installing above mentioned custom AbstractPhaseInterceptor in the bus that's created for each ws endpoint deployment on JBoss AS.

Does the whole flow here make sense?
Would it make sense to allow a more direct customization of the handler chain 
invoker?
I guess I'd want to know a little more about how the JBoss integration is dealing with 
the JaxWsEndpointImpl.    I'm certainly very open to making the handler chain invocation 
more customizable, but it's more a matter of "how".

My doubts above are basically solved (I can simply check if the endpoint I get is JaxWsEndpointImpl, otherwise do nothing), thanks. Speaking of more direct customization of the handler chain invoker, I'll try to think about a proposal tomorrow and perhaps ping you on IRC or reply here.
Thanks
Alessio

--
Alessio Soldano
Web Service Lead, JBoss

Reply via email to