com.hazelcast.client.proxy

## Class ClientDurableExecutorServiceProxy

- java.lang.Object
- - com.hazelcast.client.spi.ClientProxy
  - - com.hazelcast.client.proxy.ClientDurableExecutorServiceProxy

- All Implemented Interfaces:
    DistributedObject, DurableExecutorService, Executor, ExecutorService

      public final class ClientDurableExecutorServiceProxy
      extends ClientProxy
      implements DurableExecutorService

  Proxy implementation of `DurableExecutorService`.

- - ### Field Summary

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

      `name`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClientDurableExecutorServiceProxy(String serviceName, String name, ClientContext context)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `awaitTermination(long timeout, TimeUnit unit)`
    `void` | `disposeResult(long taskId)` Disposes the result with the given taskId
    `void` | `execute(Runnable task)`
    `void` | `executeOnKeyOwner(Runnable task, Object key)` Executes a task on the owner of the specified key.
    `<T> List<Future<T>>` | `invokeAll(Collection<? extends Callable<T>> tasks)`
    `<T> List<Future<T>>` | `invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)`
    `<T> T` | `invokeAny(Collection<? extends Callable<T>> tasks)`
    `<T> T` | `invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit)`
    `boolean` | `isShutdown()`
    `boolean` | `isTerminated()`
    `protected void` | `onInitialize()` Called when proxy is created.
    `<T> Future<T>` | `retrieveAndDisposeResult(long taskId)` Retrieves and disposes the result with the given taskId
    `<T> Future<T>` | `retrieveResult(long taskId)` Retrieves the result with the given taskId
    `void` | `shutdown()`
    `List<Runnable>` | `shutdownNow()`
    `<T> DurableExecutorServiceFuture<T>` | `submit(Callable<T> task)` Submits a value-returning task for execution and returns a Future representing the pending results of the task.
    `DurableExecutorServiceFuture<?>` | `submit(Runnable task)` Submits a Runnable task for execution and returns a Future representing that task.
    `<T> DurableExecutorServiceFuture<T>` | `submit(Runnable task, T result)` Submits a Runnable task for execution and returns a Future representing that task.
    `<T> DurableExecutorServiceFuture<T>` | `submitToKeyOwner(Callable<T> task, Object key)` Submits a task to the owner of the specified key and returns a Future representing that task.
    `DurableExecutorServiceFuture<?>` | `submitToKeyOwner(Runnable task, Object key)` Submits a task to the owner of the specified key and returns a Future representing that task.

    - ### 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, onShutdown, postDestroy, preDestroy, registerListener, setContext, toData, toObject`

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

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

    - ### Methods inherited from interface com.hazelcast.core.DistributedObject

      `destroy, getName, getPartitionKey, getServiceName`

- - ### Constructor Detail

    - #### ClientDurableExecutorServiceProxy

          public ClientDurableExecutorServiceProxy(String serviceName,
                                                   String name,
                                                   ClientContext context)

  - ### Method Detail

    - #### onInitialize

          protected void onInitialize()

      Description copied from class: `ClientProxy`
      Called when proxy is created. Overriding implementations can add initialization specific logic into this method like registering a listener, creating a cleanup task etc.
      Overrides:
        `onInitialize` in class `ClientProxy`

    - #### retrieveResult

          public <T> Future<T> retrieveResult(long taskId)

      Description copied from interface: `DurableExecutorService`
      Retrieves the result with the given taskId
      Specified by:
        `retrieveResult` in interface `DurableExecutorService`
      Type Parameters:
        `T` - the type of the task's result
      Parameters:
        `taskId` - combination of partitionId and sequence
      Returns:
        a Future representing pending completion of the task

    - #### disposeResult

          public void disposeResult(long taskId)

      Description copied from interface: `DurableExecutorService`
      Disposes the result with the given taskId
      Specified by:
        `disposeResult` in interface `DurableExecutorService`
      Parameters:
        `taskId` - combination of partitionId and sequence

    - #### retrieveAndDisposeResult

          public <T> Future<T> retrieveAndDisposeResult(long taskId)

      Description copied from interface: `DurableExecutorService`
      Retrieves and disposes the result with the given taskId
      Specified by:
        `retrieveAndDisposeResult` in interface `DurableExecutorService`
      Type Parameters:
        `T` - the type of the task's result
      Parameters:
        `taskId` - combination of partitionId and sequence
      Returns:
        a Future representing pending completion of the task

    - #### execute

          public void execute(Runnable task)

      Specified by:
        `execute` in interface `Executor`

    - #### executeOnKeyOwner

          public void executeOnKeyOwner(Runnable task,
                                        Object key)

      Description copied from interface: `DurableExecutorService`
      Executes a task on the owner of the specified key.
      Specified by:
        `executeOnKeyOwner` in interface `DurableExecutorService`
      Parameters:
        `task` - a task executed on the owner of the specified key
        `key` - the specified key

    - #### submitToKeyOwner

          public <T> DurableExecutorServiceFuture<T> submitToKeyOwner(Callable<T> task,
                                                                      Object key)

      Description copied from interface: `DurableExecutorService`
      Submits a task to the owner of the specified key and returns a Future representing that task.
      Specified by:
        `submitToKeyOwner` in interface `DurableExecutorService`
      Parameters:
        `task` - task submitted to the owner of the specified key
        `key` - the specified key
      Returns:
        a Future representing pending completion of the task

    - #### submitToKeyOwner

          public DurableExecutorServiceFuture<?> submitToKeyOwner(Runnable task,
                                                                  Object key)

      Description copied from interface: `DurableExecutorService`
      Submits a task to the owner of the specified key and returns a Future representing that task.
      Specified by:
        `submitToKeyOwner` in interface `DurableExecutorService`
      Parameters:
        `task` - task submitted to the owner of the specified key
        `key` - the specified key
      Returns:
        a Future representing pending completion of the task

    - #### submit

          public <T> DurableExecutorServiceFuture<T> submit(Callable<T> task)

      Description copied from interface: `DurableExecutorService`
      Submits a value-returning task for execution and returns a Future representing the pending results of the task. The Future's `get` method will return the task's result upon successful completion.

      If you would like to immediately block waiting for a task, you can use constructions of the form `result = exec.submit(aCallable).get();`

      Note: The `Executors` class includes a set of methods that can convert some other common closure-like objects, for example, `PrivilegedAction` to `Callable` form so they can be submitted.

      Specified by:
        `submit` in interface `DurableExecutorService`
      Specified by:
        `submit` in interface `ExecutorService`
      Type Parameters:
        `T` - the type of the task's result
      Parameters:
        `task` - the task to submit
      Returns:
        a Future representing pending completion of the task

    - #### submit

          public <T> DurableExecutorServiceFuture<T> submit(Runnable task,
                                                            T result)

      Description copied from interface: `DurableExecutorService`
      Submits a Runnable task for execution and returns a Future representing that task. The Future's `get` method will return the given result upon successful completion.
      Specified by:
        `submit` in interface `DurableExecutorService`
      Specified by:
        `submit` in interface `ExecutorService`
      Type Parameters:
        `T` - the type of the result
      Parameters:
        `task` - the task to submit
        `result` - the result to return
      Returns:
        a Future representing pending completion of the task

    - #### submit

          public DurableExecutorServiceFuture<?> submit(Runnable task)

      Description copied from interface: `DurableExecutorService`
      Submits a Runnable task for execution and returns a Future representing that task. The Future's `get` method will return `null` upon successful completion.
      Specified by:
        `submit` in interface `DurableExecutorService`
      Specified by:
        `submit` in interface `ExecutorService`
      Parameters:
        `task` - the task to submit
      Returns:
        a Future representing pending completion of the task

    - #### invokeAll

          public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks)
                                        throws InterruptedException

      Specified by:
        `invokeAll` in interface `ExecutorService`
      Throws:
        `InterruptedException`

    - #### invokeAll

          public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks,
                                               long timeout,
                                               TimeUnit unit)
                                        throws InterruptedException

      Specified by:
        `invokeAll` in interface `ExecutorService`
      Throws:
        `InterruptedException`

    - #### invokeAny

          public <T> T invokeAny(Collection<? extends Callable<T>> tasks)
                          throws InterruptedException,
                                 ExecutionException

      Specified by:
        `invokeAny` in interface `ExecutorService`
      Throws:
        `InterruptedException`
        `ExecutionException`

    - #### invokeAny

          public <T> T invokeAny(Collection<? extends Callable<T>> tasks,
                                 long timeout,
                                 TimeUnit unit)
                          throws InterruptedException,
                                 ExecutionException,
                                 TimeoutException

      Specified by:
        `invokeAny` in interface `ExecutorService`
      Throws:
        `InterruptedException`
        `ExecutionException`
        `TimeoutException`

    - #### awaitTermination

          public boolean awaitTermination(long timeout,
                                          TimeUnit unit)
                                   throws InterruptedException

      Specified by:
        `awaitTermination` in interface `ExecutorService`
      Throws:
        `InterruptedException`

    - #### shutdown

          public void shutdown()

      Specified by:
        `shutdown` in interface `ExecutorService`

    - #### shutdownNow

          public List<Runnable> shutdownNow()

      Specified by:
        `shutdownNow` in interface `ExecutorService`

    - #### isShutdown

          public boolean isShutdown()

      Specified by:
        `isShutdown` in interface `ExecutorService`

    - #### isTerminated

          public boolean isTerminated()

      Specified by:
        `isTerminated` in interface `ExecutorService`

Copyright © 2018. All rights reserved.