axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Takahide Nogayama <>
Subject Re: Request for XML Filter (AXIS2-1085)
Date Mon, 20 Nov 2006 13:08:15 GMT
Look back at original solution, Filter configuration , filter is 
enabled/disabled, is written in axis2.xml and stored in 
At transport layer compornent, Filter configuration is read and filter 
instance is created, if it is enabled. MessageContext and XMLStreamReader
are passed to the filter, and XMLStreamReader is replaced by the filter. 
Then, StAXOMBuilder is created from the filter. 

Original solution solves an issue of Handler solution "need to change 
StAXBuilder." In Handler solution, filter is inserted after builder is 
So StAXBuilder is needed to change to replace XMLStreamReader, In original 
solution, filter is inserted before builder is created. filter is passed 
to StAXBuilder constructor instead of XMLStreamReader. We can avoid to add 
setParser(XMLStreamReader) method to StAXBuilder. And original
 solution solves an issue of XMLInputFactory solution, MessageContext is 
passed to filter explicitly by using input parameter. It is easy to 
and keeps consistency because there is no use of static reference or 
Thread Local strage. I believe this origianal solution is most reasnable 
if we introduce
filter framework.

The following is code snippet of transport layer compornent.
    // replace xmlreader by filter if filter is enabled.
    xmlreader = 

    builder = new StAXSOAPModelBuilder(xmlreader, 
    envelope = (SOAPEnvelope) builder.getDocumentElement();

The points of original solution are
    - Pass MessageContext to filter at transport layer components 
explicitly. (write the passing code on each transport layer components)
    - Insert filter at transport layer components explicitly. (write 
inserting code on each transport layer components)
    - Filter configuration is stored in axis2.xml

    - Filter can see all StAXEvents of the message. Because filter is 
inserted before OM tree is built.
    - It is easy to understand about passing MessageContext. because it is 
passed explicitly as an input parameter to filter.
    - We can avoid to change StAXBuilder (add setParser(XMLStreamReader) 
method to StAXBuilder).

    - There is layer mixing. (User can do QOS related processing in 
parsing layer.)
    - Need to change AXIS2 transport layer components.


Takahide Nogayama
View raw message