Package java.util.concurrent

Examples of java.util.concurrent.ConcurrentHashMap.keySet()


          field.setAccessible(true);
          final Object object = field.get(javaSupport);
          if(object instanceof ConcurrentHashMap)
          {
            ConcurrentHashMap classCache = (ConcurrentHashMap) object;
            for(Object classObject : classCache.keySet())
            {
              Class aClass = (Class)classObject;
              if(aClass.toString().startsWith("class $Proxy"))
                classCache.remove(aClass);
            }
View Full Code Here


      Thread.sleep(500);
      sleptSoFar += 500;
      if(sleptSoFar > 5000) {
        throw new RuntimeException("Waited too much");
      }
    } while(map.keySet().size() < N_THREADS);
   
    Set<Integer> distinctPorts = new HashSet<Integer>();
    for(Object entry: map.entrySet()) {
      PortLock pLock = (PortLock)((Map.Entry)entry).getValue();
      distinctPorts.add(pLock.getPort());
View Full Code Here

      distinctPorts.add(pLock.getPort());
      pLock.release();
    }
   
    // Assert every thread locked on a different port
    assertEquals(distinctPorts.size(), map.keySet().size());
  }
 
  @Test
  public void test() throws ClassNotFoundException, SQLException, IOException, InterruptedException {
    EmbeddedMySQL mysql = new EmbeddedMySQL();
View Full Code Here

        ConcurrentHashMap map = (ConcurrentHashMap) properties.get(null);
        if (map == null)
            return;

        Iterator<Class> itor = map.keySet().iterator();
        while (itor.hasNext())
        {
            Class clazz = itor.next();
            LOG.debug("Clazz: "+clazz+" loaded by "+clazz.getClassLoader());
            if (Thread.currentThread().getContextClassLoader().equals(clazz.getClassLoader()))
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.