Package org.alfresco.traitextender
Class AJExtender
- java.lang.Object
-
- org.alfresco.traitextender.AJExtender
-
public class AJExtender extends java.lang.ObjectStatic 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 anExtendannotation) 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
TheAJExtendercan checkExtensionPointdefinitions for consistency by compiling extensible classes. The compilation process fails if there are inconsistencies betweenExtensionPoints andExtendannotated methods (egg. an annotated method can not be mapped to a method in the indicated extension by signature matching).- Author:
- Bogdan Horje
- Extend context
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceAJExtender.ExtensionBypass<R>Implementors are aspectJ extension ignoring closures.
-
Constructor Summary
Constructors Constructor Description AJExtender()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <R> Rrun(AJExtender.ExtensionBypass<R> closure)Extension-bypass closure runner method.static <R> Rrun(AJExtender.ExtensionBypass<R> closure, java.lang.Class<?>[] exTypes)Extension-bypass closure runner method.
-
-
-
Method Detail
-
run
public static <R> R run(AJExtender.ExtensionBypass<R> closure, java.lang.Class<?>[] exTypes) throws java.lang.Throwable
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:
java.lang.Throwable
-
run
public static <R> R run(AJExtender.ExtensionBypass<R> closure)
Extension-bypass closure runner method.
Sets up adequate call contexts to avoid exception calling and than delegates to the given closure.- Parameters:
closure-- Returns:
-
-