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 (draft)

Entities

  1. RequestContext - shareable map with service method call implicit parameters.
  2. Interceptor - executes before call service method.
  3. Listener - called after service method

API

...

Code Block
languagejava
themeConfluence
titleInterceptor
linenumberstrue
/**
 * Service method call interceptor.
 */
public interface ServiceCallInterceptor {
    /**
     * Executes 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, ServiceRequestContext ctx);
}

...