Java Reference
In-Depth Information
if (!rs.getResultSet().next())
{
throw (new WorkloadException(
"Can't resume, unable to determine current host."));
}
this.currentHostID = rs.getResultSet().getInt(1);
this.currentHost = getHost(this.currentHostID);
} catch (SQLException e)
{
throw (new WorkloadException(e));
} finally
{
if (rs != null)
{
rs.close();
}
}
this.stmtResume2.execute();
}
/**
* If there is currently no work available, then wait
* until a new URL has been added to the workload.
*
* @param time
* The amount of time to wait.
* @param unit
* What time unit is being used.
*/
public void waitForWork(int time, TimeUnit unit)
{
try
{
this.workLatch.await(time, unit);
} catch (InterruptedException e)
{
logger.info("Workload latch timed out.");
}
}
Search WWH ::




Custom Search