Ignore:
Timestamp:
2014-04-10T14:39:33+12:00 (10 years ago)
Author:
kjdon
Message:

Lots of changes. Mainly to do with removing this.doc from everywhere. Document is not thread safe. Now we tend to create a new Document everytime we are starting a new page/message etc. in service this.desc_doc is available as teh document to create service info stuff. But it should only be used for this and not for other messages. newDOM is now static for XMLConverter. method param changes for some GSXML methods.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/Receptionist.java

    r28248 r28966  
    3333    protected HashMap<String, Object> config_params = null;
    3434    /** container Document to create XML Nodes */
    35     protected Document doc = null;
     35    //protected Document doc = null;
    3636
    3737    /** a converter class to parse XML and create Docs */
     
    5454    {
    5555        this.converter = new XMLConverter();
    56         this.doc = this.converter.newDOM();
     56        //this.doc = XMLConverter.newDOM();
    5757        this.action_map = new HashMap<String, Action>();
    5858    }
     
    182182    public Node process(Node message_node)
    183183    {
    184         Element message = this.converter.nodeToElement(message_node);
     184        Element message = GSXML.nodeToElement(message_node);
    185185
    186186        // get the request out of the message - assume that there is only one
     
    242242        preProcessRequest(request);
    243243        // set up the page
    244         Element page = this.doc.createElement(GSXML.PAGE_ELEM);
     244        Document doc = XMLConverter.newDOM();
     245        Element page = doc.createElement(GSXML.PAGE_ELEM);
    245246        page.setAttribute(GSXML.LANG_ATT, request.getAttribute(GSXML.LANG_ATT));
    246247        // just in case these namespaces end up in the page and we want to display the XML
     
    273274
    274275        // the request is part of the page
    275         page.appendChild(GSXML.duplicateWithNewName(this.doc, request, GSXML.PAGE_REQUEST_ELEM, true));
     276        page.appendChild(GSXML.duplicateWithNewName(doc, request, GSXML.PAGE_REQUEST_ELEM, true));
    276277        // add the response too
    277         Element page_response = GSXML.duplicateWithNewName(this.doc, (Element) GSXML.getChildByTagName(action_response, GSXML.RESPONSE_ELEM), GSXML.PAGE_RESPONSE_ELEM, true);
     278        Element page_response = GSXML.duplicateWithNewName(doc, (Element) GSXML.getChildByTagName(action_response, GSXML.RESPONSE_ELEM), GSXML.PAGE_RESPONSE_ELEM, true);
    278279        page.appendChild(page_response);
    279280
Note: See TracChangeset for help on using the changeset viewer.