Package com.tick42.glue.core.interop.discovery

# Class MethodSearch<R>

java.lang.Object
com.tick42.glue.core.interop.discovery.MethodSearch<R>

All Implemented Interfaces:
  `AsynchronousCloseable`, `Search<ServerMethod>`, `AutoCloseable`

    public final class MethodSearch<R>
    extends Object
    implements Search<ServerMethod>

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `CompletionStage<Collection<ServerMethod>>` | `all()` | Retrieves all elements matching the search criteria.
  `CompletionStage<ServerMethod>` | `any()` | Retrieves any one of the elements from a set matching the search criteria.
  `CompletionStage<Void>` | `closeAsync()` | Initiates a shutdown.
  `<T> CompletionStage<MethodInvocationResult<R>>` | `invoke​(T arg, InvocationOptions options)` | Invokes any one of the methods matching the search criteria with the designated invocation arguments and options.
  `<T> CompletionStage<MethodInvocationResult<R>>` | `invokeAll​(T arg, InvocationOptions options)` | Invokes all methods that match the search criteria with the designated invocation arguments and options.
  `CompletionStage<Void>` | `onClose()` | Return a stage that will complete when `AsynchronousCloseable.closeAsync()` is called and shutdown completes.
  `<T> CompletionStage<StreamPublisher<R>>` | `stream​(T arg)` |

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

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface com.tick42.glue.core.AsynchronousCloseable

  `close`

  ### Methods inherited from interface com.tick42.glue.core.interop.discovery.Search

  `all, any`

- ## Method Details

  - ### onClose

    public CompletionStage<Void> onClose()
    Description copied from interface: `AsynchronousCloseable`
    Return a stage that will complete when `AsynchronousCloseable.closeAsync()` is called and shutdown completes.
    Specified by:
      `onClose` in interface `AsynchronousCloseable`
    Returns:
      a stage that will complete when shutdown is complete, never `null`

  - ### closeAsync

    public CompletionStage<Void> closeAsync()
    Description copied from interface: `AsynchronousCloseable`
    Initiates a shutdown.
    Specified by:
      `closeAsync` in interface `AsynchronousCloseable`
    Returns:
      a stage that will complete when shutdown is complete, never `null`

  - ### invoke

    public <T> CompletionStage<MethodInvocationResult<R>> invoke​(T arg, InvocationOptions options)
    Invokes any one of the methods matching the search criteria with the designated invocation arguments and options.
    Type Parameters:
      `T` - type of the invocation arguments
    Parameters:
      `arg` - invocation arguments
      `options` - invocation options
    Returns:
      a stage that will complete when all method invocations have completed, never `null`

  - ### invokeAll

    public <T> CompletionStage<MethodInvocationResult<R>> invokeAll​(T arg, InvocationOptions options)
    Invokes all methods that match the search criteria with the designated invocation arguments and options.
    Type Parameters:
      `T` - type of the invocation arguments
    Parameters:
      `arg` - invocation arguments
      `options` - invocation options
    Returns:
      a stage that will complete upon method invocation completion, never `null`
    Since:
      1.3

  - ### stream

    public <T> CompletionStage<StreamPublisher<R>> stream​(T arg)

  - ### all

    public CompletionStage<Collection<ServerMethod>> all()
    Description copied from interface: `Search`
    Retrieves all elements matching the search criteria.
    Specified by:
      `all` in interface `Search<K>`
    Returns:
      a stage that will complete with the first batch of matching elements, never `null`

  - ### any

    public CompletionStage<ServerMethod> any()
    Description copied from interface: `Search`
    Retrieves any one of the elements from a set matching the search criteria.
    Specified by:
      `any` in interface `Search<K>`
    Returns:
      a stage that completes with any one of the matching elements, never `null`