Package org.ehrbase.plugin
Class AbstractPluginAspect<EXTENSIONPOINT>
java.lang.Object
org.ehrbase.plugin.AbstractPluginAspect<EXTENSIONPOINT>
- Direct Known Subclasses:
CompositionPluginAspect,EhrPluginAspect,QueryPluginAspect,TemplatePluginAspect
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.springframework.beans.factory.ListableBeanFactory -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractPluginAspect(org.springframework.beans.factory.ListableBeanFactory beanFactory, Class<EXTENSIONPOINT> clazz) -
Method Summary
Modifier and TypeMethodDescriptionprotected List<EXTENSIONPOINT> voidprotected ObjectProceed with Error handling.protected <IN,OUT> OUT proceedWithPluginExtensionPoints(org.aspectj.lang.ProceedingJoinPoint pjp, org.apache.commons.lang3.function.TriFunction<EXTENSIONPOINT, IN, Function<IN, OUT>, OUT> extensionPointMethod, Function<Object[], IN> argsToInputObj, BiFunction<IN, Object[], Object[]> setArgs) Proceeds with the invocation by calling the given method on all extension points in ascending order and then the service method (analog to Spring AOP aspects behaviour).protected <IN,OUT> OUT proceedWithPluginExtensionPoints(org.aspectj.lang.ProceedingJoinPoint pjp, org.apache.commons.lang3.function.TriFunction<EXTENSIONPOINT, IN, Function<IN, OUT>, OUT> extensionPointMethod, Function<Object[], IN> argsToInputObj, BiFunction<IN, Object[], Object[]> setArgs, Function<Object, OUT> afterProceed) Proceeds with the invocation by calling the given method on all extension points in ascending order and then the service method (analog to Spring AOP aspects behaviour).
-
Field Details
-
beanFactory
protected final org.springframework.beans.factory.ListableBeanFactory beanFactory
-
-
Constructor Details
-
AbstractPluginAspect
protected AbstractPluginAspect(org.springframework.beans.factory.ListableBeanFactory beanFactory, Class<EXTENSIONPOINT> clazz)
-
-
Method Details
-
inServiceLayerPC
public void inServiceLayerPC() -
proceed
Proceed with Error handling.- Parameters:
pjp-args-- Returns:
-
getActiveExtensionPointsOrderedDesc
- Returns:
- Order List of
CompositionExtensionPointin Context.
-
proceedWithPluginExtensionPoints
protected <IN,OUT> OUT proceedWithPluginExtensionPoints(org.aspectj.lang.ProceedingJoinPoint pjp, org.apache.commons.lang3.function.TriFunction<EXTENSIONPOINT, IN, Function<IN, OUT>, OUT> extensionPointMethod, Function<Object[], IN> argsToInputObj, BiFunction<IN, Object[], Object[]> setArgs) Proceeds with the invocation by calling the given method on all extension points in ascending order and then the service method (analog to Spring AOP aspects behaviour).- Type Parameters:
IN- POJO Type used by extensionPointMethod for argument aggregationOUT- return type of extensionPointMethod and the service method invocation represented by pjp- Parameters:
pjp-extensionPointMethod- Method that is part of Type EXTENSIONPOINT to callargsToInputObj- Function to convert from an Object array to the input type IN used by extensionPointMethodsetArgs- Function to set/modify the Object array used forProceedingJoinPoint::proceed using an object of type IN- Returns:
- result of passing the method call through all extension points to the service layer and processing the return value back through all extension points
-
proceedWithPluginExtensionPoints
protected <IN,OUT> OUT proceedWithPluginExtensionPoints(org.aspectj.lang.ProceedingJoinPoint pjp, org.apache.commons.lang3.function.TriFunction<EXTENSIONPOINT, IN, Function<IN, OUT>, OUT> extensionPointMethod, Function<Object[], IN> argsToInputObj, BiFunction<IN, Object[], Object[]> setArgs, Function<Object, OUT> afterProceed) Proceeds with the invocation by calling the given method on all extension points in ascending order and then the service method (analog to Spring AOP aspects behaviour).- Type Parameters:
IN- POJO Type used by extensionPointMethod for argument aggregationOUT- return type of extensionPointMethod and in most cases the service method invocation represented by pjp- Parameters:
pjp-extensionPointMethod- Method that is part of Type EXTENSIONPOINT to callargsToInputObj- Function to convert from an Object array to the input type IN used by extensionPointMethodsetArgs- Function to set/modify the Object array used forProceedingJoinPoint::proceed using an object of type INafterProceed- function to apply to adapt the return value of the service call to the return type of the extension point method (OUT)- Returns:
- result of passing the method call through all extension points to the service layer and processing the return value back through all extension points
-