(Problem w/first post...second try)
Hey all.
I'm trying to change pool setting in "mid-air" (application already init and
running for a while, now it needs parameters readjustment, without
restarting the VM)
>From the look at the code, once pool.initialize() has been called, you
cannot issue another pool.initialize(),
Is there a cleaver way to re-init the pool instance (it's a singleton)
without modding the client api?
(whalin's API)
Edit:
Just noticed the shutdown()...
Edit 2:
I'm not sure if it is a bug or by design, but:
stopMaintThread() stops, well, the main thread:
if ( maintThread != null && maintThread.isRunning() )
maintThread.stopThread();
Now, in startMainThread(), there isn't a case where mainThread isn't null,
but is initialized and stopped:
if ( maintThread != null ) {
if ( maintThread.isRunning() ) {
log.error( "main thread already running" );
}
else {
maintThread.start();
}
}
else {
maintThread = new MaintThread( this );
maintThread.setInterval( this.maintSleep );
maintThread.start();
}
}
So, calling shutdown() and then calling pool.initialize() again, result in a
IllegaleStateException.
Am I doing something wrong? is this NOT the way to re-init a pool?
or, is it just a bug?