Example usage for java.util Hashtable remove

List of usage examples for java.util Hashtable remove

Introduction

In this page you can find the example usage for java.util Hashtable remove.

Prototype

public synchronized V remove(Object key) 

Source Link

Document

Removes the key (and its corresponding value) from this hashtable.

Usage

From source file:org.apache.pig.impl.logicalLayer.LOJoin.java

@Override
public Schema getSchema() throws FrontendException {
    List<LogicalOperator> inputs = mPlan.getPredecessors(this);
    mType = DataType.BAG;//mType is from the super class
    Hashtable<String, Integer> nonDuplicates = new Hashtable<String, Integer>();
    if (!mIsSchemaComputed) {
        List<Schema.FieldSchema> fss = new ArrayList<Schema.FieldSchema>();
        mSchemaInputMapping = new ArrayList<LogicalOperator>();
        int i = -1;
        boolean seeUnknown = false;
        for (LogicalOperator op : inputs) {
            try {
                Schema cSchema = op.getSchema();
                if (cSchema != null) {

                    for (FieldSchema schema : cSchema.getFields()) {
                        ++i;/*from  ww w  . ja va2  s .c  om*/
                        FieldSchema newFS = null;
                        if (schema.alias != null) {
                            if (nonDuplicates.containsKey(schema.alias)) {
                                if (nonDuplicates.get(schema.alias) != -1) {
                                    nonDuplicates.remove(schema.alias);
                                    nonDuplicates.put(schema.alias, -1);
                                }
                            } else {
                                nonDuplicates.put(schema.alias, i);
                            }
                            newFS = new FieldSchema(op.getAlias() + "::" + schema.alias, schema.schema,
                                    schema.type);
                        } else {
                            newFS = new Schema.FieldSchema(null, schema.type);
                        }
                        newFS.setParent(schema.canonicalName, op);
                        fss.add(newFS);
                        mSchemaInputMapping.add(op);
                    }
                } else {
                    seeUnknown = true;
                }
            } catch (FrontendException ioe) {
                mIsSchemaComputed = false;
                mSchema = null;
                throw ioe;
            }
        }
        mIsSchemaComputed = true;
        mSchema = null;
        if (!seeUnknown) {
            mSchema = new Schema(fss);
            for (Entry<String, Integer> ent : nonDuplicates.entrySet()) {
                int ind = ent.getValue();
                if (ind == -1)
                    continue;
                FieldSchema prevSch = fss.get(ind);
                // this is a non duplicate and hence can be referred to
                // with just the field schema alias or outeralias::field schema alias
                // In mSchema we have outeralias::fieldschemaalias. To allow
                // using just the field schema alias, add it to mSchemas
                // as an alias for this field.
                mSchema.addAlias(ent.getKey(), prevSch);
            }
        }
    }
    return mSchema;
}

From source file:edu.ku.brc.specify.utilapps.RegisterApp.java

/**
 * @param clsHash//ww w  .  jav a 2 s  .c o m
 */
private void showClassList(final Hashtable<String, Boolean> clsHash) {
    boolean wasVisible = false;
    boolean wasCreated = false;
    if (classFrame == null) {
        CellConstraints cc = new CellConstraints();
        PanelBuilder pb = new PanelBuilder(new FormLayout("f:p:g", "f:p:g"));

        classList = new JList(new DefaultListModel());
        //pb.add(UIHelper.createLabel("Unused Classes"), cc.xy(1,1));
        pb.add(UIHelper.createScrollPane(classList), cc.xy(1, 1));

        pb.setDefaultDialogBorder();

        classFrame = new CustomFrame("Used Classes", CustomFrame.OK_BTN, pb.getPanel());
        classFrame.setOkLabel("Close");
        classFrame.createUI();
        wasCreated = true;

    } else {
        wasVisible = classFrame.isVisible();
    }

    Hashtable<String, Boolean> allClassesHash = new Hashtable<String, Boolean>();
    for (DBTableInfo ti : DBTableIdMgr.getInstance().getTables()) {
        allClassesHash.put(ti.getShortClassName(), true);
    }

    for (String key : clsHash.keySet()) {
        allClassesHash.remove(key);
    }

    ((DefaultListModel) classList.getModel()).clear();
    TreeSet<String> keys = new TreeSet<String>(allClassesHash.keySet());
    for (String key : keys) {
        ((DefaultListModel) classList.getModel()).addElement(key);
    }

    // Can't believe I have to do this
    Rectangle r = classFrame.getBounds();
    r.height++;
    classFrame.setBounds(r);
    r.height--;
    //----
    classFrame.setBounds(r);

    if (wasCreated) {
        classFrame.pack();
    }

    if (!wasVisible) {
        UIHelper.centerAndShow(classFrame);
    }
}

From source file:org.mycore.frontend.editor.MCREditorSubmission.java

private void setRepeatsFromVariables() {
    Hashtable maxtable = new Hashtable();

    for (Object variable : variables) {
        MCREditorVariable var = (MCREditorVariable) variable;
        String[] path = var.getPathElements();
        String prefix = "/" + path[0];

        for (int j = 1; j < path.length; j++) {
            String name = path[j];
            int pos1 = name.lastIndexOf("[");
            int pos2 = name.lastIndexOf("]");

            if (pos1 != -1) {
                String elem = name.substring(0, pos1);
                String num = name.substring(pos1 + 1, pos2);
                String key = prefix + "/" + elem;

                int numNew = Integer.parseInt(num);

                if (maxtable.containsKey(key)) {
                    int numOld = Integer.parseInt((String) maxtable.get(key));
                    maxtable.remove(key);
                    numNew = Math.max(numOld, numNew);
                }/*from   w  w w  .  ja  v a 2 s .  c  om*/

                maxtable.put(key, String.valueOf(numNew));
            }

            prefix = prefix + "/" + name;
        }
    }

    for (Enumeration e = maxtable.keys(); e.hasMoreElements();) {
        String path = (String) e.nextElement();
        String value = (String) maxtable.get(path);

        repeats.add(new MCREditorVariable(path, value));
        LOGGER.debug("Editor repeats " + path + " = " + value);
    }
}

From source file:org.lexevs.system.ResourceManager.java

/**
 * Removes the internal map./*from w  w w. ja  va2 s .  c  o  m*/
 * 
 * @param lcs the lcs
 */
private void removeInternalMap(LocalCodingScheme lcs) {

    Enumeration<String> e = codingSchemeLocalNamesToInternalNameMap_.keys();
    while (e.hasMoreElements()) {
        String key = (String) e.nextElement();
        Hashtable<String, String> temp = codingSchemeLocalNamesToInternalNameMap_.get(key);
        String temp_cs = temp.get(lcs.version);
        if (temp_cs != null && temp_cs.equals(lcs.codingSchemeName)) {
            temp.remove(lcs.version);
            if (temp.size() == 0) {
                codingSchemeLocalNamesToInternalNameMap_.remove(key);
            }
        }

    }

}

From source file:ParseURL.java

/**************************************************************************
 * Parse the given URL into its components.
 * <p>//w ww .j a  va2  s. c om
 * This method parses a munged URL such as:
 *
 *     http://jpw.creare.com:80/RBNB/TestSource?r=newest&t=1.5
 *
 * In this case:
 *     "http" is the protocol
 *     "jpw.creare.com:80/RBNB/TestSource" is the request
 *     "newest" is the reference
 *     "1.5" is the time
 *
 * @author John P. Wilson
 *
 * @param urlStrI      The URL to parse.
 * @param bDebugI      Print debug?
 *
 * @version 09/15/2006
 */

/*
 *
 *   Date      By     Description
 * MM/DD/YYYY
 * ----------  --     -----------
 * 09/15/2006  JPW    Switch over to using KeyValueHash to parse the munge
 * 05/10/2006  JPW    Created
 *
 */

public void parse(String urlStrI, boolean bDebugI) {

    // Reset all member variables
    resetMemberData();

    if ((urlStrI == null) || (urlStrI.trim().equals(""))) {
        if (bDebugI) {
            System.err.println("Unable to parse URL: empty string");
        }
        return;
    }

    url = new String(urlStrI);

    if (bDebugI) {
        System.err.println("URL = \"" + urlStrI + "\"");
    }

    ////////////////////////////////////////////
    // See if a protocol is specified in the URL
    ////////////////////////////////////////////
    int colonIndex = urlStrI.indexOf(':');
    String requestAndMungeStr = urlStrI;
    if (colonIndex >= 0) {
        protocol = urlStrI.substring(0, colonIndex);
        if ((protocol != null) && (protocol.trim().equals(""))) {
            protocol = null;
        }
        if ((protocol != null) && (bDebugI)) {
            System.err.println("Protocol = \"" + protocol + "\"");
        } else if (bDebugI) {
            System.err.println("Protocol = null");
        }
        requestAndMungeStr = urlStrI.substring(colonIndex + 1);
    }

    ////////////////////////////////////////////////
    // Strip off leading '/' from requestAndMungeStr
    ////////////////////////////////////////////////
    while ((requestAndMungeStr != null) && (!requestAndMungeStr.equals(""))
            && (requestAndMungeStr.charAt(0) == '/')) {
        requestAndMungeStr = requestAndMungeStr.substring(1);
    }

    ///////////////////////////////////////////////////////////
    // Separate the request from the munge; munge portion could
    // begin with either '?' or '@'
    ///////////////////////////////////////////////////////////
    request = null;
    munge = null;
    int mungeStartCharIndex = requestAndMungeStr.indexOf('@');
    if (mungeStartCharIndex < 0) {
        mungeStartCharIndex = requestAndMungeStr.indexOf('?');
    }
    if (mungeStartCharIndex >= 0) {
        request = requestAndMungeStr.substring(0, mungeStartCharIndex);
        if ((request != null) && (request.trim().equals(""))) {
            request = null;
        }
        munge = requestAndMungeStr.substring(mungeStartCharIndex + 1);
        if ((munge != null) && (munge.trim().equals(""))) {
            munge = null;
        }
    } else { //EMF 5/11/06: no munge, all request
        request = requestAndMungeStr;
        munge = null;
    }
    if (bDebugI) {
        if (request == null) {
            System.err.println("Request = null");
        } else {
            System.err.println("Request = \"" + request + "\"");
        }
        if (munge == null) {
            System.err.println("Munge = null");
        } else {
            System.err.println("Munge = \"" + munge + "\"");
        }
    }

    //////////////////////////
    // Parse the munge options
    //////////////////////////
    if (munge == null) {
        // We're all done
        return;
    }
    // JPW 09/15/2006: Use KeyValueHash to parse the munge
    char[] terminatorChars = { '&' };
    KeyValueHash kvh = new KeyValueHash(munge, terminatorChars);
    Hashtable fullHashtable = kvh.getHash();
    if (kvh.get("time") != null) {
        // Store time as a Double object
        try {
            time = new Double(kvh.get("time"));
            if (bDebugI) {
                System.err.println("time = " + time);
            }
            hasRBNBMunge = true;
        } catch (NumberFormatException e) {
            // Nothing to do
            time = null;
        }
        // Remove this entry from the hashtable
        fullHashtable.remove("time");
    }
    if (kvh.get("t") != null) {
        // Store time as a Double object
        try {
            time = new Double(kvh.get("t"));
            if (bDebugI) {
                System.err.println("time = " + time);
            }
            hasRBNBMunge = true;
        } catch (NumberFormatException e) {
            // Nothing to do
            time = null;
        }
        // Remove this entry from the hashtable
        fullHashtable.remove("t");
    }
    if (kvh.get("duration") != null) {
        // Store duration as a Double object
        try {
            duration = new Double(kvh.get("duration"));
            if (bDebugI) {
                System.err.println("duration = " + duration);
            }
            hasRBNBMunge = true;
        } catch (NumberFormatException e) {
            // Nothing to do
            duration = null;
        }
        // Remove this entry from the hashtable
        fullHashtable.remove("duration");
    }
    if (kvh.get("d") != null) {
        // Store duration as a Double object
        try {
            duration = new Double(kvh.get("d"));
            if (bDebugI) {
                System.err.println("duration = " + duration);
            }
            hasRBNBMunge = true;
        } catch (NumberFormatException e) {
            // Nothing to do
            duration = null;
        }
        // Remove this entry from the hashtable
        fullHashtable.remove("d");
    }
    if (kvh.get("reference") != null) {
        reference = kvh.get("reference");
        if (bDebugI) {
            System.err.println("reference = " + reference);
        }
        hasRBNBMunge = true;
        // Remove this entry from the hashtable
        fullHashtable.remove("reference");
    }
    if (kvh.get("r") != null) {
        reference = kvh.get("r");
        if (bDebugI) {
            System.err.println("reference = " + reference);
        }
        hasRBNBMunge = true;
        // Remove this entry from the hashtable
        fullHashtable.remove("r");
    }
    if (kvh.get("fetch") != null) {
        fetch = kvh.get("fetch");
        if (bDebugI) {
            System.err.println("fetch = " + fetch);
        }
        hasRBNBMunge = true;
        // Remove this entry from the hashtable
        fullHashtable.remove("fetch");
    }
    if (kvh.get("f") != null) {
        fetch = kvh.get("f");
        if (bDebugI) {
            System.err.println("fetch = " + fetch);
        }
        hasRBNBMunge = true;
        // Remove this entry from the hashtable
        fullHashtable.remove("f");
    }
    if (kvh.get("byteorder") != null) {
        byteorder = kvh.get("byteorder");
        if (bDebugI) {
            System.err.println("byteorder = " + byteorder);
        }
        hasRBNBMunge = true;
        // Remove this entry from the hashtable
        fullHashtable.remove("byteorder");
    }
    if (kvh.get("bo") != null) {
        byteorder = kvh.get("bo");
        if (bDebugI) {
            System.err.println("byteorder = " + byteorder);
        }
        hasRBNBMunge = true;
        // Remove this entry from the hashtable
        fullHashtable.remove("bo");
    }
    if (kvh.get("datatype") != null) {
        datatype = kvh.get("datatype");
        if (bDebugI) {
            System.err.println("datatype = " + datatype);
        }
        hasRBNBMunge = true;
        // Remove this entry from the hashtable
        fullHashtable.remove("datatype");
    }
    if (kvh.get("dt") != null) {
        datatype = kvh.get("dt");
        if (bDebugI) {
            System.err.println("datatype = " + datatype);
        }
        hasRBNBMunge = true;
        // Remove this entry from the hashtable
        fullHashtable.remove("dt");
    }
    if (kvh.get("mux") != null) {
        // Store mux as an Integer object
        try {
            mux = new Integer(kvh.get("mux"));
            if (bDebugI) {
                System.err.println("mux = " + mux);
            }
            hasRBNBMunge = true;
        } catch (NumberFormatException e) {
            // Nothing to do
            mux = null;
        }
        // Remove this entry from the hashtable
        fullHashtable.remove("mux");
    }
    if (kvh.get("x") != null) {
        // Store mux as an Integer object
        try {
            mux = new Integer(kvh.get("x"));
            if (bDebugI) {
                System.err.println("mux = " + mux);
            }
            hasRBNBMunge = true;
        } catch (NumberFormatException e) {
            // Nothing to do
            mux = null;
        }
        // Remove this entry from the hashtable
        fullHashtable.remove("x");
    }
    if (kvh.get("blocksize") != null) {
        // Store blocksize as an Integer object
        try {
            blocksize = new Integer(kvh.get("blocksize"));
            if (bDebugI) {
                System.err.println("blocksize = " + blocksize);
            }
            hasRBNBMunge = true;
        } catch (NumberFormatException e) {
            // Nothing to do
            blocksize = null;
        }
        // Remove this entry from the hashtable
        fullHashtable.remove("blocksize");
    }
    if (kvh.get("bs") != null) {
        // Store blocksize as an Integer object
        try {
            blocksize = new Integer(kvh.get("bs"));
            if (bDebugI) {
                System.err.println("blocksize = " + blocksize);
            }
            hasRBNBMunge = true;
        } catch (NumberFormatException e) {
            // Nothing to do
            blocksize = null;
        }
        // Remove this entry from the hashtable
        fullHashtable.remove("bs");
    }
    if (kvh.get("mime") != null) {
        mime = kvh.get("mime");
        if (bDebugI) {
            System.err.println("mime = " + mime);
        }
        hasRBNBMunge = true;
        // Remove this entry from the hashtable
        fullHashtable.remove("mime");
    }
    if (kvh.get("m") != null) {
        mime = kvh.get("m");
        if (bDebugI) {
            System.err.println("mime = " + mime);
        }
        hasRBNBMunge = true;
        // Remove this entry from the hashtable
        fullHashtable.remove("m");
    }

    // What remains in fullHashtable must be the non-RBNB munges
    if ((fullHashtable != null) && (!fullHashtable.isEmpty())) {
        nonRBNBMunge = fullHashtable;
        if (bDebugI) {
            for (Enumeration e = nonRBNBMunge.keys(); e.hasMoreElements();) {
                String key = (String) e.nextElement();
                String value = (String) nonRBNBMunge.get(key);
                System.err.println("Non-RBNB munge: key = \"" + key + "\", value = \"" + value + "\"");
            }
        }
    }

}

From source file:net.daimonin.client3d.editor.main.Editor3D.java

/**
* Builds image groups/categories by file name, creates and writes the XML
* containing all images with their attributes.
* 
* @param fileNameImageSet Name of resulting PNG.
* @param fileNameXML Name of the XML./*from  w  w w.j  av  a  2 s  . c o  m*/
* @throws IOException IOException.
*/
private static void writeXML(final String fileNameImageSet, final String fileNameXML) throws IOException {

    // group ImageSetImages by name/category.
    // the left side of the image file name up to the '_' is taken as the
    // category
    Hashtable<String, List<ImageSetImage>> names = new Hashtable<String, List<ImageSetImage>>();
    for (int i = 0; i < images.size(); i++) {
        if (!names.containsKey(images.get(i).getName())) {
            List<ImageSetImage> values = new ArrayList<ImageSetImage>();
            values.add(images.get(i));
            names.put(images.get(i).getName(), values);
        } else {
            names.get(images.get(i).getName()).add(images.get(i));
        }
    }

    // check if every category has a default state (except FontExtensions)
    Enumeration<String> keys2 = names.keys();
    while (keys2.hasMoreElements()) {
        List<ImageSetImage> img2 = names.get(keys2.nextElement());
        if (!"fontextensions".equals(img2.get(0).getName())) {
            boolean hasDefault = false;
            for (int i = 0; i < img2.size(); i++) {
                if ("default".equals(img2.get(i).getState().toLowerCase())) {
                    hasDefault = true;
                }
            }
            if (!hasDefault) {
                printError("WARNING: image category '" + img2.get(0).getName()
                        + "' has no image with a default state!");
            }
        }
    }

    // create the XML structure
    Document document = DocumentHelper.createDocument();
    Element root = document.addElement("ImageSet").addAttribute("file", fileNameImageSet);

    List<ImageSetImage> fntex = names.get("fontextensions");
    if (fntex != null) {
        Element category = root.addElement("ImageFntExt").addAttribute("name", fntex.get(0).getName());
        for (int i = 0; i < fntex.size(); i++) {
            category.addElement("State").addAttribute("name", fntex.get(i).getState())
                    .addAttribute("posX", String.valueOf(fntex.get(i).getPosX() + fntex.get(i).getBorderSize()))
                    .addAttribute("posY", String.valueOf(fntex.get(i).getPosY() + fntex.get(i).getBorderSize()))
                    .addAttribute("width", String.valueOf(fntex.get(i).getWidth()))
                    .addAttribute("height", String.valueOf(fntex.get(i).getHeight()));
        }
        names.remove("fontextensions");
    }

    List<ImageSetImage> mouse = names.get("mousecursor");
    if (mouse != null) {
        Element category = root.addElement("Image").addAttribute("name", mouse.get(0).getName())
                .addAttribute("width", String.valueOf(mouse.get(0).getImage().getWidth()))
                .addAttribute("height", String.valueOf(mouse.get(0).getImage().getHeight()))
                .addAttribute("alpha", mouse.get(0).getImage().getColorModel().hasAlpha() ? String.valueOf(1)
                        : String.valueOf(0));

        for (int i = 0; i < mouse.size(); i++) {
            checkImageSameDimension(mouse.get(0), mouse.get(i),
                    "Images of same category have different dimension");
            checkImageSameAlpha(mouse.get(0), mouse.get(i), "Images of same category have different alpha");
            category.addElement("State").addAttribute("name", mouse.get(i).getState())
                    .addAttribute("posX", String.valueOf(mouse.get(i).getPosX() + mouse.get(i).getBorderSize()))
                    .addAttribute("posY",
                            String.valueOf(mouse.get(i).getPosY() + mouse.get(i).getBorderSize()));
        }
        names.remove("mousecursor");
    }

    Enumeration<String> keys = names.keys();
    while (keys.hasMoreElements()) {
        List<ImageSetImage> img = names.get(keys.nextElement());
        Element category = root.addElement("Image").addAttribute("name", img.get(0).getName())
                .addAttribute("width", String.valueOf(img.get(0).getImage().getWidth()))
                .addAttribute("height", String.valueOf(img.get(0).getImage().getHeight()))
                .addAttribute("alpha", img.get(0).getImage().getColorModel().hasAlpha() ? String.valueOf(1)
                        : String.valueOf(0));

        for (int i = 0; i < img.size(); i++) {
            checkImageSameDimension(img.get(0), img.get(i), "Images of same category have different dimension");
            checkImageSameAlpha(img.get(0), img.get(i), "Images of same category have different alpha");
            category.addElement("State").addAttribute("name", img.get(i).getState())
                    .addAttribute("posX", String.valueOf(img.get(i).getPosX() + img.get(i).getBorderSize()))
                    .addAttribute("posY", String.valueOf(img.get(i).getPosY() + img.get(i).getBorderSize()));
        }
    }

    // write the XML
    OutputFormat format = OutputFormat.createPrettyPrint();
    XMLWriter writer = new XMLWriter(new FileWriter(fileNameXML), format);
    writer.write(document);
    writer.close();
    printInfo(System.getProperty("user.dir") + "/" + imagesetxml + " created");
}

From source file:com.web.services.ExecutorServicesConstruct.java

/**
 * This method removes the configuration of the War file
 * @param servicesMap//from w ww  .ja  v  a  2 s .c  o m
 * @param exectorServicesXml
 * @param customClassLoader
 * @throws Exception
 */
public void removeExecutorServices(Hashtable servicesMap, File exectorServicesXml,
        WebClassLoader customClassLoader) throws Exception {
    DigesterLoader serverdigesterLoader = DigesterLoader.newLoader(new FromXmlRulesModule() {

        protected void loadRules() {
            // TODO Auto-generated method stub
            try {
                loadXMLRules(new InputSource(new FileInputStream("./config/executorservices-config.xml")));
            } catch (FileNotFoundException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

        }
    });
    Digester serverdigester = serverdigesterLoader.newDigester();
    ExecutorServices executorServices = (ExecutorServices) serverdigester
            .parse(new InputSource(new FileInputStream(exectorServicesXml)));
    CopyOnWriteArrayList<ExecutorService> executorServicesList = executorServices.getExecutorServices();
    ExecutorServiceAnnot executorServiceAnnot;
    for (ExecutorService executorService : executorServicesList) {
        Class executorServiceClass = customClassLoader
                .loadClass(executorService.getExecutorserviceclass().toString());
        //System.out.println("executor class in ExecutorServicesConstruct"+executorServiceClass);
        //System.out.println();
        Method[] methods = executorServiceClass.getDeclaredMethods();
        for (Method method : methods) {
            Annotation[] annotations = method.getDeclaredAnnotations();
            for (Annotation annotation : annotations) {
                if (annotation instanceof ExecutorServiceAnnot) {
                    executorServiceAnnot = (ExecutorServiceAnnot) annotation;
                    //if(servicesMap.get(executorServiceAnnot.servicename())==null)throw new Exception();
                    servicesMap.remove(executorServiceAnnot.servicename());
                }
            }
        }
    }
}

From source file:com.app.services.ExecutorServicesConstruct.java

/**
 * This method removes the configuration of the War file
 * @param servicesMap/*  w  ww  . jav a 2s. c o  m*/
 * @param exectorServicesXml
 * @param customClassLoader
 * @throws Exception
 */
public void removeExecutorServices(Hashtable servicesMap, File exectorServicesXml,
        WebClassLoader customClassLoader) throws Exception {
    DigesterLoader serverdigesterLoader = DigesterLoader.newLoader(new FromXmlRulesModule() {

        protected void loadRules() {
            // TODO Auto-generated method stub
            try {
                loadXMLRules(new InputSource(new FileInputStream("./config/executorservices-config.xml")));
            } catch (Exception e) {
                log.error("Could not able to load xml rules ./config/executorservices-config.xml", e);
                // TODO Auto-generated catch block
                //e.printStackTrace();
            }

        }
    });
    Digester serverdigester = serverdigesterLoader.newDigester();
    ExecutorServices executorServices = (ExecutorServices) serverdigester
            .parse(new InputSource(new FileInputStream(exectorServicesXml)));
    CopyOnWriteArrayList<ExecutorService> executorServicesList = executorServices.getExecutorServices();
    ExecutorServiceAnnot executorServiceAnnot;
    for (ExecutorService executorService : executorServicesList) {
        Class executorServiceClass = customClassLoader
                .loadClass(executorService.getExecutorserviceclass().toString());
        //log.info("executor class in ExecutorServicesConstruct"+executorServiceClass);
        //log.info();
        Method[] methods = executorServiceClass.getDeclaredMethods();
        for (Method method : methods) {
            Annotation[] annotations = method.getDeclaredAnnotations();
            for (Annotation annotation : annotations) {
                if (annotation instanceof ExecutorServiceAnnot) {
                    executorServiceAnnot = (ExecutorServiceAnnot) annotation;
                    //if(servicesMap.get(executorServiceAnnot.servicename())==null)throw new Exception();
                    servicesMap.remove(executorServiceAnnot.servicename());
                }
            }
        }
    }
}

From source file:net.ustyugov.jtalk.service.JTalkService.java

public void removeMessagesCount(String account, String jid) {
    if (messagesCount.containsKey(account)) {
        Hashtable<String, Integer> hash = messagesCount.get(account);
        if (hash.containsKey(jid))
            hash.remove(jid);
    }//from ww w.j av a  2 s.co  m
    //       updateWidget();
}

From source file:org.openbravo.erpCommon.utility.ComboTableData.java

public Map<String, String> fillSQLParametersIntoMap(ConnectionProvider conn, VariablesSecureApp vars,
        FieldProvider data, String window, String actual_value) throws ServletException {
    final Vector<String> vAux = getParameters();
    Hashtable<String, String> lparameters = new Hashtable<String, String>();
    // We first add all current parameters in the combo
    for (String key : parameters.keySet()) {
        lparameters.put(key, parameters.get(key));
    }/*w  w w . j av  a2s .  c o m*/
    if (vAux != null && vAux.size() > 0) {
        if (log4j.isDebugEnabled())
            log4j.debug("Combo Parameters: " + vAux.size());
        for (int i = 0; i < vAux.size(); i++) {
            final String strAux = vAux.elementAt(i);
            try {
                final String value = Utility.parseParameterValue(conn, vars, data, strAux, "", window,
                        actual_value, false);
                if (log4j.isDebugEnabled())
                    log4j.debug("Combo Parameter: " + strAux + " - Value: " + value);
                if (value == null || value.equals("") || "null".equals(value))
                    lparameters.remove(strAux.toUpperCase());
                else
                    lparameters.put(strAux.toUpperCase(), value);
            } catch (final Exception ex) {
                throw new ServletException(ex);
            }
        }
    }
    return lparameters;

}