Changeset 4000


Ignore:
Timestamp:
2003-03-26T12:15:39+12:00 (21 years ago)
Author:
kjdon
Message:

now sets site address for colls and services - address obtained from site config file

File:
1 edited

Legend:

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

    r3971 r4000  
    6161    /** site home - the home directory for the site */
    6262    protected String site_home_=null;
     63    /** the http address for this site */
     64    protected String site_http_address_=null;
     65   
    6366    /** the global name for this site */
    6467    protected String global_site_name_=null;
     
    188191    public Element process(Element message) {
    189192
     193    //System.out.println("MR received request");
     194    //System.out.println(converter_.getString(message));
     195               
    190196    // check that its a correct message tag
    191197    if (!message.getTagName().equals(GSXML.MESSAGE_ELEM)) {
     
    238244    } // for each request
    239245   
     246    //System.out.println("MR returned response");
     247    //System.out.println(converter_.getString(mainResult));
     248
    240249    return mainResult;
    241250   
     
    263272    } else {
    264273        global_site_name_ = local_site_name.getAttribute(GSXML.VALUE_ATT);
     274    }
     275   
     276    Element http_address = (Element)GSXML.getChildByTagName(config,
     277                        GSXML.SITE_HTTP_ADDRESS_ELEM);
     278    if (http_address == null) {
     279        System.err.println("MessageRouter configure error: no http address  in config file");
     280        return false;
     281    } else {
     282        site_http_address_ = http_address.getAttribute(GSXML.VALUE_ATT);
    265283    }
    266284   
     
    284302            ServiceCluster sc = new ServiceCluster();
    285303            sc.setSiteHome(site_home_);
     304            sc.setSiteAddress(site_http_address_);
    286305            sc.setClusterName(name);
    287306            sc.setMessageRouter(this);
     
    324343                ServiceRack s = (ServiceRack)Class.forName("org.greenstone.gsdl3.service."+service_name).newInstance();
    325344                s.setSiteHome(site_home_);
     345                s.setSiteAddress(site_http_address_);
    326346                s.setMessageRouter(this);
    327347               
     
    478498    c.setCollectionName(col_name);
    479499    c.setSiteHome(site_home_);
     500    c.setSiteAddress(site_http_address_);
    480501    if (c.configure()) {
    481502        // this could be a reactivation, so delete the old version
Note: See TracChangeset for help on using the changeset viewer.