org.jboss.messaging.util
Class JBMExecutor

java.lang.Object
  extended by QueuedExecutor
      extended by org.jboss.messaging.util.NamedThreadQueuedExecutor
          extended by org.jboss.messaging.util.JBMExecutor

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

Constructor Summary
JBMExecutor(java.lang.String name)
           
 
Method Summary
 void clearAllExceptCurrentTask()
           
 void clearClassLoader()
           
 void execute(java.lang.Runnable runnable)
           
 
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
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.