com.im.df/1 5.3

com.im.df.util
Class UIBackgroundRunnerRW

java.lang.Object
  extended by com.im.commons.progress.BackgroundRunner
      extended by com.im.df.util.UIBackgroundRunnerRW

public abstract class UIBackgroundRunnerRW
extends BackgroundRunner

An extension of UIBackgroundRunnerRO which is able to lock the given DFLockable and use the lock in the background task. Lock is automatically released when action is finished. When the DFLockable is already locked, the background task will try to lock repeatedly, waiting LOCK_RETRY_DELAY milliseconds between retries. The implementation will attempt to lock the DFLockable at most MAX_LOCK_RETRIES times. When the attempts to lock are exhauseted, or the DFLockable.isLockedForever() indicates that the DFLockable can never be locked, the task will fail with AlreadyLockedException. The BackgroundRunner.phase1Exception(java.lang.Exception) and BackgroundRunner.phase1Finally() will be called for proper error reporting and state cleanup.


Constructor Summary
UIBackgroundRunnerRW(DFLockable lockable, String taskName, boolean cancellable)
           
 
Method Summary
protected  RequestProcessor.Task createTask()
           
 DFEnvironmentRW getEnvironment()
           
protected  RequestProcessor getRequestProcessor()
          We need single thread request processor per lockable.
 boolean phase1Cancelled(CancelException exc)
           
protected  void phase1FinallyInternal()
           
 
Methods inherited from class com.im.commons.progress.BackgroundRunner
failTask, getCreateLock, getDelay, getTask, interrupt, isAwtPhase, phase1Exception, phase1Finally, phase1InRequestProcessor, phase2InAWT, processTheTask, restart, setAwtPhase, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UIBackgroundRunnerRW

public UIBackgroundRunnerRW(DFLockable lockable,
                            String taskName,
                            boolean cancellable)
Method Detail

createTask

protected RequestProcessor.Task createTask()
Overrides:
createTask in class BackgroundRunner

getEnvironment

public DFEnvironmentRW getEnvironment()

phase1Cancelled

public boolean phase1Cancelled(CancelException exc)
Overrides:
phase1Cancelled in class BackgroundRunner

phase1FinallyInternal

protected final void phase1FinallyInternal()
Overrides:
phase1FinallyInternal in class BackgroundRunner

getRequestProcessor

protected RequestProcessor getRequestProcessor()
We need single thread request processor per lockable.

Overrides:
getRequestProcessor in class BackgroundRunner

com.im.df/1 5.3