Eclipse Platform
Release 3.6

org.eclipse.equinox.p2.operations
Class ProvisioningJob

java.lang.Object
  extended by org.eclipse.core.runtime.PlatformObject
      extended by org.eclipse.core.internal.jobs.InternalJob
          extended by org.eclipse.core.runtime.jobs.Job
              extended by org.eclipse.equinox.p2.operations.ProvisioningJob
All Implemented Interfaces:
Comparable, IAdaptable
Direct Known Subclasses:
LoadMetadataRepositoryJob, ProfileModificationJob

public abstract class ProvisioningJob
extends Job

Abstract class representing provisioning jobs. Provisioning jobs can be run in the background by scheduling them, or they can be run by a client in a modal context. An additional progress monitor can be set into the job for progress reporting.

Since:
2.0

Field Summary
static int RESTART_NONE
          Constant which indicates that the job does not require a restart upon completion.
static int RESTART_ONLY
          Constant which indicates that the job requires the user to restart in order to pick up the changes performed by the job.
static int RESTART_OR_APPLY
          Constant which indicates that the job requires the user to either restart or apply the configuration changes in order to pick up the changes performed by the job.
 
Fields inherited from class org.eclipse.core.runtime.jobs.Job
ASYNC_FINISH, BUILD, DECORATE, INTERACTIVE, LONG, NONE, RUNNING, SHORT, SLEEPING, WAITING
 
Fields inherited from class org.eclipse.core.internal.jobs.InternalJob
manager
 
Constructor Summary
ProvisioningJob(String name, ProvisioningSession session)
          Create a provisioning job with the given name that uses the provided provisioning session for retrieving any services needed.
 
Method Summary
protected  IStatus getErrorStatus(String message, ProvisionException e)
          Return an error status that can be used to report the specified exception.
 int getRestartPolicy()
          Return the restart policy that is appropriate for this job.
protected  ProvisioningSession getSession()
          Return the provisioning session that is used by the receiver when retrieving necessary provisioning services.
 IStatus run(IProgressMonitor monitor)
          Executes this job.
abstract  IStatus runModal(IProgressMonitor monitor)
          Perform the specific work involved in running this job in the current thread.
 void setAdditionalProgressMonitor(IProgressMonitor monitor)
           
 
Methods inherited from class org.eclipse.core.runtime.jobs.Job
addJobChangeListener, belongsTo, cancel, canceling, done, getJobManager, getName, getPriority, getProperty, getResult, getRule, getState, getThread, isBlocking, isSystem, isUser, join, removeJobChangeListener, schedule, schedule, setName, setPriority, setProgressGroup, setProperty, setRule, setSystem, setThread, setUser, shouldRun, shouldSchedule, sleep, toString, wakeUp, wakeUp, yieldRule
 
Methods inherited from class org.eclipse.core.internal.jobs.InternalJob
compareTo
 
Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

RESTART_NONE

public static final int RESTART_NONE
Constant which indicates that the job does not require a restart upon completion. This constant is typically used for operations that do not modify the running profile.

Since:
2.0
See Also:
Constant Field Values

RESTART_OR_APPLY

public static final int RESTART_OR_APPLY
Constant which indicates that the job requires the user to either restart or apply the configuration changes in order to pick up the changes performed by the job. This constant is typically used for operations that modify the running profile.

Since:
2.0
See Also:
Constant Field Values

RESTART_ONLY

public static final int RESTART_ONLY
Constant which indicates that the job requires the user to restart in order to pick up the changes performed by the job. This constant is typically used for operations that modify the running profile but don't handle dynamic changes without restarting the workbench.

Since:
2.0
See Also:
Constant Field Values
Constructor Detail

ProvisioningJob

public ProvisioningJob(String name,
                       ProvisioningSession session)
Create a provisioning job with the given name that uses the provided provisioning session for retrieving any services needed.

Parameters:
name - the name of the job
session - the session providing the services
Method Detail

getSession

protected ProvisioningSession getSession()
Return the provisioning session that is used by the receiver when retrieving necessary provisioning services.

Returns:
the session
See Also:
ProvisioningSession

setAdditionalProgressMonitor

public void setAdditionalProgressMonitor(IProgressMonitor monitor)

run

public final IStatus run(IProgressMonitor monitor)
Executes this job. Returns the result of the execution. This method is overridden to look for a wrapped progress monitor for reporting progress.

Specified by:
run in class Job
Parameters:
monitor - the monitor to be used for reporting progress and responding to cancelation. The monitor is never null
Returns:
resulting status of the run. The result must not be null
See Also:
Job.run(org.eclipse.core.runtime.IProgressMonitor)
Restriction:
This method is not intended to be referenced by clients.

runModal

public abstract IStatus runModal(IProgressMonitor monitor)
Perform the specific work involved in running this job in the current thread. This method can be called directly by clients, or in the course of running the job in the background.

Parameters:
monitor - the progress monitor to use for the operation
Returns:
a status indicating the result of the operation.

getRestartPolicy

public int getRestartPolicy()
Return the restart policy that is appropriate for this job.

Returns:
a constant indicating the restart policy
See Also:
RESTART_NONE, RESTART_ONLY, RESTART_OR_APPLY

getErrorStatus

protected IStatus getErrorStatus(String message,
                                 ProvisionException e)
Return an error status that can be used to report the specified exception.

Parameters:
message - the message that should be used in the status
e - the exception to be reported
Returns:
a status that can be used to describe the exception

Eclipse Platform
Release 3.6

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.