Changeset 32450


Ignore:
Timestamp:
09/13/18 14:12:34 (2 years ago)
Author:
kjdon
Message:

now storing and passing round gsparams class so that service clusters and services can add params to it if needed

File:
1 edited

Legend:

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

    r31790 r32450  
    2222import java.net.Authenticator;
    2323import java.net.PasswordAuthentication;
     24import java.util.ArrayList;
    2425import java.util.HashMap;
    2526import java.util.Map;
     
    3637import org.greenstone.gsdl3.util.DisplayItemUtil;
    3738import org.greenstone.gsdl3.util.GSFile;
     39import org.greenstone.gsdl3.util.GSParams;
    3840import org.greenstone.gsdl3.util.GSPath;
    3941import org.greenstone.gsdl3.util.GSXML;
     
    100102  protected Element display_item_list = null;
    101103
     104    /** the list of params */
     105    protected GSParams params = null;
     106
    102107  /** a customised class loader so we can find resources in site resources folder*/
    103108  protected CustomClassLoader class_loader = null;
     
    140145    }
    141146
     147    public void setParams(GSParams params)
     148    {
     149        this.params = params;
     150    }
     151 
    142152    /**
    143153     * configures the system
     
    342352        } // for each request
    343353
    344             logger.debug("MR returned response");
    345         logger.debug(XMLConverter.getString(mainResult));
     354        //logger.debug("MR returned response");
     355        //logger.debug(XMLConverter.getString(mainResult));
    346356
    347357        return mainResult;
     
    393403    protected void cleanUpModuleMapSubset(Element list, String remote_site)
    394404    {
    395         logger.error(XMLConverter.getString(list));
     405
    396406        NodeList elements = list.getChildNodes(); // we are assuming no extraneous nodes
    397407        for (int i = elements.getLength() - 1; i >= 0; i--)
     
    418428            }
    419429        }
    420         logger.error(XMLConverter.getString(list));
    421430    }
    422431
     
    542551                catch (ClassNotFoundException ae)
    543552                {
    544                     logger.info(ae.getMessage());
     553                    logger.error(ae.getMessage());
    545554                }
    546555            }
     
    559568                }
    560569
     570                s.addServiceParameters(this.params); // copyign recpt and actions.
    561571                // find out the supported services for this service module
    562572                Element service_response = (Element) s.process(service_message);
     
    616626            sc.setSiteAddress(this.site_http_address);
    617627            sc.setClusterName(name);
     628            sc.setParams(this.params); // pass in params class so SC can add any service ones to it
    618629            sc.setMessageRouter(this);
    619630            if (!sc.configure(cluster))
     
    622633                continue;
    623634            }
    624 
     635           
    625636            this.module_map.put(name, sc); // this replaces the old one if there was one already present
    626637            //add short info to cluster list
     
    721732        c.setSiteHome(this.site_home);
    722733        c.setSiteAddress(this.site_http_address);
     734        c.setParams(this.params); // pass in params class so coll can add any service ones to it
    723735        c.setMessageRouter(this);
    724736        if (c.configure())
Note: See TracChangeset for help on using the changeset viewer.