public class MemoryLimitedJobRunner
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
long |
capacity |
static int |
THREAD_PRIORITY |
Constructor and Description |
---|
MemoryLimitedJobRunner(long capacity,
int maxThreads,
Executor executor,
int priorities) |
Modifier and Type | Method and Description |
---|---|
long |
getCapacity() |
int |
getMaxThreads() |
int |
getRunningThreads() |
void |
queueJob(MemoryLimitedJob job)
Run the job if the counter is below some threshold, otherwise queue it.
|
void |
setCapacity(long val) |
void |
setMaxThreads(int val) |
void |
shutdown() |
void |
waitForShutdown() |
public MemoryLimitedJobRunner(long capacity, int maxThreads, Executor executor, int priorities)
public void queueJob(MemoryLimitedJob job)
public void setMaxThreads(int val)
public int getMaxThreads()
public long getCapacity()
public void setCapacity(long val)
public void shutdown()
public void waitForShutdown()
public int getRunningThreads()