[SNMP4J] ThreadPool in a J2EE environment

Brice Fines bfines at sermepa.es
Fri Apr 17 14:41:12 CEST 2009


Hi Frank,

Ok, I did it and it is working.

I implemented a MessageDispatcher, basically copying the 
MultithreadedMessageDispatcher.
Internally it also uses a decorated MessageDispatcher, and a TaskExecutor 
instead of the ThreadPool (it is a 
org.springframework.core.task.TaskExecutor, I use Spring framework).
The IBM Websphere WorkManagerTaskExecutor (the Spring abstraction of the 
IBM/Bea WorkManager) is injected as the TaskExecutor in my 
MessageDispatcher implementation, this way I take advantage of the WAS 
thread pool and generated threads are part of the J2EE container.
By using a TaskExecutor, I could inject other than the IBM one, like 
GlassFishWorkManagerTasxExecutor, JBossWorkManagerTasxExecutor, or another 
Spring TaskExecutor.

Now I will try to integrate the SNMP4JSetting in the same way.

One last little question:
Is it OK to use 
public void run() {
      dispatcher.processMessage(sourceTransport, incomingAddress, 
wholeMessage);
    }
as in inner class MessageTask inside MultiThreadedMessageDispatcher class, 
being the dispatcher.processMessage deprecated?

Regards
Brice


More information about the SNMP4J mailing list