Top Description Fields Constructors Methods
com.sun.javafx.runtime.async

public abstract Class AbstractAsyncOperation<V>

extends Object
implements AsyncOperation, Callable<V>
Class Inheritance
All Implemented Interfaces
java.util.concurrent.Callable, com.sun.javafx.runtime.async.AsyncOperation
Known Direct Subclasses
com.sun.javafx.runtime.async.AbstractRemoteResource
Imports
java.util.concurrent.Callable, .ExecutionException, .FutureTask, javafx.application.Platform

AbstractAsyncOperation. Base class for result-bearing, asynchronous operations. Some operations are asynchronous because they would potentially block the EDT for unacceptably long. Since JFX lacks a clear concurrency model, allowing users to execute arbitrary JFX code in background threads would invariably cause problems. Therefore, we provide a number of Java classes for async operations, which will execute in a background thread, such as "fetch a resource over the web". Async operations should not access any JFX state except the immutable parameters passed in, and should not have side effects other than those managed by thread-safe Java classes. Async operations are one-time use; subclasses should not attempt to reuse them.

Field Summary

Modifier and TypeField and Description
private int
protected final FutureTask<V>
private int
protected final AsyncOperationListener<V>
private int
private int
private int
private int

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected void
addProgress(int amount)

public void
protected int
protected int
public boolean
public boolean
protected void
protected void
setProgressGranularity(int progressGranularity)

protected void
setProgressMax(int progressMax)

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bytesReadback to summary
private int bytesRead
futureback to summary
protected final FutureTask<V> future
lastProgressback to summary
private int lastProgress
listenerback to summary
protected final AsyncOperationListener<V> listener
nextProgressback to summary
private int nextProgress
progressGranularityback to summary
private int progressGranularity
progressIncrementback to summary
private int progressIncrement
progressMaxback to summary
private int progressMax

Constructor Detail

AbstractAsyncOperationback to summary
protected AbstractAsyncOperation(final AsyncOperationListener<V> listener)

Method Detail

addProgressback to summary
protected void addProgress(int amount)
cancelback to summary
public void cancel()

Implements com.sun.javafx.runtime.async.AsyncOperation.cancel.

Annotations
@Override
getProgressGranularityback to summary
protected int getProgressGranularity()
getProgressMaxback to summary
protected int getProgressMax()
isCancelledback to summary
public boolean isCancelled()

Implements com.sun.javafx.runtime.async.AsyncOperation.isCancelled.

Annotations
@Override
isDoneback to summary
public boolean isDone()

Implements com.sun.javafx.runtime.async.AsyncOperation.isDone.

Annotations
@Override
notifyProgressback to summary
protected void notifyProgress()
setProgressGranularityback to summary
protected void setProgressGranularity(int progressGranularity)
setProgressMaxback to summary
protected void setProgressMax(int progressMax)
startback to summary
public void start()

Implements com.sun.javafx.runtime.async.AsyncOperation.start.

Annotations
@Override