org.eclipse.emf.emfstore.internal.client.common
Class ScopedWorkspaceThreadPoolExecutor

java.lang.Object
  extended by java.util.concurrent.AbstractExecutorService
      extended by java.util.concurrent.ThreadPoolExecutor
          extended by org.eclipse.emf.emfstore.internal.client.common.ScopedWorkspaceThreadPoolExecutor
All Implemented Interfaces:
Executor, ExecutorService

public class ScopedWorkspaceThreadPoolExecutor
extends ThreadPoolExecutor

This class extend ThreadPoolExecutor, and ensures than when each thread is asked to run its task there is an initialization done on the thread first. This initialization ensures that the static threadlocal ESWorkspaceProviderImpl associated with the ESWorkspaceProviderImpl class is obtained from the thread that is REQUESTING the thread pool to execute behavior, and set upon the thread in the pool which actually EXECUTES the behavior.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
 
Constructor Summary
ScopedWorkspaceThreadPoolExecutor()
          Default constructor.
 
Method Summary
 void execute(Runnable command)
           This overridden method ensures that the runnable is updated to have access threadlocal ESWorkspaceProviderImpl from the requesting thread set as the threadlocal ESWorkspaceProviderImpl of the executing thread.
 
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow
 
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, submit, submit, submit
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScopedWorkspaceThreadPoolExecutor

public ScopedWorkspaceThreadPoolExecutor()
Default constructor.

Method Detail

execute

public void execute(Runnable command)

This overridden method ensures that the runnable is updated to have access threadlocal ESWorkspaceProviderImpl from the requesting thread set as the threadlocal ESWorkspaceProviderImpl of the executing thread.

Specified by:
execute in interface Executor
Overrides:
execute in class ThreadPoolExecutor
See Also:
ThreadPoolExecutor.execute(java.lang.Runnable)


Copyright © 2015. All Rights Reserved.