Annotation Type EnableSchedulerLock
@Target(TYPE)
@Retention(RUNTIME)
@Import(SchedulerLockConfigurationSelector.class)
public @interface EnableSchedulerLock
-
Nested Class Summary
Nested Classes -
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionDefault value how long the lock should be kept in case the machine which obtained the lock died before releasing it. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe lock will be held at least for this duration.Mode of integration, either TaskScheduler is wrapped in a proxy or the scheduled method is proxied to ensure lockingorg.springframework.context.annotation.AdviceModeSince 3.0.0 useinterceptMode()to configure the intercept mode.intIndicate the ordering of the execution of the locking advisor when multiple advices are applied at a specific joinpoint.booleanIndicate whether subclass-based (CGLIB) proxies are to be created as opposed to standard Java interface-based proxies.
-
Element Details
-
defaultLockAtMostFor
String defaultLockAtMostForDefault value how long the lock should be kept in case the machine which obtained the lock died before releasing it. Can be either time with suffix like 10s or ISO8601 duration as described inDuration.parse(CharSequence), for example PT30S. This is just a fallback, under normal circumstances the lock is released as soon the tasks finishes. Set this to some value much higher than normal task duration. Can be overridden in each ScheduledLock annotation.
-
-
-
interceptMode
EnableSchedulerLock.InterceptMode interceptModeMode of integration, either TaskScheduler is wrapped in a proxy or the scheduled method is proxied to ensure locking- See Also:
- Default:
- PROXY_METHOD
-
defaultLockAtLeastFor
String defaultLockAtLeastForThe lock will be held at least for this duration. Can be either time with suffix like 10s or ISO8601 duration as described inDuration.parse(CharSequence), for example PT30S. Can be used if you really need to execute the task at most once in given period of time. If the duration of the task is shorter than clock difference between nodes, the task can be theoretically executed more than once (one node after another). By setting this parameter, you can make sure that the lock will be kept at least for given period of time. Can be overridden in each ScheduledLock annotation.- Default:
- "PT0S"
-
mode
org.springframework.context.annotation.AdviceMode modeSince 3.0.0 useinterceptMode()to configure the intercept mode. Had to be renamed to make it compatible with Spring AOP infrastructure. Sorry. Indicate how advice should be applied.- Default:
- PROXY
-
proxyTargetClass
boolean proxyTargetClassIndicate whether subclass-based (CGLIB) proxies are to be created as opposed to standard Java interface-based proxies.- Default:
- false
-
order
int orderIndicate the ordering of the execution of the locking advisor when multiple advices are applied at a specific joinpoint.The default is
Ordered.LOWEST_PRECEDENCE.- Default:
- 2147483647
-