Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Ability to pass custom context from caller to service (similar to HTTP request headers).
  2. Ability to define custom interceptors for service calls.

Suggested design

// Provide the design of the solution.TBD

Code Block
languagejava
themeConfluence
titleInterceptor
linenumberstrue
/**
 * Service method call interceptor.
 */
public interface ServiceCallInterceptor {
    /**
     * Invokes before service method invocation.
     *
     * @param mtdName Method name.
     * @param args Method arguments.
     * @param ctx Service request context.
     * @return Listener of the call result or {@code null}.
     */
    public @Nullable ServiceCallListener intercept(String mtdName, Object[] args, Map<String, Object> ctx);
}


Code Block
languagejava
themeConfluence
titleListener
linenumberstrue
/**
 * Listener of the service method invocation.
 */
public interface ServiceCallListener {
    /**
     *
     * @param res Service method call result, if any.
     * @param t Error, if any.
     */
    public void onComplete(@Nullable Object res, @Nullable Throwable t);
}

Risks and Assumptions

// Describe project risks, such as API or binary compatibility issues, major protocol changes, etc.

...