com.hazelcast.client.proxy

## Class ClientScheduledFutureProxy<V>

- java.lang.Object
- - com.hazelcast.client.spi.ClientProxy
  - - com.hazelcast.client.proxy.ClientScheduledFutureProxy<V>

- Type Parameters:
    `V` - the return type of the `Callable.call()`
  All Implemented Interfaces:
    DistributedObject, IScheduledFuture<V>, Comparable<Delayed>, Delayed, Future<V>, ScheduledFuture<V>

      public class ClientScheduledFutureProxy<V>
      extends ClientProxy
      implements IScheduledFuture<V>

  Proxy implementation of `IScheduledFuture`.

- - ### Field Summary

    - ### Fields inherited from class com.hazelcast.client.spi.ClientProxy

      `name`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `cancel(boolean mayInterruptIfRunning)` Attempts to cancel further scheduling of this task.
    `int` | `compareTo(Delayed o)`
    `void` | `dispose()` Used to destroy the instance of the `IScheduledFuture` in the scheduled executor.
    `V` | `get()`
    `V` | `get(long timeout, TimeUnit unit)`
    `long` | `getDelay(TimeUnit unit)`
    `ScheduledTaskHandler` | `getHandler()` Returns the scheduled future resource handler.
    `ScheduledTaskStatistics` | `getStats()` Returns the statistics and time measurement info of the execution of this scheduled future in the `IScheduledExecutorService` it was scheduled.
    `boolean` | `isCancelled()`
    `boolean` | `isDone()`

    - ### Methods inherited from class com.hazelcast.client.spi.ClientProxy

      `deregisterListener, destroy, destroyLocally, destroyRemotely, equals, getClient, getConnectedServerVersion, getContext, getDistributedObjectName, getId, getName, getPartitionKey, getSerializationService, getServiceName, hashCode, invoke, invoke, invokeOnAddress, invokeOnPartition, invokeOnPartitionInterruptibly, onDestroy, onInitialize, onShutdown, postDestroy, preDestroy, registerListener, setContext, toData, toObject`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getHandler

          public ScheduledTaskHandler getHandler()

      Description copied from interface: `IScheduledFuture`
      Returns the scheduled future resource handler. Can be used to re-acquire control of the `IScheduledFuture` using the `IScheduledExecutorService.getScheduledFuture(ScheduledTaskHandler)`
      Specified by:
        `getHandler` in interface `IScheduledFuture<V>`
      Returns:
        An instance of `ScheduledTaskHandler`, a resource handler for this scheduled future.

    - #### getStats

          public ScheduledTaskStatistics getStats()

      Description copied from interface: `IScheduledFuture`
      Returns the statistics and time measurement info of the execution of this scheduled future in the `IScheduledExecutorService` it was scheduled.
      Specified by:
        `getStats` in interface `IScheduledFuture<V>`
      Returns:
        An instance of `ScheduledTaskStatistics`, holding all stas and measurements

    - #### getDelay

          public long getDelay(TimeUnit unit)

      Specified by:
        `getDelay` in interface `Delayed`

    - #### compareTo

          public int compareTo(Delayed o)

      Specified by:
        `compareTo` in interface `Comparable<Delayed>`

    - #### cancel

          public boolean cancel(boolean mayInterruptIfRunning)

      Description copied from interface: `IScheduledFuture`
      Attempts to cancel further scheduling of this task. This attempt will fail if the task has already completed, has already been cancelled, or could not be cancelled for some other reason. If successful, and this task has not started when `cancel` is called, this task should never run.

      Warning: This cancel will not attempt to interrupt the running thread if the task is already in progress, will just cancel further scheduling.

      After this method returns, subsequent calls to `Future.isDone()` will always return `true`. Subsequent calls to `Future.isCancelled()` will always return `true` if this method returned `true`.

      Specified by:
        `cancel` in interface `IScheduledFuture<V>`
      Specified by:
        `cancel` in interface `Future<V>`
      Parameters:
        `mayInterruptIfRunning` - is throwing `UnsupportedOperationException`
      Returns:
        `false` if the task could not be cancelled, typically because it has already completed normally; {@code true

    - #### isCancelled

          public boolean isCancelled()

      Specified by:
        `isCancelled` in interface `Future<V>`

    - #### isDone

          public boolean isDone()

      Specified by:
        `isDone` in interface `Future<V>`

    - #### get

          public V get()
                throws InterruptedException,
                       ExecutionException

      Specified by:
        `get` in interface `Future<V>`
      Throws:
        `InterruptedException`
        `ExecutionException`

    - #### get

          public V get(long timeout,
                       TimeUnit unit)
                throws InterruptedException,
                       ExecutionException,
                       TimeoutException

      Specified by:
        `get` in interface `Future<V>`
      Throws:
        `InterruptedException`
        `ExecutionException`
        `TimeoutException`

    - #### dispose

          public void dispose()

      Description copied from interface: `IScheduledFuture`
      Used to destroy the instance of the `IScheduledFuture` in the scheduled executor. Once the instance is destroyed, any subsequent action on the `IScheduledFuture` will fail with an `IllegalStateException` Attempting to re-create the `IScheduledFuture` from the `IScheduledExecutorService.getScheduledFuture(ScheduledTaskHandler)` using the `IScheduledFuture.getHandler()` will succeed, but any subsequent access on that new future, will also fail with `StaleTaskException`
      Specified by:
        `dispose` in interface `IScheduledFuture<V>`

Copyright © 2019. All rights reserved.