# Class AsyncMedia.PauseRequest

java.lang.Object
java.util.Observable
com.codename1.util.AsyncResource<AsyncMedia>
com.codename1.media.AsyncMedia.PauseRequest

Enclosing interface:
  `AsyncMedia`

public static class AsyncMedia.PauseRequest extends AsyncResource<AsyncMedia>

An async resource used to track the progress of a pauseAsync() request. It will resolve when the media has paused, or if an error occurs first.

##### See also

- #pauseAsync()

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from class AsyncResource

  `AsyncResource.AsyncExecutionException, AsyncResource.CancellationException`
  Modifier and Type
  Class
  Description
  `static class`
  `AsyncResource.AsyncExecutionException`
  Exception to wrap exceptions that are thrown during asynchronous execution.
  `static class`
  `AsyncResource.CancellationException`
  Exception thrown when the AsyncResource is cancelled.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PauseRequest()`

- ## Method Summary

  ### Methods inherited from class AsyncResource

  `addListener, all, all, asPromise, await, await, await, cancel, complete, error, except, except, get, get, get, isCancelled, isCancelled, isDone, isReady, onResult, ready, ready, waitFor`
  Modifier and Type
  Method
  Description
  `void`
  `addListener(AsyncResource<AsyncMedia> resource)`
  Adds another AsyncResource as a listener to this async resource.
  `static AsyncResource<Boolean>`
  `all(AsyncResource<?>... resources)`
  Creates a single AsyncResource that will fire its ready() only when all of the provided resources are ready.
  `static AsyncResource<Boolean>`
  `all(Collection<AsyncResource<?>> resources)`
  Creates a single AsyncResource that will fire its ready() only when all of the provided resources are ready.
  `Promise<AsyncMedia>`
  `asPromise()`
  Wraps this AsyncResource object as a `Promise`
  `void`
  `await()`
  Waits and blocks until this AsyncResource is done.
  `static void`
  `await(AsyncResource<?>... resources)`
  Waits for a set of AsyncResources to be complete.
  `static void`
  `await(Collection<AsyncResource<?>> resources)`
  Waits for a set of AsyncResources to be complete.
  `boolean`
  `cancel(boolean mayInterruptIfRunning)`
  Cancels loading the resource.
  `void`
  `complete(AsyncMedia value)`
  Sets the resource value.
  `void`
  `error(Throwable t)`
  Sets the error for this resource in the case that it could not be loaded.
  `AsyncResource<AsyncMedia>`
  `except(SuccessCallback<Throwable> callback)`
  Sets callback to run if an error occurs.
  `AsyncResource<AsyncMedia>`
  `except(SuccessCallback<Throwable> callback, EasyThread t)`
  Sets callback to run if an error occurs.
  `AsyncMedia`
  `get()`
  Gets the resource synchronously.
  `AsyncMedia`
  `get(int timeout)`
  Gets the resource synchronously.
  `AsyncMedia`
  `get(AsyncMedia defaultVal)`
  Gets the resource if it is ready.
  `boolean`
  `isCancelled()`
  Checks if the resource loading was cancelled.
  `static boolean`
  `isCancelled(Throwable t)`
  Returns true if the provided throwable was caused by a cancellation of an AsyncResource.
  `boolean`
  `isDone()`
  Checks if the resource loading is done.
  `boolean`
  `isReady()`
  Checks if the resource is ready.
  `void`
  `onResult(AsyncResult<AsyncMedia> onResult)`
  Combines ready() and except() into a single callback with 2 parameters.
  `AsyncResource<AsyncMedia>`
  `ready(SuccessCallback<AsyncMedia> callback)`
  Runs the provided callback when the resource is ready.
  `AsyncResource<AsyncMedia>`
  `ready(SuccessCallback<AsyncMedia> callback, EasyThread t)`
  Runs the provided callback when the resource is ready.
  `void`
  `waitFor()`
  Wait for loading to complete.

  ### Methods inherited from class Observable

  `addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged`
  Modifier and Type
  Method
  Description
  `void`
  `addObserver(Observer observer)`
  Adds the specified observer to the list of observers.
  `protected void`
  `clearChanged()`
  Clears the changed flag for this `Observable`.
  `int`
  `countObservers()`
  Returns the number of observers registered to this `Observable`.
  `void`
  `deleteObserver(Observer observer)`
  Removes the specified observer from the list of observers.
  `void`
  `deleteObservers()`
  Removes all observers from the list of observers.
  `boolean`
  `hasChanged()`
  Returns the changed flag for this `Observable`.
  `void`
  `notifyObservers()`
  If `hasChanged()` returns `true`, calls the `update()` method for every observer in the list of observers using null as the argument.
  `void`
  `notifyObservers(Object data)`
  If `hasChanged()` returns `true`, calls the `update()` method for every Observer in the list of observers using the specified argument.
  `protected void`
  `setChanged()`
  Sets the changed flag for this `Observable`.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
  Modifier and Type
  Method
  Description
  `protected Object`
  `clone()`
  `boolean`
  `equals(Object obj)`
  Indicates whether some other object is "equal to" this one.
  `final Class`
  `getClass()`
  Returns the runtime class of an object.
  `int`
  `hashCode()`
  Returns a hash code value for the object.
  `final void`
  `notify()`
  Wakes up a single thread that is waiting on this object's monitor.
  `final void`
  `notifyAll()`
  Wakes up all threads that are waiting on this object's monitor.
  `String`
  `toString()`
  Returns a string representation of the object.
  `final void`
  `wait()`
  Causes current thread to wait until another thread invokes the method or the method for this object.
  `final void`
  `wait(long timeout)`
  Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.
  `final void`
  `wait(long timeout, int nanos)`
  Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.

- ## Constructor Details

  - ### PauseRequest

    public PauseRequest()