Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
#include <berryIJobManager.h>
Public Member Functions | |
virtual berryObjectMacro(berry::IJobManager) static const std void | AddJobChangeListener (IJobChangeListener *listener)=0 |
virtual IProgressMonitor::Pointer | CreateProgressGroup ()=0 |
virtual void BeginRule(const ISchedulingRule& rule, const IProgressMonitor& monitor) = 0; More... | |
virtual bool | IsIdle ()=0 |
virtual void EndRule(const ISchedulingRule& rule) = 0; More... | |
virtual bool | IsSuspended ()=0 |
virtual void | RemoveJobChangeListener (IJobChangeListener *listener)=0 |
virtual ILock newLock() = 0; More... | |
virtual void | SetProgressProvider (ProgressProvider::Pointer)=0 |
virtual void Resume(const ISchedulingRule& rule) = 0; More... | |
Public Member Functions inherited from berry::Object | |
virtual QString | GetClassName () const |
virtual Reflection::TypeInfo | GetTypeInfo () const |
virtual QList< Reflection::TypeInfo > | GetSuperclasses () const |
virtual void | Delete () |
QDebug | Print (QDebug os, Indent Indent=0) const |
virtual QString | ToString () const |
virtual uint | HashCode () const |
virtual bool | operator< (const Object *) const |
void | Register () const |
void | UnRegister (bool del=true) const |
int | GetReferenceCount () const |
void | SetReferenceCount (int) |
void | AddDestroyListener (const MessageAbstractDelegate<> &delegate) const |
void | RemoveDestroyListener (const MessageAbstractDelegate<> &delegate) const |
virtual bool | operator== (const Object *) const |
Additional Inherited Members | |
Public Types inherited from berry::Object | |
typedef Object | Self |
typedef berry::SmartPointer< Self > | Pointer |
typedef berry::SmartPointer< const Self > | ConstPointer |
typedef berry::WeakPointer< Self > | WeakPtr |
typedef berry::WeakPointer< const Self > | ConstWeakPtr |
Static Public Member Functions inherited from berry::Object | |
static const char * | GetStaticClassName () |
static Reflection::TypeInfo | GetStaticTypeInfo () |
static QList< Reflection::TypeInfo > | GetStaticSuperclasses () |
Protected Member Functions inherited from berry::Object | |
Object () | |
virtual | ~Object () |
virtual QDebug | PrintSelf (QDebug os, Indent indent) const |
virtual QDebug | PrintHeader (QDebug os, Indent indent) const |
virtual QDebug | PrintTrailer (QDebug os, Indent indent) const |
Protected Attributes inherited from berry::Object | |
QAtomicInt | m_ReferenceCount |
QMutex | m_ReferenceCountLock |
The job manager provides facilities for scheduling, querying, and maintaining jobs and locks. In particular, the job manager provides the following services:
schedule
method. This interface is not intended to be implemented by clients.
Definition at line 58 of file berryIJobManager.h.
|
pure virtual |
A system property key indicating whether the job manager should create job threads as daemon threads. Set to true
to force all worker threads to be created as daemon threads. Set to false
to force all worker threads to be created as non-daemon threads.
not used yet Registers a job listener with the job manager. Has no effect if an identical listener is already registered.
listener | the listener to be added |
|
pure virtual |
virtual void BeginRule(const ISchedulingRule& rule, const IProgressMonitor& monitor) = 0;
Begins applying this rule in the calling thread. If the rule conflicts with another rule currently running in another thread, this method blocks until there are no conflicting rules. Calls to beginRule
must eventually be followed by a matching call to endRule
in the same thread and with the identical rule instance.
Rules can be nested only if the rule for the inner beginRule
is contained within the rule for the outer beginRule
. Rule containment is tested with the API method ISchedulingRule.contains
. Also, begin/end pairs must be strictly nested. Only the rule that has most recently begun can be ended at any given time.
A rule of null
can be used, but will be ignored for scheduling purposes. The outermost non-null rule in the thread will be used for scheduling. A null
rule that is begun must still be ended.
If this method is called from within a job that has a scheduling rule, the given rule must also be contained within the rule for the running job.
Note that endRule
must be called even if beginRule
fails. The recommended usage is:
// * final ISchedulingRule rule = ...; // * try { // * manager.beginRule(rule, monitor); // * } finally { // * manager.endRule(rule); // * } // *
@param rule the rule to begin applying in this thread, or <code>null</code> @param monitor a progress monitor, or <code>null</code> if progress reporting and cancellation are not desired @throws IllegalArgumentException if the rule is not strictly nested within all other rules currently active for this thread @throws OperationCanceledException if the supplied monitor reports cancelation before the rule becomes available @see ISchedulingRule#contains(ISchedulingRule)
Cancels all jobs in the given job family. Jobs in the family that are currently waiting will be removed from the queue. Sleeping jobs will be discarded without having a chance to wake up. Currently executing jobs will be asked to cancel but there is no guarantee that they will do so.
family | the job family to cancel, or null to cancel all jobs |
Recommended usage (this snippet runs two jobs in sequence in a single progress group):
Job parseJob, compileJob; IProgressMonitor pm = Platform.getJobManager().createProgressGroup(); try { pm.beginTask("Building", 10); parseJob.setProgressGroup(pm, 5); parseJob.schedule(); compileJob.setProgressGroup(pm, 5); compileJob.schedule(); parseJob.join(); compileJob.join(); } finally { pm.done(); }
|
pure virtual |
virtual void EndRule(const ISchedulingRule& rule) = 0;
Returns the job that is currently running in this thread, or null
if there is no currently running job.
null
Ends the application of a rule to the calling thread. Calls to endRule
must be preceded by a matching call to beginRule
in the same thread with an identical rule instance. Rules can be nested only if the rule for the inner beginRule
is contained within the rule for the outer beginRule
. Also, begin/end pairs must be strictly nested. Only the rule that has most recently begun can be ended at any given time.
rule | the rule to end applying in this thread |
IllegalArgumentException | if this method is called on a rule for which there is no matching begin, or that does not match the most recent begin. |
family | the job family to find, or null to find all jobs |
true
if the job manager is idle, and false
otherwise
|
pure virtual |
Returns whether the job manager is currently suspended.
true
if the job manager is suspended, and false
otherwise
|
pure virtual |
virtual ILock newLock() = 0;
Waits until all jobs of the given family are finished. This method will block the calling thread until all such jobs have finished executing, or until this thread is interrupted. If there are no jobs in the family that are currently waiting, running, or sleeping, this method returns immediately. Feedback on how the join is progressing is provided to a progress monitor.
If this method is called while the job manager is suspended, only jobs that are currently running will be joined; Once there are no jobs in the family in the Job#RUNNING state, this method returns.
Note that there is a deadlock risk when using join. If the calling thread owns a lock or object monitor that the joined thread is waiting for, deadlock will occur. This method can also result in starvation of the current thread if another thread continues to add jobs of the given family, or if a job in the given family reschedules itself in an infinite loop.
family | the job family to join, or null to join all jobs. |
monitor | Progress monitor for reporting progress on how the wait is progressing, or null if no progress monitoring is required. |
InterruptedException | if this thread is interrupted while waiting |
OperationCanceledException | if the progress monitor is canceled while waiting |
listener | the listener to be removed |
|
pure virtual |
virtual void Resume(const ISchedulingRule& rule) = 0;
Resumes execution of jobs after a previous suspend
. All jobs that were sleeping or waiting prior to the suspension, or that were scheduled while the job manager was suspended, will now be eligible for execution.
Calling this method on a rule that is not suspended has no effect. If another thread also owns the rule at the time this method is called, then the rule will not be resumed until all threads have released the rule.
Resumes execution of jobs after a previous suspend
. All jobs that were sleeping or waiting prior to the suspension, or that were scheduled while the job manager was suspended, will now be eligible for execution.
Calling resume
when the job manager is not suspended has no effect.
This method is for internal use by the platform-related plug-ins. Clients should not call this method.
This method is intended for use by the currently executing Eclipse application. Plug-ins outside the currently running application should not call this method.
provider | the new provider, or null if no progress is needed |