Re: Handler problems

From: Bobby Bissett - Javasoft <Robert.Bissett_at_Sun.COM>
Date: Tue, 14 Jun 2005 12:56:45 -0400

> HandlerRegistry registry = fact.getHandlerRegistry();
> List hc = registry.getHandlerChain(
> new QName("http://localhost:8081/service/server"));
> HandlerInfo hi = new HandlerInfo();
> hi.setHandlerClass(Handler.class);
> // populate the properties
> Hashtable hashtable = new Hashtable();
> hashtable.put("key", "value");
> // set the properties in handler
> hi.setHandlerConfig(hashtable);
> hc.add(hi);

So far in this code you are never setting the new handler chain; all you
are doing is adding a HandlerInfo object to the list that was used
already to configure the handlers. Try adding:

registry.setHandlerChain(new QName(
    "http://localhost:8081/service/server"), hc);

call after your last line. I agree that the javadoc descriptions of the
1.X handler registry calls were not as clear on this as they could be,
but the List that is returned from the getHandlerChain() call is a list
of HandlerInfo objects, not of Handlers themselves, and the registry
does not check for differences until you use the setHandlerChain call.

As a side note, this is simplified in the 2.0 spec.