Class PrePostConditionInterceptor
java.lang.Object
jadex.providedservice.impl.service.interceptors.AbstractApplicableInterceptor
jadex.providedservice.impl.service.interceptors.ComponentThreadInterceptor
jadex.providedservice.impl.service.interceptors.AbstractLRUApplicableInterceptor
jadex.providedservice.impl.interceptors.PrePostConditionInterceptor
- All Implemented Interfaces:
jadex.providedservice.impl.service.IServiceInvocationInterceptor
public class PrePostConditionInterceptor
extends jadex.providedservice.impl.service.interceptors.AbstractLRUApplicableInterceptor
Interceptor that checks annotated pre- and postconditions.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
Check return value, when service call is finished.static class
static class
Fetcher for pre and post condition. -
Field Summary
Fields inherited from class jadex.providedservice.impl.service.interceptors.AbstractLRUApplicableInterceptor
applicables
Fields inherited from class jadex.providedservice.impl.service.interceptors.ComponentThreadInterceptor
ia
-
Constructor Summary
ConstructorsConstructorDescriptionPrePostConditionInterceptor
(jadex.core.impl.Component ia) Create a new AbstractLRUApplicableInterceptor. -
Method Summary
Modifier and TypeMethodDescriptionprotected Exception
checkPostConditions
(jadex.providedservice.impl.service.ServiceInvocationContext context, Object res, boolean intermediate, List<Object> ires) Check the postconditions.protected RuntimeException
checkPreConditions
(jadex.providedservice.impl.service.ServiceInvocationContext context) Check the precondition.boolean
customIsApplicable
(jadex.providedservice.impl.service.ServiceInvocationContext context) Test if the interceptor is applicable.jadex.future.IFuture
<Void> execute
(jadex.providedservice.impl.service.ServiceInvocationContext context) Execute the interceptor.protected int
getKeepForPostConditions
(jadex.providedservice.impl.service.ServiceInvocationContext context) Get the number of intermediate results that should be explicitly kept by the interceptor (only necessary for subscription futures).protected boolean
isPrePostCondition
(Annotation anno) Check if an annotation belongs to the supported types of pre/postconditions.Methods inherited from class jadex.providedservice.impl.service.interceptors.AbstractLRUApplicableInterceptor
isApplicable
Methods inherited from class jadex.providedservice.impl.service.interceptors.ComponentThreadInterceptor
getComponent
-
Constructor Details
-
PrePostConditionInterceptor
public PrePostConditionInterceptor(jadex.core.impl.Component ia) Create a new AbstractLRUApplicableInterceptor.
-
-
Method Details
-
customIsApplicable
public boolean customIsApplicable(jadex.providedservice.impl.service.ServiceInvocationContext context) Test if the interceptor is applicable.- Specified by:
customIsApplicable
in classjadex.providedservice.impl.service.interceptors.AbstractLRUApplicableInterceptor
- Returns:
- True, if applicable.
-
isPrePostCondition
Check if an annotation belongs to the supported types of pre/postconditions. -
execute
public jadex.future.IFuture<Void> execute(jadex.providedservice.impl.service.ServiceInvocationContext context) Execute the interceptor.- Parameters:
context
- The invocation context.
-
checkPreConditions
protected RuntimeException checkPreConditions(jadex.providedservice.impl.service.ServiceInvocationContext context) Check the precondition. -
checkPostConditions
protected Exception checkPostConditions(jadex.providedservice.impl.service.ServiceInvocationContext context, Object res, boolean intermediate, List<Object> ires) Check the postconditions. -
getKeepForPostConditions
protected int getKeepForPostConditions(jadex.providedservice.impl.service.ServiceInvocationContext context) Get the number of intermediate results that should be explicitly kept by the interceptor (only necessary for subscription futures).
-