org.jboss.messaging.util
Class JBMExecutor

java.lang.Object
  extended by EDU.oswego.cs.dl.util.concurrent.ThreadFactoryUser
      extended by EDU.oswego.cs.dl.util.concurrent.QueuedExecutor
          extended by org.jboss.messaging.util.NamedThreadQueuedExecutor
              extended by org.jboss.messaging.util.JBMExecutor
All Implemented Interfaces:
EDU.oswego.cs.dl.util.concurrent.Executor

public class JBMExecutor
extends NamedThreadQueuedExecutor

Any Executor being used on client side has to clean its contextClassLoader, as that could cause leaks. This class encapsulates the necessary cleanup to avoid that leak. This class also extends the QueuedExector with a method to clear all but the currently executing task without shutting it down. We need this functionality when failing over a session. In that case we need to clear all tasks apart from the currently executing one. We can't just shutdownAfterProcessingCurrentTask then use another instance after failover since when failover resumes the current task and the next delivery will be executed on different threads and smack into each other. http://jira.jboss.org/jira/browse/JBMESSAGING-904 http://jira.jboss.com/jira/browse/JBMESSAGING-1200

Author:
Tim Fox, Clebert Suconic

Nested Class Summary
 
Nested classes/interfaces inherited from class EDU.oswego.cs.dl.util.concurrent.QueuedExecutor
EDU.oswego.cs.dl.util.concurrent.QueuedExecutor.RunLoop
 
Nested classes/interfaces inherited from class EDU.oswego.cs.dl.util.concurrent.ThreadFactoryUser
EDU.oswego.cs.dl.util.concurrent.ThreadFactoryUser.DefaultThreadFactory
 
Field Summary
 
Fields inherited from class EDU.oswego.cs.dl.util.concurrent.QueuedExecutor
ENDTASK, queue_, runLoop_, shutdown_, thread_
 
Fields inherited from class EDU.oswego.cs.dl.util.concurrent.ThreadFactoryUser
threadFactory_
 
Constructor Summary
JBMExecutor(java.lang.String name)
           
 
Method Summary
 void clearAllExceptCurrentTask()
           
 void clearClassLoader()
           
 void execute(java.lang.Runnable runnable)
           
 
Methods inherited from class EDU.oswego.cs.dl.util.concurrent.QueuedExecutor
clearThread, getThread, restart, shutdownAfterProcessingCurrentlyQueuedTasks, shutdownAfterProcessingCurrentTask, shutdownNow
 
Methods inherited from class EDU.oswego.cs.dl.util.concurrent.ThreadFactoryUser
getThreadFactory, setThreadFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JBMExecutor

public JBMExecutor(java.lang.String name)
Method Detail

execute

public void execute(java.lang.Runnable runnable)
             throws java.lang.InterruptedException
Specified by:
execute in interface EDU.oswego.cs.dl.util.concurrent.Executor
Overrides:
execute in class EDU.oswego.cs.dl.util.concurrent.QueuedExecutor
Throws:
java.lang.InterruptedException

clearClassLoader

public void clearClassLoader()
                      throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

clearAllExceptCurrentTask

public void clearAllExceptCurrentTask()


Copyright © 2006 JBoss Inc. All Rights Reserved.