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)

...

Implementation entities

  1. RequestContext - shareable map with service method call implicit parameters mutable map of custom parameters to be implicitly passed to the service.
  2. Interceptor - executes before call service method.
  3. Listener - called after service method

Java 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);
}

...