|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.virtualbox_5_0.IUnknown
org.virtualbox_5_0.IProgress
public class IProgress
The IProgress interface is used to track and control
asynchronous tasks within VirtualBox.
An instance of this is returned every time VirtualBox starts
an asynchronous task (in other words, a separate thread) which
continues to run after a method call returns. For example,IMachine.saveState()
, which saves the state of
a running virtual machine, can take a long time to complete.
To be able to display a progress bar, a user interface such as
the VirtualBox graphical user interface can use the IProgress
object returned by that method.
Note that IProgress is a "read-only" interface in the sense
that only the VirtualBox internals behind the Main API can
create and manipulate progress objects, whereas client code
can only use the IProgress object to monitor a task's
progress and, ifgetCancelable()
is true,
cancel the task by callingcancel()
.
A task represented by IProgress consists of either one or
several sub-operations that run sequentially, one by one (seegetOperation()
andgetOperationCount()
).
Every operation is identified by a number (starting from 0)
and has a separate description.
You can find the individual percentage of completion of the current
operation ingetOperationPercent()
and the
percentage of completion of the task as a whole
ingetPercent()
.
Similarly, you can wait for the completion of a particular
operation viawaitForOperationCompletion(Long,Integer)
or
for the completion of the whole task viawaitForCompletion(Integer)
.
Interface ID: {77FAF1C0-489D-B123-274C-5A95E77AB286}
Field Summary |
---|
Fields inherited from class org.virtualbox_5_0.IUnknown |
---|
obj, port |
Constructor Summary | |
---|---|
IProgress(java.lang.String wrapped,
org.virtualbox_5_0.jaxws.VboxPortType port)
|
Method Summary | |
---|---|
void |
cancel()
Cancels the task. |
java.lang.Boolean |
getCancelable()
Whether the task can be interrupted. |
java.lang.Boolean |
getCanceled()
Whether the task has been canceled. |
java.lang.Boolean |
getCompleted()
Whether the task has been completed. |
java.lang.String |
getDescription()
Description of the task. |
IVirtualBoxErrorInfo |
getErrorInfo()
Extended information about the unsuccessful result of the progress operation. |
java.lang.String |
getId()
ID of the task. |
IUnknown |
getInitiator()
Initiator of the task. |
java.lang.Long |
getOperation()
Number of the sub-operation being currently executed. |
java.lang.Long |
getOperationCount()
Number of sub-operations this task is divided into. |
java.lang.String |
getOperationDescription()
Description of the sub-operation being currently executed. |
java.lang.Long |
getOperationPercent()
Progress value of the current sub-operation only, in percent. |
java.lang.Long |
getOperationWeight()
Weight value of the current sub-operation only. |
java.lang.Long |
getPercent()
Current progress value of the task as a whole, in percent. |
java.lang.Integer |
getResultCode()
Result code of the progress task. |
java.lang.Long |
getTimeout()
When non-zero, this specifies the number of milliseconds after which the operation will automatically be canceled. |
java.lang.Integer |
getTimeRemaining()
Estimated remaining time until the task completes, in seconds. |
static IProgress |
queryInterface(IUnknown obj)
|
void |
setCurrentOperationProgress(java.lang.Long percent)
Internal method, not to be called externally. |
void |
setNextOperation(java.lang.String nextOperationDescription,
java.lang.Long nextOperationsWeight)
Internal method, not to be called externally. |
void |
setTimeout(java.lang.Long value)
When non-zero, this specifies the number of milliseconds after which the operation will automatically be canceled. |
void |
waitForAsyncProgressCompletion(IProgress pProgressAsync)
Waits until the other task is completed (including all sub-operations) and forward all changes from the other progress to this progress. |
void |
waitForCompletion(java.lang.Integer timeout)
Waits until the task is done (including all sub-operations) with a given timeout in milliseconds; specify -1 for an indefinite wait. |
void |
waitForOperationCompletion(java.lang.Long operation,
java.lang.Integer timeout)
Waits until the given operation is done with a given timeout in milliseconds; specify -1 for an indefinite wait. |
Methods inherited from class org.virtualbox_5_0.IUnknown |
---|
getRemoteWSPort, getWrapped, releaseRemote |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IProgress(java.lang.String wrapped, org.virtualbox_5_0.jaxws.VboxPortType port)
Method Detail |
---|
public java.lang.String getId()
public java.lang.String getDescription()
public IUnknown getInitiator()
public java.lang.Boolean getCancelable()
public java.lang.Long getPercent()
getCompleted()
is true.
public java.lang.Integer getTimeRemaining()
public java.lang.Boolean getCompleted()
public java.lang.Boolean getCanceled()
public java.lang.Integer getResultCode()
getCompleted()
is true.
public IVirtualBoxErrorInfo getErrorInfo()
getCompleted()
is true andgetResultCode()
indicates a failure.
public java.lang.Long getOperationCount()
public java.lang.Long getOperation()
public java.lang.String getOperationDescription()
public java.lang.Long getOperationPercent()
public java.lang.Long getOperationWeight()
public java.lang.Long getTimeout()
public void setTimeout(java.lang.Long value)
value
- Longpublic static IProgress queryInterface(IUnknown obj)
public void setCurrentOperationProgress(java.lang.Long percent)
public void setNextOperation(java.lang.String nextOperationDescription, java.lang.Long nextOperationsWeight)
public void waitForCompletion(java.lang.Integer timeout)
timeout
- Maximum time in milliseconds to wait or -1 to wait indefinitely.
Expected result codes:
@link ::VBOX_E_IPRT_ERROR VBOX_E_IPRT_ERROR | Failed to wait for task completion. |
public void waitForOperationCompletion(java.lang.Long operation, java.lang.Integer timeout)
waitForCompletion(Integer)
operation
- Number of the operation to wait for.
Must be less thangetOperationCount()
.timeout
- Maximum time in milliseconds to wait or -1 to wait indefinitely.
Expected result codes:
@link ::VBOX_E_IPRT_ERROR VBOX_E_IPRT_ERROR | Failed to wait for operation completion. |
public void waitForAsyncProgressCompletion(IProgress pProgressAsync)
pProgressAsync
- The progress object of the asynchrony process.public void cancel()
@link ::VBOX_E_INVALID_OBJECT_STATE VBOX_E_INVALID_OBJECT_STATE | Operation cannot be canceled. |
getCancelable()
is false, then this method will fail.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |