public abstract class DBRequestProcessor.DBRunnable extends java.lang.Object implements java.lang.Runnable
|Constructor and Description|
Create a new runnable that works against the given provider.
|Modifier and Type||Method and Description|
Called if the runnable is cancelled or interrupted.
Does the work for this Runnable.
Gets the Logger that any DBException thrown by
Gets a name for this task that can be displayed to the user in the status UI as the task is executed.
Gets the DBObjectProvider that this task is working against.
public DBRunnable(DBObjectProvider pro, java.lang.String name)
pro- the provider
name- 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
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.
DBRequestProcessor.schedule(java.lang.String, oracle.ide.db.execute.DBRequestProcessor.DBRunnable, int) (rather than
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 failed
java.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()