users@glassfish.java.net

Re: trouble configuring client side handlers

From: Stephen DiMilla <Stephen.Dimilla_at_Sun.COM>
Date: Tue, 07 Feb 2006 14:12:10 -0500

I think the spec mentions something about the list of handlers can't be
modified after the port is obtained.
You certainly can access the list of handlers but modification isn't
allowed.

Stephen

Mark Hansen wrote:

> 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());
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>