Class ServiceInvocationContext
java.lang.Object
jadex.providedservice.impl.service.ServiceInvocationContext
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 Summary
FieldsModifier and TypeFieldDescriptionThe invocation arguments.protected jadex.core.ComponentIdentifier
The caller component.protected ServiceCall
The current service call (to be reestablished after call).protected IServiceInvocationInterceptor[]
The service interceptors.The method to be called.protected ServiceCall
The next service call (will be current during call and last after call).The object.protected Object
The origin (proxy object).The call result.static final ThreadLocal
<ServiceInvocationContext> protected IServiceIdentifier
The stack of used interceptors. -
Constructor Summary
ConstructorsConstructorDescriptionCreate a copied context.ServiceInvocationContext
(Object proxy, Method method, IServiceInvocationInterceptor[] interceptors, IServiceIdentifier sid) Create a new context. -
Method Summary
Modifier and TypeMethodDescriptionObject[]
Get the args.Get the args.jadex.core.ComponentIdentifier
Get the caller.Get the last service call.Get the method.Get the next interceptor.Get the service call.Get the object.getProxy()
Get the proxy.Get the result.Get the service id.Get the real target object.jadex.future.IFuture
<Void> invoke()
Invoke the next interceptor.jadex.future.IFuture
<Void> Invoke the next interceptor.boolean
Test if this call is local.boolean
Test if a call is remote.protected void
pop()
Pop delete the top most set of values.protected void
Push saves and copies the current set of values.void
setArguments
(List<Object> args) Set the arguments.void
Set the method.void
setNextCall
(ServiceCall call) Set the lastcall.void
Set the object.void
Set the proxy.void
Set the result.void
Set the service id.toString()
String representation.
-
Field Details
-
SICS
-
proxy
The origin (proxy object). -
object
The object. -
method
The method to be called. -
arguments
The invocation arguments. -
result
The call result. -
interceptors
The service interceptors. -
used
The stack of used interceptors. -
nextcall
The next service call (will be current during call and last after call). -
currentcall
The current service call (to be reestablished after call). -
caller
protected jadex.core.ComponentIdentifier callerThe caller component. -
sid
-
-
Constructor Details
-
ServiceInvocationContext
public ServiceInvocationContext(Object proxy, Method method, IServiceInvocationInterceptor[] interceptors, IServiceIdentifier sid) Create a new context. -
ServiceInvocationContext
Create a copied context.
-
-
Method Details
-
getProxy
Get the proxy.- Returns:
- The proxy.
-
setProxy
Set the proxy.- Parameters:
proxy
- The proxy to set.
-
getObject
Get the object.- Returns:
- the object.
-
setObject
Set the object.- Parameters:
object
- The object to set.
-
getMethod
Get the method.- Returns:
- the method.
-
setMethod
Set the method.- Parameters:
method
- The method to set.
-
getArguments
Get the args.- Returns:
- the args.
-
getArgumentArray
Get the args.- Returns:
- the args.
-
setArguments
Set the arguments.- Parameters:
args
- The arguments to set.
-
getResult
Get the result.- Returns:
- the result.
-
setResult
Set the result.- Parameters:
result
- The result to set.
-
invoke
Invoke the next interceptor. -
getNextInterceptor
Get the next interceptor. -
invoke
Invoke the next interceptor. -
push
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
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
String representation. -
getNextServiceCall
Get the service call.- Returns:
- The service call.
-
getCurrentServiceCall
Get the last service call.- Returns:
- The last service call.
-
setNextCall
Set the lastcall.- Parameters:
currentcall
- The lastcall to set.
-
getServiceIdentifier
Get the service id. -
setServiceIdentifier
Set the service id.
-