You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Eran Chinthaka <ch...@opensource.lk> on 2004/11/12 11:45:43 UTC

[Axis2] - OM interfaces

 

I would like to propose some ideas for OM interfaces, and most of these will
be soon in both Table and LinkedList models.

 

OM Interfaces

 

OM interfaces will look like follows to improve maximum flexibility for OM.

 


	
		 
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Interface 1 : This is the interface OMXMLBuilder expects from tStAX parser.
This will be basically the tStAX interface.

 

Interface 2 : This will be how the OM model will interact with OMXMLBuilder.
This interface will contain

*        + proceed() : void -->  this will advance the parser, one step
further, through the OMXMLBuilder. 

*        + detach(OMNode) : void --> this will remove the given OMNode from
OM. 

Eg : <a>

                  <b>

                              <c>

                              .......

                  </b>

      </a>

 

If the parser has proceed only upto element b and now if one asks to detach
b, parser can simply move forward, without creating anything, till the end
of element b. 

 

Interface 3 : This wil be the external users of OM (Like engine, handlers,
etc.,) will be using to access the SOAPMessage. This can be either IN
message or OUT message. Parties, external to OM will only see the
SOAPMessage *only* through this API. 

 

Interface 4 : This Navigator interface will be helpful to generate Pull
events from OM. Every OMElement has a method to get its Navigator interface,
and through that one can get pull events. 

            + getNavigator() : OMNavigator

 

 

 

Factory in OM 

 

            There will be a abstract factory class for OM, where all the
OMNode creations will have to be done through this. This will help to switch
between OM implementations.

Eg :  

Abstract class method : 

 

public abstract OMElement createOMElement(String localName, OMNamespace ns);

 

Concrete Class method :

 

public OMElement createOMElement(String localName, OMNamespace ns) {

        return new OMElementImpl(localName, ns);

}

 

Switching from one OM implementation to another is simply to replace this
factory class. 

 

The same Factory class has a method to create a SOAPMessage out of a tStAX
interface.            

            + createSOAPMessage(TStAXParser) : SOAPMessage

 

This will be the method called by the engine when it receives a message. 

 

Engine upon receive :

 

     TStAXParser parser = new TStAXParser(inputStream);

SOAPMessage message = Factory.createSOAPMessage(parser);

       MessageContext mctx = new MessageContex();

       Mctx.setMessage(message);

 

  _____  

Eran Chinthaka

Lanka Software Foundation