public abstract class DBRequestProcessor.DBRunnable
extends java.lang.Object
implements java.lang.Runnable
| Constructor and Description | 
|---|
DBRunnable(DBObjectProvider pro,
          java.lang.String name)
Create a new runnable that works against the given provider. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
protected void | 
cancelWork()
Called if the runnable is cancelled or interrupted. 
 | 
protected abstract void | 
doWork()
Does the work for this Runnable. 
 | 
protected java.util.logging.Logger | 
getLogger()
Gets the Logger that any DBException thrown by  
doWork() will
 have its message logged on. | 
java.lang.String | 
getName()
Gets a name for this task that can be displayed to the user in the
 status UI as the task is executed. 
 | 
DBObjectProvider | 
getProvider()
Gets the DBObjectProvider that this task is working against. 
 | 
void | 
run()  | 
public DBRunnable(DBObjectProvider pro, java.lang.String name)
pro - the providername - a translated string describing the task for displaying
 to the user in the status UI.public final DBObjectProvider getProvider()
public java.lang.String getName()
protected java.util.logging.Logger getLogger()
doWork() will
 have its message logged on.protected abstract void doWork()
                        throws DBException,
                               java.lang.InterruptedException
SwingUtilities.invokeLater.
 DBRunnables are expected to be cancellable. If they are cancelled the thread will be interrupted. Any long running process should therefore check the thread's interrupted during execution and stop processing if it is true.
 When using DBRequestProcessor.schedule(java.lang.String, oracle.ide.db.execute.DBRequestProcessor.DBRunnable, int) (rather than DBRequestProcessor.execute(oracle.ide.db.execute.DBRequestProcessor.DBRunnable)) interrupt
 checking by a DBRunnable is important. If it takes too long for the
 interrupted process to stop, then the replacement DBRunnable
 scheduled afterwards might have already started (i.e. the scheduler
 does not wait for the existing runnable to stop). This means that
 if a shared object (e.g.a DBObject) is modified by this method then
 the interruption should always be checked before any modification
 to that object.
DBException - if the work against the provider failedjava.lang.InterruptedException - if the work was interrupted and did
 not complete. This is simply to allow interruptable API calls to
 be made without a catch in the doWork implementation, it is not
 necessary to throw InterruptedException when the thread has been
 interrupted.protected void cancelWork()
 It is possible that doWork() will not have been called when
 this method is called (if the task was scheduled but waiting for
 execution when it was cancelled). It is also possible that it could
 be called after doWork() has finished.
public final void run()
run in interface java.lang.Runnable