Ignore:
Timestamp:
2012-05-22T13:01:04+12:00 (12 years ago)
Author:
sjm84
Message:

Fixing Greenstone 3's use (or lack thereof) of generics, this was done automatically so we may want to change it over time. This change will also auto-format any files that have not already been formatted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/ServiceCluster.java

    r24993 r25635  
    3232
    3333import java.io.*;
    34 import java.io.File;
    35 import java.io.RandomAccessFile;
    3634import java.util.HashMap;
    3735import java.util.Iterator;
     
    7674     *
    7775     */
    78     protected HashMap service_map = null;
     76    protected HashMap<String, ServiceRack> service_map = null;
    7977    /**
    8078     * maps pseudo service names to real service names - needed if we have two
    8179     * services with the same name for one collection
    8280     */
    83     protected HashMap service_name_map = null;
     81    protected HashMap<String, String> service_name_map = null;
    8482
    8583    /** XML converter for String to DOM and vice versa */
     
    113111    public void cleanUp()
    114112    {
    115         Iterator i = this.service_map.values().iterator();
     113        Iterator<ServiceRack> i = this.service_map.values().iterator();
    116114        while (i.hasNext())
    117115        {
    118             ServiceRack s = (ServiceRack) i.next();
     116            ServiceRack s = i.next();
    119117            s.cleanUp();
    120118        }
     
    134132    public ServiceCluster()
    135133    {
    136         this.service_map = new HashMap();
    137         this.service_name_map = new HashMap();
     134        this.service_map = new HashMap<String, ServiceRack>();
     135        this.service_name_map = new HashMap<String, String>();
    138136        this.converter = new XMLConverter();
    139137        this.doc = this.converter.newDOM();
     
    491489                if (this.service_name_map.containsKey(service))
    492490                {
    493                     real_service = (String) this.service_name_map.get(service);
     491                    real_service = this.service_name_map.get(service);
    494492                    // need to change the to att in the request - give the real service name
    495493                    to = request.getAttribute(GSXML.TO_ATT);
     
    501499                Element single_message = mess_doc.createElement(GSXML.MESSAGE_ELEM);
    502500                single_message.appendChild(request);
    503                 Node response_message = ((ModuleInterface) this.service_map.get(service)).process(single_message);
     501                Node response_message = this.service_map.get(service).process(single_message);
    504502                if (response_message != null)
    505503                {
     
    884882    }
    885883
    886     public HashMap getServiceMap()
     884    public HashMap<String, ServiceRack> getServiceMap()
    887885    {
    888886        return service_map;
Note: See TracChangeset for help on using the changeset viewer.