I've spent some time on this and I think we should discuss something more before
actually modifying the code.
My opinion on JBWS-2187 is the following:
Handlers added multiple times
An easy fix for this could of course be to force the HandlerResolverImpl to clear its
handler map when the proxy is being created; this could be done, as suggested, calling
initBindingHanlderChain(true) from the ClientImpl. However I think the fact that handlers
are added multiple time is just a piece of a more general issue which is that config-file
and config-name should not be meant as port configurations (at least imho). As a matter of
fact, you end up modifying the metadata when setting those parameters and of course
metadata are scoped to the service. It's not only a matter of handlers already set up,
the config name too, for example, is already set to "Standard WS Security
Client" when the second port is created in the described scenario, before the
setConfigName method is invoked.
Btw clients are nevertheless allowed to change handlers for a given port through the
binding and that should not affect port being created later, thus this is a config
file/name setup issue only.
Thread safety
The concern here is that multiple thread using their own port instances could concurrently
access the handler's map in the HandlerResolver, right? We can think about technical
means of preventing problems in those scenarios, but AFAIK the handler resolver is meant
to be scoped to the Service and we can't change that. And again I can see this
threading issue only when changing the config-file/name, changing the handler chain from
client side through port.getBinding().setHandlerChain(...) is an harmless operation.
What do you think about this?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4153741#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...