Interface Invokable

  • All Known Implementing Classes:
    MemoryAgent, RemoteAgent

    public interface Invokable
    Interface representing an invokable service agent.
    Version:
    0.5
    Author:
    Mike
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default java.util.Map<java.lang.String,​java.lang.Object> getParamSpec​(Operation op)
      Gets the parameter specification for this Invokable service given the specified operation
      Job<java.util.Map<java.lang.String,​java.lang.Object>> invoke​(Operation operation, java.lang.Object... params)
      Invokes the specified operation on this agent.
      Job<java.util.Map<java.lang.String,​java.lang.Object>> invoke​(Operation operation, java.util.Map<java.lang.String,​java.lang.Object> params)
      Invokes the specified operation on this agent.
      Job<java.util.Map<java.lang.String,​java.lang.Object>> invokeAsync​(Operation operation, java.util.Map<java.lang.String,​java.lang.Object> params)
      Invokes this operation with the given named parameters.
    • Method Detail

      • invoke

        Job<java.util.Map<java.lang.String,​java.lang.Object>> invoke​(Operation operation,
                                                                           java.lang.Object... params)
        Invokes the specified operation on this agent. If the invoke is successfully launched, will return a Job instance that can be used to access the result, otherwise throws an exception.
        Parameters:
        operation - The operation to invoke on this agent
        params - Positional parameters for the invoke operation
        Returns:
        A Job instance allowing access to the invoke job status and result
      • invoke

        Job<java.util.Map<java.lang.String,​java.lang.Object>> invoke​(Operation operation,
                                                                           java.util.Map<java.lang.String,​java.lang.Object> params)
        Invokes the specified operation on this agent. If the invoke is successfully launched, will return a Job instance that can be used to access the result, otherwise throws an exception.
        Parameters:
        operation - The operation to invoke on this agent
        params - Named parameters for the invoke operation
        Returns:
        A Job instance allowing access to the invoke job status and result
      • getParamSpec

        default java.util.Map<java.lang.String,​java.lang.Object> getParamSpec​(Operation op)
        Gets the parameter specification for this Invokable service given the specified operation
        Parameters:
        op - The operation for which to obtain the parameter specification
        Returns:
        A map of parameter names to parameter specs
        Throws:
        java.lang.UnsupportedOperationException - if this service cannot support the given operation
      • invokeAsync

        Job<java.util.Map<java.lang.String,​java.lang.Object>> invokeAsync​(Operation operation,
                                                                                java.util.Map<java.lang.String,​java.lang.Object> params)
        Invokes this operation with the given named parameters. Operations should override this method to provide an implementation of asynchronous invocation via the Job interface
        Parameters:
        params - Positional parameters for this invoke job
        operation - The operation for which to obtain the parameter specification
        Returns:
        The Job for this invoked operation
        Throws:
        java.lang.IllegalArgumentException - if required parameters are not available, or of incorrect type