Package jadex.bridge.service.component
Class ServiceInvocationContext
- java.lang.Object
- 
- jadex.bridge.service.component.ServiceInvocationContext
 
- 
 public class ServiceInvocationContext extends java.lang.ObjectContext 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 SummaryFields Modifier and Type Field Description protected java.util.List<java.util.List<java.lang.Object>>argumentsThe invocation arguments.protected IComponentIdentifiercallerThe caller component.protected static java.util.Map<IComponentIdentifier,java.util.Map<java.lang.reflect.Method,java.lang.Integer>>callsService calls per method, calculated separately per platform.protected ServiceCallcurrentcallThe current service call (to be reestablished after call).protected IServiceInvocationInterceptor[]interceptorsThe service interceptors.protected java.util.List<java.lang.reflect.Method>methodThe method to be called.protected ServiceCallnextcallThe next service call (will be current during call and last after call).protected java.util.List<java.lang.Object>objectThe object.protected IComponentIdentifierplatformThe platform identifier.static longPRINT_DELAYPrint every 10 seconds.static booleanPROFILINGEnable call profiling.protected java.lang.ObjectproxyThe origin (proxy object).protected java.util.List<java.lang.Object>resultThe call result.static java.lang.ThreadLocal<ServiceInvocationContext>SICSprotected IServiceIdentifiersidprotected java.util.List<java.lang.Integer>usedThe stack of used interceptors.
 - 
Constructor SummaryConstructors Constructor Description ServiceInvocationContext(ServiceInvocationContext context)Create a copied context.ServiceInvocationContext(java.lang.Object proxy, java.lang.reflect.Method method, IServiceInvocationInterceptor[] interceptors, IComponentIdentifier platform, IServiceIdentifier sid)Create a new context.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object[]getArgumentArray()Get the args.java.util.List<java.lang.Object>getArguments()Get the args.IComponentIdentifiergetCaller()Get the caller.ServiceCallgetCurrentServiceCall()Get the last service call.java.lang.reflect.MethodgetMethod()Get the method.IServiceInvocationInterceptorgetNextInterceptor()Get the next interceptor.ServiceCallgetNextServiceCall()Get the service call.java.lang.ObjectgetObject()Get the object.java.lang.ObjectgetProxy()Get the proxy.java.lang.ObjectgetResult()Get the result.IServiceIdentifiergetServiceIdentifier()Get the service id.java.lang.ObjectgetTargetObject()Get the real target object.IFuture<java.lang.Void>invoke()Invoke the next interceptor.IFuture<java.lang.Void>invoke(java.lang.Object object, java.lang.reflect.Method method, java.util.List<java.lang.Object> args)Invoke the next interceptor.booleanisRemoteCall()Test if a call is remote.protected voidpop()Pop delete the top most set of values.protected voidpush(java.lang.Object o, java.lang.reflect.Method m, java.util.List<java.lang.Object> args, java.lang.Object res)Push saves and copies the current set of values.voidsetArguments(java.util.List<java.lang.Object> args)Set the arguments.voidsetMethod(java.lang.reflect.Method method)Set the method.voidsetNextCall(ServiceCall call)Set the lastcall.voidsetObject(java.lang.Object object)Set the object.voidsetProxy(java.lang.Object proxy)Set the proxy.voidsetResult(java.lang.Object result)Set the result.voidsetServiceIdentifier(IServiceIdentifier sid)Set the service id.java.lang.StringtoString()String representation.
 
- 
- 
- 
Field Detail- 
SICSpublic static final java.lang.ThreadLocal<ServiceInvocationContext> SICS 
 - 
PROFILINGpublic static final boolean PROFILING Enable call profiling.- See Also:
- Constant Field Values
 
 - 
PRINT_DELAYpublic static final long PRINT_DELAY Print every 10 seconds.- See Also:
- Constant Field Values
 
 - 
callsprotected static java.util.Map<IComponentIdentifier,java.util.Map<java.lang.reflect.Method,java.lang.Integer>> calls Service calls per method, calculated separately per platform.
 - 
proxyprotected java.lang.Object proxy The origin (proxy object).
 - 
objectprotected java.util.List<java.lang.Object> object The object.
 - 
methodprotected java.util.List<java.lang.reflect.Method> method The method to be called.
 - 
argumentsprotected java.util.List<java.util.List<java.lang.Object>> arguments The invocation arguments.
 - 
resultprotected java.util.List<java.lang.Object> result The call result.
 - 
interceptorsprotected IServiceInvocationInterceptor[] interceptors The service interceptors.
 - 
usedprotected java.util.List<java.lang.Integer> used The stack of used interceptors.
 - 
nextcallprotected ServiceCall nextcall The next service call (will be current during call and last after call).
 - 
currentcallprotected ServiceCall currentcall The current service call (to be reestablished after call).
 - 
callerprotected IComponentIdentifier caller The caller component.
 - 
platformprotected IComponentIdentifier platform The platform identifier.
 - 
sidprotected IServiceIdentifier sid 
 
- 
 - 
Constructor Detail- 
ServiceInvocationContextpublic ServiceInvocationContext(java.lang.Object proxy, java.lang.reflect.Method method, IServiceInvocationInterceptor[] interceptors, IComponentIdentifier platform, IServiceIdentifier sid)Create a new context.
 - 
ServiceInvocationContextpublic ServiceInvocationContext(ServiceInvocationContext context) Create a copied context.
 
- 
 - 
Method Detail- 
getProxypublic java.lang.Object getProxy() Get the proxy.- Returns:
- The proxy.
 
 - 
setProxypublic void setProxy(java.lang.Object proxy) Set the proxy.- Parameters:
- proxy- The proxy to set.
 
 - 
getObjectpublic java.lang.Object getObject() Get the object.- Returns:
- the object.
 
 - 
setObjectpublic void setObject(java.lang.Object object) Set the object.- Parameters:
- object- The object to set.
 
 - 
getMethodpublic java.lang.reflect.Method getMethod() Get the method.- Returns:
- the method.
 
 - 
setMethodpublic void setMethod(java.lang.reflect.Method method) Set the method.- Parameters:
- method- The method to set.
 
 - 
getArgumentspublic java.util.List<java.lang.Object> getArguments() Get the args.- Returns:
- the args.
 
 - 
getArgumentArraypublic java.lang.Object[] getArgumentArray() Get the args.- Returns:
- the args.
 
 - 
setArgumentspublic void setArguments(java.util.List<java.lang.Object> args) Set the arguments.- Parameters:
- args- The arguments to set.
 
 - 
getResultpublic java.lang.Object getResult() Get the result.- Returns:
- the result.
 
 - 
setResultpublic void setResult(java.lang.Object result) Set the result.- Parameters:
- result- The result to set.
 
 - 
invokepublic IFuture<java.lang.Void> invoke(java.lang.Object object, java.lang.reflect.Method method, java.util.List<java.lang.Object> args) Invoke the next interceptor.
 - 
getNextInterceptorpublic IServiceInvocationInterceptor getNextInterceptor() Get the next interceptor.
 - 
invokepublic IFuture<java.lang.Void> invoke() Invoke the next interceptor.
 - 
pushprotected void push(java.lang.Object o, java.lang.reflect.Method m, java.util.List<java.lang.Object> args, java.lang.Object res)Push saves and copies the current set of values.
 - 
popprotected void pop() Pop delete the top most set of values.
 - 
isRemoteCallpublic boolean isRemoteCall() Test if a call is remote.
 - 
getTargetObjectpublic java.lang.Object getTargetObject() Get the real target object. Returns domain service in case of service info.
 - 
getCallerpublic IComponentIdentifier getCaller() Get the caller.- Returns:
- The caller.
 
 - 
toStringpublic java.lang.String toString() String representation.- Overrides:
- toStringin class- java.lang.Object
 
 - 
getNextServiceCallpublic ServiceCall getNextServiceCall() Get the service call.- Returns:
- The service call.
 
 - 
getCurrentServiceCallpublic ServiceCall getCurrentServiceCall() Get the last service call.- Returns:
- The last service call.
 
 - 
setNextCallpublic void setNextCall(ServiceCall call) Set the lastcall.- Parameters:
- currentcall- The lastcall to set.
 
 - 
getServiceIdentifierpublic IServiceIdentifier getServiceIdentifier() Get the service id.
 - 
setServiceIdentifierpublic void setServiceIdentifier(IServiceIdentifier sid) Set the service id.
 
- 
 
-