Class ServiceInvocationContext

java.lang.Object
jadex.providedservice.impl.service.ServiceInvocationContext

public class ServiceInvocationContext extends Object
Context for service invocations. Contains all method call information. Invariants that must hold before, during and after a service call for the NEXT/CUR/LAST service calls caller callee before next = null || user defined cur = actual call during next = null (set in ServiceInvocContext) cur = next cur = cur (same as in before) (set in MethodInvocationInterceptor) after next = null cur = cur (same as in before) last = next (set in MethodInvocationInterceptor)
  • Field Details

    • SICS

      public static final ThreadLocal<ServiceInvocationContext> SICS
    • proxy

      protected Object proxy
      The origin (proxy object).
    • object

      protected List<Object> object
      The object.
    • method

      protected List<Method> method
      The method to be called.
    • arguments

      protected List<List<Object>> arguments
      The invocation arguments.
    • result

      protected List<Object> result
      The call result.
    • interceptors

      protected IServiceInvocationInterceptor[] interceptors
      The service interceptors.
    • used

      protected List<Integer> used
      The stack of used interceptors.
    • nextcall

      protected ServiceCall nextcall
      The next service call (will be current during call and last after call).
    • currentcall

      protected ServiceCall currentcall
      The current service call (to be reestablished after call).
    • caller

      protected jadex.core.ComponentIdentifier caller
      The caller component.
    • sid

      protected IServiceIdentifier sid
  • Constructor Details

  • Method Details

    • getProxy

      public Object getProxy()
      Get the proxy.
      Returns:
      The proxy.
    • setProxy

      public void setProxy(Object proxy)
      Set the proxy.
      Parameters:
      proxy - The proxy to set.
    • getObject

      public Object getObject()
      Get the object.
      Returns:
      the object.
    • setObject

      public void setObject(Object object)
      Set the object.
      Parameters:
      object - The object to set.
    • getMethod

      public Method getMethod()
      Get the method.
      Returns:
      the method.
    • setMethod

      public void setMethod(Method method)
      Set the method.
      Parameters:
      method - The method to set.
    • getArguments

      public List<Object> getArguments()
      Get the args.
      Returns:
      the args.
    • getArgumentArray

      public Object[] getArgumentArray()
      Get the args.
      Returns:
      the args.
    • setArguments

      public void setArguments(List<Object> args)
      Set the arguments.
      Parameters:
      args - The arguments to set.
    • getResult

      public Object getResult()
      Get the result.
      Returns:
      the result.
    • setResult

      public void setResult(Object result)
      Set the result.
      Parameters:
      result - The result to set.
    • invoke

      public jadex.future.IFuture<Void> invoke(Object object, Method method, List<Object> args)
      Invoke the next interceptor.
    • getNextInterceptor

      public IServiceInvocationInterceptor getNextInterceptor()
      Get the next interceptor.
    • invoke

      public jadex.future.IFuture<Void> invoke()
      Invoke the next interceptor.
    • push

      protected void push(Object o, Method m, List<Object> args, Object res)
      Push saves and copies the current set of values.
    • pop

      protected void pop()
      Pop delete the top most set of values.
    • isLocalCall

      public boolean isLocalCall()
      Test if this call is local.
      Returns:
      True, if it is a local call.
    • isRemoteCall

      public boolean isRemoteCall()
      Test if a call is remote.
      Parameters:
      sic - The service invocation context.
    • getTargetObject

      public Object getTargetObject()
      Get the real target object. Returns domain service in case of service info.
    • getCaller

      public jadex.core.ComponentIdentifier getCaller()
      Get the caller.
      Returns:
      The caller.
    • toString

      public String toString()
      String representation.
      Overrides:
      toString in class Object
    • getNextServiceCall

      public ServiceCall getNextServiceCall()
      Get the service call.
      Returns:
      The service call.
    • getCurrentServiceCall

      public ServiceCall getCurrentServiceCall()
      Get the last service call.
      Returns:
      The last service call.
    • setNextCall

      public void setNextCall(ServiceCall call)
      Set the lastcall.
      Parameters:
      currentcall - The lastcall to set.
    • getServiceIdentifier

      public IServiceIdentifier getServiceIdentifier()
      Get the service id.
    • setServiceIdentifier

      public void setServiceIdentifier(IServiceIdentifier sid)
      Set the service id.