Package java.util

Examples of java.util.Hashtable


  /**
   *
   * @exception  IOException
   */
  public Hashtable soapCode() throws IOException {
    Hashtable h = new Hashtable();
    h.put("classname", getClass().getName());

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    writeTo(baos);
    baos.flush();
    h.put("bytecontent", baos.toByteArray());
    baos.close();

    return h;
  }
View Full Code Here


   *
   * @param location  the location key
   * @param cf     the ConnectionFactory
   */
  public void addConnectionFactory(String location, ConnectionFactory cf) {
    if (cluster == null) cluster = new Hashtable();

    if (location == null)
      location = cf.getParameters().getHost();
    cluster.put(location, cf);
  }
View Full Code Here

        ConnectionFactory cf = (ConnectionFactory) clazz.newInstance();
        strbuf.setLength(0);
        strbuf.append("CF#").append(i);
        cf.fromReference(ref, strbuf.toString());

        if (cluster == null) cluster = new Hashtable();
        cluster.put(key, cf);
      } catch (Exception exc) {
        if (logger.isLoggable(BasicLevel.ERROR))
          logger.log(BasicLevel.ERROR, "", exc);
      }
View Full Code Here

  /**
   * Codes a <code>ConnectionFactory</code> as a Hashtable for travelling
   * through the SOAP protocol.
   */
  public Hashtable code() {
    Hashtable h = new Hashtable();

    if (cluster == null) return h;
    Map.Entry entries[] = new Map.Entry [cluster.size()];
    cluster.entrySet().toArray(entries);

    StringBuffer strbuf = new StringBuffer(15);
    for (int i=0; i<entries.length; i++) {
      strbuf.setLength(0);
      strbuf.append("CF#").append(i).append(".key");
      h.put(strbuf.toString(), entries[i].getKey());

      ConnectionFactory cf = (ConnectionFactory) entries[i].getValue();

      strbuf.setLength(0);
      strbuf.append("CF#").append(i).append(".class");
      h.put(strbuf.toString(), cf.getClass().getName());

      strbuf.setLength(0);
      strbuf.append("CF#").append(i);
      cf.code(h, strbuf.toString());
    }
View Full Code Here

   * <p>
   * Actual implementation of the method is located in the
   * tcp and soap sub classes.
   */
  public void decode(Hashtable h) {
    if (cluster == null) cluster = new Hashtable();

    int i = 0;
    StringBuffer strbuf = new StringBuffer(15);

    while (true) {
View Full Code Here

    super.readFrom(is);  
    int size = StreamUtil.readIntFrom(is);
    if (size == -1) {
      users = null;
    } else {
      users = new Hashtable(size*4/3);
      for (int i=0; i< size; i++) {
        String key = StreamUtil.readStringFrom(is);
        String value = StreamUtil.readStringFrom(is);
        users.put(key, value);
      }
View Full Code Here

  public Serve(Map arguments, PrintStream logStream) {
    this.arguments = arguments;
    this.logStream = logStream;
    defaultRegistry = new PathTreeDictionary();
    realms = new PathTreeDictionary();
    attributes = new Hashtable();
    serverThreads = new ThreadGroup("TJWS threads");
    Properties props = new Properties();
    props.putAll(arguments);
    // TODO do not create thread pool unless requested
    threadPool = new Utils.ThreadPool(props, new Utils.ThreadFactory() {
View Full Code Here

                outname = fileName + ".jpg";
            }
            RenderedOp img = JAI.create("fileload", fileName);
            ColorModel cm = img.getColorModel();
            WritableRaster imgRaster = img.copyData();
            BufferedImage bi = new BufferedImage(cm, imgRaster, false, new Hashtable());
            ImageIO.write((RenderedImage) bi, "jpg", new File(outname));
            System.out.println("...done, " + outname);
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

  }

  void init() throws Exception {
    // Before any agent may be used, the environment, including the hash table,
    // must be initialized.
    agents = new Hashtable();
    try {
      // Creates or initializes AgentFactory, then loads and initializes
      // all fixed agents.
      fixedAgentIdList = (Vector) AgentServer.getTransaction().load(getName() + ".fixed");
      if (fixedAgentIdList == null) {
View Full Code Here

        {
          HashMap row = (HashMap)it.next();
          String AlertType = (String)row.get("alerttype");
          if (AlertType.equals("ALERT"))
          {
            Hashtable ht = convertHashMapToHashtable(row);
            alertsList.add(ht);
          }
        }
      }
    }catch (Exception e){
View Full Code Here

TOP

Related Classes of java.util.Hashtable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.