#11 get number of threads from system property

closed
nobody
None
5
2004-04-02
2004-02-26
Denis Tsyplakov
No

Now:
public final class ProcessQueue extends Observable {

...

static {
engine = new ProcessQueue(20);
}

Proposed:

protected static final int DEFAULT_THREAD_COUNT = 20;

static {
String count_s = System.getProperty (
"simple.util.process.queue.thread.count" ,
DEFAULT_THREAD_COUNT );
int count;
try
{
int count = Integer.parseInt(count_s);
}
catch ( NumberFormatException ex )
{
//use default value
count = DEFAULT_THREAD_COUNT;
}
engine = new ProcessQueue(count);
}

Discussion

    • status: open --> closed