ThreadPool + excalibur event + Cornerstone ThreadManager

"mati" <[email protected]> Wed, 8 Jan 2003 15:32:23 +0100
Newsgroups gmane.comp.jakarta.avalon.apps.devel,gmane.comp.jakarta.avalon.devel
Message-ID <014001c2b722$c24d1d80$0203a8c0@NCDC>

I have been trying to use DefaultThreadManager from excalibur event package.

I just do not want to have an additional ThreadPool managed by
TPCThreadManager so I thought I would use the cornerstone one

The problem is that CornerStone uses old ThreadPool
import org.apache.avalon.excalibur.thread.ThreadPool;

which is depracated by now

On the other hand AbstractThreadManager expects to get the new one, and here
we have a problem
import org.apache.excalibur.thread.ThreadPool;

because I get exception:

org.apache.excalibur.containerkit.lifecycle.LifecycleException: Component
named "my-thread-manager" failed to pass through the Initialization stage.
(Reason: java.lang.IncompatibleClassChangeError).

I do not know what is the proper way of solving this problem. I've spotted
that Peter Donald created DefaultThreadManager (excalibur-event) so I am
wondering how did he manage to force these to work with Cornerstone
ThreadManager and it's ThreadPool.


Here is the code snippet:

public void initialize() throws Exception {
    //this.threadManager = new TPCThreadManager();
    ThreadPool pool = this.cornerStoneThreadManager.getDefaultThreadPool();
    this.newThreadManager = new DefaultThreadManager(pool);

this.newThreadManager.enableLogging(getLogger().getChildLogger("excalibur-th
read-manager"));
    newThreadManager.initialize();
}

I would appreciate any feedback.

TIA

Mateusz Szczap
[email protected]