Package org.alfresco.traitextender
Class AJExtender
java.lang.Object
org.alfresco.traitextender.AJExtender
Static utility used for aspectJ extension consistency , routing and for maintaining thread-local extension-bypass context stack.
AspectJ extension routing distinguishes between the following contexts in which an extended method (i.e. a method with an
The
AspectJ extension routing distinguishes between the following contexts in which an extended method (i.e. a method with an
Extend annotation) can be called:
- Extend context
when an extended method is called and the extension overrides the method call - Local proceed context
when an extension method needs to execute the original method that it has overridden. - Extension bypass context
when a call to an extended method needs to be completed with the extensions disabled for that call
The
AJExtender can check ExtensionPoint definitions for consistency by compiling extensible classes. The compilation process fails if there are inconsistencies between ExtensionPoints and Extend annotated methods (egg. an annotated method can not be mapped to a method in the indicated extension by signature matching).- Author:
- Bogdan Horje
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceImplementors are aspectJ extension ignoring closures. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <R> Rrun(AJExtender.ExtensionBypass<R> closure) Extension-bypass closure runner method.static <R> Rrun(AJExtender.ExtensionBypass<R> closure, Class<?>[] exTypes) Extension-bypass closure runner method.
-
Constructor Details
-
AJExtender
public AJExtender()
-
-
Method Details
-
run
Extension-bypass closure runner method.
Sets up adequate call contexts to avoid exception calling and than delegates to the given closure.
Only the given exTypes exceptions will be passed on to the calling context, all others will be wrapped asUndeclaredThrowableExceptions.- Parameters:
closure-exTypes-- Returns:
- Throws:
Throwable
-
run
Extension-bypass closure runner method.
Sets up adequate call contexts to avoid exception calling and than delegates to the given closure.- Parameters:
closure-- Returns:
-