Annotation DoubleKill
-
- All Implemented Interfaces:
-
java.lang.annotation.Annotation
@Retention(value = RetentionPolicy.RUNTIME)@Target(value = ElementType.METHOD) public @interface DoubleKill
the default key of @DoubleKill is array of [method, uid, args]. - if the args is not easy to equals, use expression() to pickup - if uid is useless, use principal() to ignore - if expression() is no problem, toggle checkNull() to skip Note: When executing async and using with AOP annotations such as @Cacheable, make sure that DK is executed first. Otherwise, the result of the async execution cannot be processed correctly. If you can not guarantee the first execution, do not use at the same time. Repeated interception within the JVM will throw a no-stack exception to stop the execution, the caller needs to `catch` their own. - DoubleKillException will `throw` except those in sync execution.- Since:
2021-03-09
trydofor
-
-
Method Summary
Modifier and Type Method Description abstract Stringvalue()static key, just make sure it is unique within the method. abstract Stringexpression()// @el(root: pro.fessional.wings.slardar.concur.impl.DoubleKillAround. abstract booleancheckNull()check expression() result, failed if null or empty string or string null abstract booleanprincipal()Whether to use spring SecurityContextHolder.context.authentication. abstract booleanasync()Whether to execute the method async, default sync. abstract intprogress()The seconds of the execution message remain in the ProgressContext. -
-
Method Detail
-
value
abstract String value()
static key, just make sure it is unique within the method. higher priority than `expression` key
-
expression
@Language(value = "SpEL") abstract String expression()
// @el(root: pro.fessional.wings.slardar.concur.impl.DoubleKillAround.Root)
Used in the same way as `key` of `@Cacheable`, empty by default, with all arguments. If a static-key exists, the expression is omitted. Beans can be obtained using `@beanName`.
Spring Expression Language (SpEL) expression for computing the key dynamically
#root.method,#root.targetfor references to the method, target object respectively.- Shortcuts for the method name (
#root.methodName) and target class (#root.targetClass) are also available. - Method arguments can be accessed by index. For instance the 1st argument can be accessed via
#root.args[0],#p0or#a0. Arguments can also be accessed by #name if that information is available.
- Returns:
SpEL
-
checkNull
abstract boolean checkNull()
check expression() result, failed if null or empty string or string null
-
principal
abstract boolean principal()
Whether to use spring SecurityContextHolder.context.authentication.principal in keys
-
async
abstract boolean async()
Whether to execute the method async, default sync. If async, the execution progresses with the ReturnOrException. Use spring @Async thread pool by default.
-
progress
abstract int progress()
The seconds of the execution message remain in the ProgressContext. default 300s
-
-
-
-