Class DecouplingInterceptor

java.lang.Object
jadex.providedservice.impl.service.interceptors.AbstractMultiInterceptor
jadex.providedservice.impl.service.interceptors.DecouplingInterceptor
All Implemented Interfaces:
IServiceInvocationInterceptor

public class DecouplingInterceptor extends AbstractMultiInterceptor
Invocation interceptor for executing a call on the underlying component thread. It checks whether the call can be decoupled (has void or IFuture return type) and the invoking thread is not already the component thread. todo: what about synchronous calls that change the object state. These calls could damage the service state.
  • Field Details

    • SUBINTERCEPTORS

      protected static final Map<Method,IServiceInvocationInterceptor> SUBINTERCEPTORS
      The static map of subinterceptors (method -> interceptor).
    • NO_DECOUPLING

      protected static final Set<Method> NO_DECOUPLING
      The static set of no decoupling methods.
    • methodreferences

      public static final Map methodreferences
      The reference method cache (method -> boolean[] (is reference)).
    • ia

      protected jadex.core.impl.Component ia
      The internal access.
    • required

      protected boolean required
      Is the interceptor for a required service proxy?
    • copy

      protected boolean copy
      The argument copy allowed flag.
    • filter

      protected jadex.common.IFilter filter
      The clone filter (facade for marshal).
  • Constructor Details

    • DecouplingInterceptor

      public DecouplingInterceptor(jadex.core.impl.Component ia, boolean copy, boolean required)
      Create a new invocation handler.
  • Method Details

    • doExecute

      public jadex.future.IFuture<Void> doExecute(ServiceInvocationContext sic)
      Execute the command.
      Specified by:
      doExecute in class AbstractMultiInterceptor
      Parameters:
      args - The argument(s) for the call.
      Returns:
      The result of the command.
    • getInterceptor

      Get a sub interceptor for special cases.
      Overrides:
      getInterceptor in class AbstractMultiInterceptor
      Parameters:
      sic - The context.
      Returns:
      The interceptor (if any).
    • doCopy

      protected Object doCopy(boolean copy, jadex.common.IFilter deffilter, Object value)
      Copy a value, if necessary.
    • getInterceptors

      public static Map<Method,IServiceInvocationInterceptor> getInterceptors()
      Get the sub interceptors for special cases.
    • getSerializationServices

      public final jadex.serialization.ISerializationServices getSerializationServices()
      Gets the serialization services.
      Parameters:
      platform - The platform ID.
      Returns:
      The serialization services.
    • getReferenceInfo

      public static boolean[] getReferenceInfo(Method method, boolean refdef, boolean local)
      Get the copy info for method parameters.