Package com.splout.db.common.PortUtils

Examples of com.splout.db.common.PortUtils.PortLock.release()


    } catch(SQLException e) {
      throw new EngineException(e);
    } catch(ClassNotFoundException e) {
      throw new EngineException(e);
    } finally {
      portLock.release();
    }
  }
}
View Full Code Here


        logger.info("Using port from port lock: " + portLock.getPort());
        redisServer = new RedisServer(thisServer, portLock.getPort());
        redisServer.start();
        jedis = new Jedis("localhost", portLock.getPort());
      } finally {
        portLock.release();
      }
    } catch(InterruptedException e) {
      throw new EngineException(e);
    } catch(IOException e) {
      throw new EngineException(e);
View Full Code Here

   
    Set<Integer> distinctPorts = new HashSet<Integer>();
    for(Object entry: map.entrySet()) {
      PortLock pLock = (PortLock)((Map.Entry)entry).getValue();
      distinctPorts.add(pLock.getPort());
      pLock.release();
    }
   
    // Assert every thread locked on a different port
    assertEquals(distinctPorts.size(), map.keySet().size());
  }
View Full Code Here

        mySQL = new EmbeddedMySQL(config);
        mySQL.start(true);
      } catch(Exception e) {
        throw e;
      } finally {
        portLock.release();
      }

      mySQLs.put(partition, mySQL);

      // MySQL is successfully started at this point, or an Exception would have been thrown.
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.