users@glassfish.java.net

Re: trouble configuring client side handlers

From: Mark Hansen <mark_at_javector.com>
Date: Tue, 07 Feb 2006 09:32:32 -0500

Thanks. Your approach works (setting the HandlerResolver). I'm
curious, however. Is my code (see bottom) wrong? I.e., is it incorrect
to get the HandlerChain directly from the proxy (BindingProvider) and
add the new handlers to it? I would think that this approach should
work, but maybe I'm missing something.

-- Mark

Stephen DiMilla wrote:

> I should have removed the debugging lines, if I do, it looks like this:
>
>
> RequestOrderService service = new RequestOrderService();
> service.setHandlerResolver(new HandlerResolver() {
> public List<Handler> getHandlerChain(PortInfo info) {
> List<Handler> handlerList = new ArrayList<Handler>();
> handlerList.add(new AddMessageIdHandler());
> handlerList.add(new PersistMessageHandler());
> return handlerList;
> }
>
> });
> RequestOrderPort port = service.getRequestOrderPort();
>
========================

>>>
>>> RequestOrderService service = new RequestOrderService();
>>> RequestOrderPort port = service.getRequestOrderPort();
>>> List<Handler> handlerChain =
>>> ((BindingProvider) port).getBinding().getHandlerChain();
>>> handlerChain.add(new AddMessageIdHandler());
>>> handlerChain.add(new PersistMessageHandler());
>>