Enum Class Dispatch.Type

java.lang.Object
java.lang.Enum<Dispatch.Type>
dev.getelements.elements.rt.annotation.Dispatch.Type
All Implemented Interfaces:
Serializable, Comparable<Dispatch.Type>, Constable
Enclosing class:
Dispatch

public static enum Dispatch.Type extends Enum<Dispatch.Type>
The dispatch type.
  • Enum Constant Details

    • SYNCHRONOUS

      public static final Dispatch.Type SYNCHRONOUS
      The method is dispatched, blocking until the method returns or an exception is thrown. This mode is automatically selected if a Method returns an object and neither ResultHandler or ErrorHandler are specified in the parameters. This implies that the return type must be serializable. The invocation will block until the remote end produces a result and returns the value.
    • ASYNCHRONOUS

      public static final Dispatch.Type ASYNCHRONOUS
      The method is dispatched, returning immediately and deferring the driving of results to a background process Which will call the associated ErrorHandler and ResultHandler parameters. This mode is automatically selected if a Method returns void and has both a ResultHandler and ErrorHandler specified in the parameters. This implies that the return type must be serializable.
    • FUTURE

      public static final Dispatch.Type FUTURE
      This behaves similar to SYNCHRONOUS, except the calling method must return some type of Future<?>. The result is obtained through Future.get(), or ExecutionException in the event of a failure. The method may use ResultHandler or ErrorHandler to receive results in addition to the returned Future, and may be independent results. On the client side, either ResultHandler or ErrorHandler may be used to receive the result. The client method invocation will not block and instead return an instance of Future which will be used to dispatch the remote invocation.
    • HYBRID

      public static final Dispatch.Type HYBRID
      This is a type of method that doesn't exactly fit in the other categories. Depending on the context, a method of this type may pick one of the other strategies to do the invocation. Underlying connection details may affect the actual behavior of the method. Usage of this type is discouraged and will generate warnings in logs.
    • CONSUMER

      @Deprecated public static final Dispatch.Type CONSUMER
      Deprecated.
      Renamed to HYBRID.
  • Method Details

    • values

      public static Dispatch.Type[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Dispatch.Type valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • determine

      public static Dispatch.Type determine(Method method)
      Inspects the supplied Method and determines the type of dispatch used. If not specified, then this method infers the type automatically.
      Parameters:
      method -
      Returns:
      the Dispatch.Type