Class DecouplingInterceptor
- java.lang.Object
-
- jadex.bridge.service.component.interceptors.AbstractMultiInterceptor
-
- jadex.bridge.service.component.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
DecouplingInterceptor.CopyReturnValueResultListener
Copy return value, when service call is finished.static class
DecouplingInterceptor.InvokeMethodStep
Service invocation step.
-
Field Summary
Fields Modifier and Type Field Description protected boolean
copy
The argument copy allowed flag.protected IExternalAccess
ea
The external access.protected IFilter
filter
The clone filter (facade for marshal).protected IInternalAccess
ia
The internal access.static java.util.Map
methodreferences
The reference method cache (method -> boolean[] (is reference)).protected static java.util.Set<java.lang.reflect.Method>
NO_DECOUPLING
The static set of no decoupling methods.protected boolean
required
Is the interceptor for a required service proxy?protected static java.util.Map<java.lang.reflect.Method,IServiceInvocationInterceptor>
SUBINTERCEPTORS
The static map of subinterceptors (method -> interceptor).
-
Constructor Summary
Constructors Constructor Description DecouplingInterceptor(IInternalAccess ia, boolean copy, boolean required)
Create a new invocation handler.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Object
doCopy(boolean copy, IFilter deffilter, java.lang.Object value)
Copy a value, if necessary.IFuture<java.lang.Void>
doExecute(ServiceInvocationContext sic)
Execute the command.IServiceInvocationInterceptor
getInterceptor(ServiceInvocationContext sic)
Get a sub interceptor for special cases.static java.util.Map<java.lang.reflect.Method,IServiceInvocationInterceptor>
getInterceptors()
Get the sub interceptors for special cases.static boolean[]
getReferenceInfo(java.lang.reflect.Method method, boolean refdef, boolean local)
Get the copy info for method parameters.ISerializationServices
getSerializationServices()
Gets the serialization services.-
Methods inherited from class jadex.bridge.service.component.interceptors.AbstractMultiInterceptor
execute, isApplicable
-
-
-
-
Field Detail
-
SUBINTERCEPTORS
protected static final java.util.Map<java.lang.reflect.Method,IServiceInvocationInterceptor> SUBINTERCEPTORS
The static map of subinterceptors (method -> interceptor).
-
NO_DECOUPLING
protected static final java.util.Set<java.lang.reflect.Method> NO_DECOUPLING
The static set of no decoupling methods.
-
methodreferences
public static final java.util.Map methodreferences
The reference method cache (method -> boolean[] (is reference)).
-
ea
protected IExternalAccess ea
The external access.
-
ia
protected IInternalAccess 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 IFilter filter
The clone filter (facade for marshal).
-
-
Constructor Detail
-
DecouplingInterceptor
public DecouplingInterceptor(IInternalAccess ia, boolean copy, boolean required)
Create a new invocation handler.
-
-
Method Detail
-
doExecute
public IFuture<java.lang.Void> doExecute(ServiceInvocationContext sic)
Execute the command.- Specified by:
doExecute
in classAbstractMultiInterceptor
- Parameters:
args
- The argument(s) for the call.- Returns:
- The result of the command.
-
getInterceptor
public IServiceInvocationInterceptor getInterceptor(ServiceInvocationContext sic)
Get a sub interceptor for special cases.- Overrides:
getInterceptor
in classAbstractMultiInterceptor
- Parameters:
sic
- The context.- Returns:
- The interceptor (if any).
-
doCopy
protected java.lang.Object doCopy(boolean copy, IFilter deffilter, java.lang.Object value)
Copy a value, if necessary.
-
getInterceptors
public static java.util.Map<java.lang.reflect.Method,IServiceInvocationInterceptor> getInterceptors()
Get the sub interceptors for special cases.
-
getSerializationServices
public final ISerializationServices getSerializationServices()
Gets the serialization services.- Parameters:
platform
- The platform ID.- Returns:
- The serialization services.
-
getReferenceInfo
public static boolean[] getReferenceInfo(java.lang.reflect.Method method, boolean refdef, boolean local)
Get the copy info for method parameters.
-
-