Package org.ehrbase.plugin
Class AbstractPluginAspect<EXTENSIONPOINT>
- java.lang.Object
-
- org.ehrbase.plugin.AbstractPluginAspect<EXTENSIONPOINT>
-
- Direct Known Subclasses:
CompositionPluginAspect,EhrPluginAspect,QueryPluginAspect,TemplatePluginAspect
public abstract class AbstractPluginAspect<EXTENSIONPOINT> extends Object
- Author:
- Stefan Spiska
-
-
Field Summary
Fields Modifier and Type Field Description protected org.springframework.beans.factory.ListableBeanFactorybeanFactory
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPluginAspect(org.springframework.beans.factory.ListableBeanFactory beanFactory, Class<EXTENSIONPOINT> clazz)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<EXTENSIONPOINT>getActiveExtensionPointsOrderedDesc()voidinServiceLayerPC()protected Objectproceed(org.aspectj.lang.ProceedingJoinPoint pjp, Object[] args)Proceed with Error handling.protected <IN,OUT>
OUTproceedWithPluginExtensionPoints(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>
OUTproceedWithPluginExtensionPoints(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).
-
-
-
Constructor Detail
-
AbstractPluginAspect
protected AbstractPluginAspect(org.springframework.beans.factory.ListableBeanFactory beanFactory, Class<EXTENSIONPOINT> clazz)
-
-
Method Detail
-
inServiceLayerPC
public void inServiceLayerPC()
-
proceed
protected Object proceed(org.aspectj.lang.ProceedingJoinPoint pjp, Object[] args)
Proceed with Error handling.- Parameters:
pjp-args-- Returns:
-
getActiveExtensionPointsOrderedDesc
protected List<EXTENSIONPOINT> 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
-
-