Class PrePostConditionInterceptor
- java.lang.Object
 - 
- jadex.bridge.service.component.interceptors.AbstractApplicableInterceptor
 - 
- jadex.bridge.service.component.interceptors.ComponentThreadInterceptor
 - 
- jadex.bridge.service.component.interceptors.AbstractLRUApplicableInterceptor
 - 
- jadex.bridge.service.component.interceptors.PrePostConditionInterceptor
 
 
 
 
 
- 
- All Implemented Interfaces:
 IServiceInvocationInterceptor
public class PrePostConditionInterceptor extends AbstractLRUApplicableInterceptor
Interceptor that checks annotated pre- and postconditions. 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classPrePostConditionInterceptor.CheckReturnValueResultListenerCheck return value, when service call is finished.static classPrePostConditionInterceptor.IntermediateResultUnavailableExceptionstatic classPrePostConditionInterceptor.PrePostConditionFetcherFetcher for pre and post condition. 
- 
Field Summary
- 
Fields inherited from class jadex.bridge.service.component.interceptors.AbstractLRUApplicableInterceptor
applicables 
- 
Fields inherited from class jadex.bridge.service.component.interceptors.ComponentThreadInterceptor
ia 
 - 
 
- 
Constructor Summary
Constructors Constructor Description PrePostConditionInterceptor(IInternalAccess ia)Create a new AbstractLRUApplicableInterceptor. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.ExceptioncheckPostConditions(ServiceInvocationContext context, java.lang.Object res, boolean intermediate, java.util.List<java.lang.Object> ires)Check the postconditions.protected java.lang.RuntimeExceptioncheckPreConditions(ServiceInvocationContext context)Check the precondition.booleancustomIsApplicable(ServiceInvocationContext context)Test if the interceptor is applicable.IFuture<java.lang.Void>execute(ServiceInvocationContext context)Execute the interceptor.protected intgetKeepForPostConditions(ServiceInvocationContext context)Get the number of intermediate results that should be explicitly kept by the interceptor (only necessary for subscription futures).protected booleanisPrePostCondition(java.lang.annotation.Annotation anno)Check if an annotation belongs to the supported types of pre/postconditions.- 
Methods inherited from class jadex.bridge.service.component.interceptors.AbstractLRUApplicableInterceptor
isApplicable 
- 
Methods inherited from class jadex.bridge.service.component.interceptors.ComponentThreadInterceptor
getComponent 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
PrePostConditionInterceptor
public PrePostConditionInterceptor(IInternalAccess ia)
Create a new AbstractLRUApplicableInterceptor. 
 - 
 
- 
Method Detail
- 
customIsApplicable
public boolean customIsApplicable(ServiceInvocationContext context)
Test if the interceptor is applicable.- Specified by:
 customIsApplicablein classAbstractLRUApplicableInterceptor- Returns:
 - True, if applicable.
 
 
- 
isPrePostCondition
protected boolean isPrePostCondition(java.lang.annotation.Annotation anno)
Check if an annotation belongs to the supported types of pre/postconditions. 
- 
execute
public IFuture<java.lang.Void> execute(ServiceInvocationContext context)
Execute the interceptor.- Parameters:
 context- The invocation context.
 
- 
checkPreConditions
protected java.lang.RuntimeException checkPreConditions(ServiceInvocationContext context)
Check the precondition. 
- 
checkPostConditions
protected java.lang.Exception checkPostConditions(ServiceInvocationContext context, java.lang.Object res, boolean intermediate, java.util.List<java.lang.Object> ires)
Check the postconditions. 
- 
getKeepForPostConditions
protected int getKeepForPostConditions(ServiceInvocationContext context)
Get the number of intermediate results that should be explicitly kept by the interceptor (only necessary for subscription futures). 
 - 
 
 -