Package java.util

Examples of java.util.Hashtable


      }
    }

    NamingContextInfo[] contexts = not.getContexts();

    Hashtable  record_compositeName= new Hashtable();
    Hashtable  composite_context= new Hashtable();
    if (contexts != null) {
      Vector newNames = new Vector();
      for (int i = 0; i < contexts.length; i++) {
        if(!looseCoupling) {
          NamingContext nc = getServerImpl().getNamingContext(
                                                              contexts[i].getNamingContext().getId());
          if (nc == null) {
            getServerImpl().addNamingContext(contexts[i]);
            newNames.addElement(contexts[i].getCompositeName());
          }
          // Else the naming context has already been
          // added by an other server that is the (new)
          // owner of this context.

        } else {
          NamingContext nc;
          try{
            nc = getServerImpl().getNamingContext(contexts[i].getCompositeName());
          }catch(MissingRecordException mre){
            nc=null;
          }catch( MissingContextException mce){
            nc=null;
          }
          if(nc == null){
            nc = getServerImpl().newNamingContext( getId(),null,contexts[i].getCompositeName());
            contexts[i].getNamingContext().setOwnerId(getId());
          }

          Enumeration enumRecord = contexts[i].getNamingContext().getEnumRecord();
          while (enumRecord.hasMoreElements()) {         
            Record record =(RecordenumRecord.nextElement();
            Record r = nc.getRecord(record.getName());
            if (r == null
              nc.addRecord(record);
            if(record instanceof ContextRecord){
              CompositeName parentPath = contexts[i].getCompositeName();
              record_compositeName.put(record,parentPath);
            }
          }
          composite_context.put(contexts[i].getCompositeName(),nc);
        }
      }
      if(looseCoupling){
        Enumeration enumKeyRecord = record_compositeName.keys();
        while(enumKeyRecord.hasMoreElements()) {
          Record recor =(Record)enumKeyRecord.nextElement();
          CompositeName cn =(CompositeName)((CompositeName)(record_compositeName.get(recor))).clone();
          cn.add(recor.getName());
          if(composite_context.containsKey(cn)){
            NamingContext nc  =(NamingContext)composite_context.get(cn);
            ((ContextRecord)recor).setId(nc.getId());
          }       
        }
        Enumeration enumContext = composite_context.elements();
        while(enumContext.hasMoreElements()) {
          NamingContext nc  =(NamingContext)enumContext.nextElement();
          getServerImpl().storeNamingContext(nc);
        }
      }
View Full Code Here


    }

    // Load the context index
    nameToIdIndex = (Hashtable)transaction.load(CTX_INDEX);
    if (nameToIdIndex == null) {
      nameToIdIndex = new Hashtable();
    }
  }
View Full Code Here

    else
      return longfmt.format(date);
  }

  public static Hashtable parseQueryString(String query, String encoding) {
    Hashtable result = new Hashtable();
    if (encoding == null)
      encoding = "UTF-8";
    StringTokenizer st = new StringTokenizer(query, "&");
    while (st.hasMoreTokens()) {
      String pair = st.nextToken();
      int ep = pair.indexOf('=');
      String key = ep > 0 ? pair.substring(0, ep) : pair;
      String value = ep > 0 ? pair.substring(ep + 1) : "";
      try {
        key = /* URLDecoder. */decode(key, encoding);
        if (value != null)
          value = /* URLDecoder. */decode(value, encoding);
      } catch (UnsupportedEncodingException uee) {
      }
      String[] values = (String[]) result.get(key);
      String[] newValues;
      if (values == null) {
        newValues = new String[1];
        newValues[0] = value;
      } else {
        newValues = new String[values.length + 1];
        System.arraycopy(values, 0, newValues, 0, values.length);
        newValues[values.length] = value;
      }
      result.put(key, newValues);
    }
    return result;
  }
View Full Code Here

   *          a queue.
   */
  public void add(String target, Vector ids, boolean queueMode) {
    if (queueMode) {
      if (qDenyings == null)
        qDenyings = new Hashtable();
      qDenyings.put(target, ids);
    } else {
      if (subDenyings == null)
        subDenyings = new Hashtable();
      subDenyings.put(target, ids);
    }
  }
View Full Code Here


  /** Returns the queues enumeration. */
  public Enumeration getQueues() {
    if (qDenyings == null)
      return (new Hashtable()).keys();
    return qDenyings.keys();
  }
View Full Code Here

  }

  /** Returns the subscriptions enumeration. */
  public Enumeration getSubs() {
    if (subDenyings == null)
      return (new Hashtable()).keys();
    return subDenyings.keys();
  }
View Full Code Here

    gti = StreamUtil.readByteArrayFrom(is);
    int size = StreamUtil.readIntFrom(is);
    if (size == -1) {
      qDenyings = null;
    } else {
      qDenyings = new Hashtable(size*4/3);
      for (int i=0; i<size; i++) {
        String target = StreamUtil.readStringFrom(is);
        Vector ids = StreamUtil.readVectorOfStringFrom(is);
        qDenyings.put(target, ids);
      }
    }
    size = StreamUtil.readIntFrom(is);
    if (size == -1) {
      subDenyings = null;
    } else {
      subDenyings = new Hashtable(size*4/3);
      for (int i=0; i<size; i++) {
        String target = StreamUtil.readStringFrom(is);
        Vector ids = StreamUtil.readVectorOfStringFrom(is);
        subDenyings.put(target, ids);
      }
View Full Code Here

  /**
   * Codes an <code>User</code> instance as a Hashtable for traveling
   * through the SOAP protocol.
   */
  public Hashtable code() {
    Hashtable h = new Hashtable();
    h.put("name", name);
    h.put("proxyId", proxyId);
    return h;
  }
View Full Code Here

   
    if (connected)
      return;
   
    // consumers
    Hashtable copyConsumers = (Hashtable) consumers.clone();
   
    Set keys = copyConsumers.entrySet();
    Iterator it = keys.iterator();
    while (it.hasNext()) {
      Map.Entry entry = (Map.Entry) it.next();
     
      MessageEndpointFactory endpointFactory = ((InboundConsumer)entry.getValue()).endpointFactory;
View Full Code Here

    ConnectionFactory cf = null;
    XAConnection connection;
    Vector resources = new Vector();

    if (connections == null)
      connections = new Hashtable();

    try {
      for (int i = 0; i < specs.length; i++) {
        if (! (specs[i] instanceof ActivationSpecImpl))
          throw new ResourceException("Provided ActivationSpec instance is not a JORAM activation spec.");
View Full Code Here

TOP

Related Classes of java.util.Hashtable

Copyright © 2015 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.