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 classCheck return value, when service call is finished.static classstatic classFetcher for pre and post condition. -
Field Summary
Fields inherited from class jadex.providedservice.impl.service.interceptors.AbstractLRUApplicableInterceptor
applicablesFields 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 ExceptioncheckPostConditions(jadex.providedservice.impl.service.ServiceInvocationContext context, Object res, boolean intermediate, List<Object> ires) Check the postconditions.protected RuntimeExceptioncheckPreConditions(jadex.providedservice.impl.service.ServiceInvocationContext context) Check the precondition.booleancustomIsApplicable(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 intgetKeepForPostConditions(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 booleanisPrePostCondition(Annotation anno) Check if an annotation belongs to the supported types of pre/postconditions.Methods inherited from class jadex.providedservice.impl.service.interceptors.AbstractLRUApplicableInterceptor
isApplicableMethods 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:
customIsApplicablein 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).
-