axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glen Daniels" <>
Subject Re: DebugHeader
Date Fri, 11 May 2001 00:34:15 GMT
Hi Doug:

When I was building the system I didn't really want to get into the issues
involved in making the Handler architecture be the same as the Deserializer
architecture.  So I set it up so that the header content gets parsed into
SOAPHeaders, each of which has the usual info (is it mustUnderstand, actor,
etc..) and an ElementRecorder to hold the XML.  The DebugHeader is an
example of subclassing this to do deserialization on the fly so as not to
keep the SAX events kicking around, but it's still purely data.

You're right that it would be cool to just write a Handler which parses and
processes at the same time, and be done with it.  This would work great for
the "jukebox" case, where you can just call Handlers as you're parsing the
XML.  For the case where you have an explicitly ordered chain of Handlers,
though, you might not want that behavior.  It still might be nice to
deserialize the XML into Java, though, but not actually process it yet.
That's kind of where I was going with the DebugHeader.  I'm not sure if it's
true that in the majority of cases deserialization and processing go hand in

A way to do this might be to define Handlers as Deserializers, but also give
them a process() method which tells them to actually DO whatever it is they
need to do.  So a Handler for a transaction header, for instance, might
catch SAX events and deserialize a transaction-id out of the XML, but it
wouldn't actually call the transaction coordinator to join that transaction
(or mark the header as 'processed', for that matter) until someone called
the process() method.

On another related note, you might want a given Handler to implement an
extension which uses more than one header, so having multiple deserializers
and only one actual Handler might make sense...

I'd like to rip through some use cases for varying ways to look at this
stuff and see if we can come up with a good model that works for all cases.


----- Original Message -----
From: "Doug Davis" <>
To: <>
Sent: Thursday, May 10, 2001 7:20 PM
Subject: DebugHeader

> Glen,
>   Could you explain the purpose of the DebugHeader class?  If I want
> to write code to handle a new header (ie. the debug header) I thought
> I would write a DebugHandler not a DebugHeader - do people really
> need to write both?
> -Dug

View raw message