Package java.util

Examples of java.util.Hashtable


  public void initialize(boolean firstTime) {
    cleanWaitingRequest(System.currentTimeMillis());

    receiving = false;
    messages = new Vector();
    deliveredMsgs = new Hashtable();

    if (firstTime) return;

    // Retrieving the persisted messages, if any.
    List persistedMsgs = Message.loadAll(getMsgTxPrefix().toString());
View Full Code Here


    /**
     * Default constructor.
     */
    public MimeTypeParameterList() {
        parameters = new Hashtable();
    }
View Full Code Here

    }

    public MimeTypeParameterList(String rawdata)
  throws MimeTypeParseException
    {
        parameters = new Hashtable();
       
        //    now parse rawdata
        parse(rawdata);
    }
View Full Code Here

   */
  private InitialLdapContext initializeLDAPContext() throws ResourceException {
      // Create the root context.
    InitialLdapContext initContext;

    Hashtable connenv = new Hashtable();
    connenv.put(Context.INITIAL_CONTEXT_FACTORY, this.config.getLdapContextFactory());
    connenv.put(Context.PROVIDER_URL, this.config.getLdapUrl());
    connenv.put(Context.REFERRAL, LDAP_REFERRAL_MODE);
    // If username is blank, we will perform an anonymous bind.
    // Note: This is not supported when using Sun's VLVs, so remove this if VLVs are used.
    if(!this.config.getLdapAdminUserDN().equals("")) { //$NON-NLS-1$

      connenv.put(Context.SECURITY_AUTHENTICATION, LDAP_AUTH_TYPE);
      connenv.put(Context.SECURITY_PRINCIPAL, this.config.getLdapAdminUserDN());
      connenv.put(Context.SECURITY_CREDENTIALS, this.config.getLdapAdminUserPassword());
    } else {
      LogManager.logDetail(LogConstants.CTX_CONNECTOR, "LDAP Username DN was blank; performing anonymous bind."); //$NON-NLS-1$
      connenv.put(Context.SECURITY_AUTHENTICATION, "none"); //$NON-NLS-1$
    }
   
    if(this.config.getLdapTxnTimeoutInMillis() != -1) {
      connenv.put("com.sun.jndi.ldap.connect.timeout", this.config.getLdapTxnTimeoutInMillis()); //$NON-NLS-1$
    }
   
    // Enable connection pooling for the Initial context.
    connenv.put("com.sun.jndi.ldap.connect.pool", "true"); //$NON-NLS-1$ //$NON-NLS-2$
    connenv.put("com.sun.jndi.ldap.connect.pool.debug", "fine"); //$NON-NLS-1$ //$NON-NLS-2$
   
    try {
      initContext = new InitialLdapContext(connenv, null);
    } catch(NamingException ne){
            final String msg = LDAPPlugin.Util.getString("LDAPConnection.directoryNamingError",ne.getExplanation()); //$NON-NLS-1$
View Full Code Here

    if ( initialCapacity <= 0 || loadFactor <= 0.0 )
      throw new IllegalArgumentException();
    this.loadFactor = loadFactor;
    threshold = (int) ( initialCapacity * loadFactor ) - 1;
    eachCapacity = initialCapacity / nBuckets + 1;
    oldTable = new Hashtable( eachCapacity, loadFactor );
    newTable = new Hashtable( eachCapacity, loadFactor );
  }
View Full Code Here

      {
  if ( size() >= threshold )
    {
      // Rotate the tables.
      oldTable = newTable;
      newTable = new Hashtable( eachCapacity, loadFactor );
    }
      }
    return oldValue;
  }
View Full Code Here

   * @param classes the classnames to work on
   * @return for each distinct root element in the classnames, one entry in
   * the hashtable (with the root element as key)
   */
  public static Hashtable sortClassesByRoot(String classes) {
    Hashtable                 roots;
    Hashtable                 result;
    Enumeration               enm;
    int                       i;
    StringTokenizer           tok;
    String                    clsname;
    Vector                    list;
    HierarchyPropertyParser   hpp;
    String                    separator;
    String                    root;
    String                    tmpStr;
   
    if (classes == null)
      return null;
   
    roots     = new Hashtable();
    hpp       = new HierarchyPropertyParser();
    separator = hpp.getSeperator();
   
    // go over all classnames and store them in the hashtable, with the
    // root element as the key
    tok   = new StringTokenizer(classes, ", ");
    while (tok.hasMoreElements()) {
      clsname = tok.nextToken();
      root    = getRootFromClass(clsname, separator);
      if (root == null)
        continue;
     
      // already stored?
      if (!roots.containsKey(root)) {
        list = new Vector();
        roots.put(root, list);
      }
      else {
        list = (Vector) roots.get(root);
      }
     
      list.add(clsname);
    }
   
    // build result
    result = new Hashtable();
    enm    = roots.keys();
    while (enm.hasMoreElements()) {
      root = (String) enm.nextElement();
      list = (Vector) roots.get(root);
      tmpStr = "";
      for (i = 0; i < list.size(); i++) {
        if (i > 0)
          tmpStr += ",";
        tmpStr += (String) list.get(i);
      }
      result.put(root, tmpStr);
    }
     
    return result;
  }
View Full Code Here

   * @return the hashtable containing the HierarchyPropertyParsers for the root
   *         elements
   */
  protected Hashtable getClassesFromProperties() {     

    Hashtable hpps = new Hashtable();
    String className = m_ClassType.getName();
    Hashtable typeOptions = sortClassesByRoot(EDITOR_PROPERTIES.getProperty(className));
    if (typeOptions == null) {
      /*
      System.err.println("Warning: No configuration property found in\n"
       + PROPERTY_FILE + "\n"
       + "for " + className);
      */
    } else {       
      try {
        Enumeration enm = typeOptions.keys();
        while (enm.hasMoreElements()) {
          String root = (String) enm.nextElement();
          String typeOption = (String) typeOptions.get(root);
          HierarchyPropertyParser hpp = new HierarchyPropertyParser();
          hpp.build(typeOption, ", ");
    hpps.put(root, hpp);
        }
      } catch (Exception ex) {
View Full Code Here

    if (m_ClassType == null) {
      System.err.println("No ClassType set up for GenericObjectEditor!!");
      return;
   
   
    Hashtable hpps = getClassesFromProperties();
    HierarchyPropertyParser hpp = null;
    Enumeration enm = hpps.elements();
   
    try{
      while (enm.hasMoreElements()) {
        hpp = (HierarchyPropertyParser) enm.nextElement();
        if(hpp.depth() > 0) {   
View Full Code Here

   @SuppressWarnings("unchecked")
   public static MBeanServerConnection getServer() {
      if (server == null)
      {
         Hashtable jndiEnv = null;
         try
         {
            InitialContext iniCtx = new InitialContext();
            jndiEnv = iniCtx.getEnvironment();
            server = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
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.