¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, DreamLu All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: DreamLu 墿¥æ¢¦ (596392912@qq.com) |
| | | */ |
| | | |
| | | package org.springblade.core.redis.lock; |
| | | |
| | | import java.lang.annotation.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * åå¸å¼é注解ï¼redissonï¼æ¯æçéçç§ç±»æå¾å¤ï¼éåæ³¨è§£å½¢å¼çåªæéå
¥éãå
¬å¹³é |
| | | * |
| | | * <p> |
| | | * 1. å¯éå
¥éï¼Reentrant Lockï¼ |
| | | * 2. å
¬å¹³éï¼Fair Lockï¼ |
| | | * 3. èéï¼MultiLockï¼ |
| | | * 4. 红éï¼RedLockï¼ |
| | | * 5. 读åéï¼ReadWriteLockï¼ |
| | | * </p> |
| | | * |
| | | * @author L.cm |
| | | */ |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Target(ElementType.METHOD) |
| | | @Documented |
| | | public @interface RedisLock { |
| | | |
| | | /** |
| | | * åå¸å¼éç keyï¼å¿
é¡»ï¼è¯·ä¿æå¯ä¸æ§ |
| | | * |
| | | * @return key |
| | | */ |
| | | String value(); |
| | | |
| | | /** |
| | | * åå¸å¼éåæ°ï¼å¯éï¼æ¯æ spring el # è¯»åæ¹æ³åæ°å @ 读å spring bean |
| | | * |
| | | * @return param |
| | | */ |
| | | String param() default ""; |
| | | |
| | | /** |
| | | * çå¾
éè¶
æ¶æ¶é´ï¼é»è®¤30 |
| | | * |
| | | * @return int |
| | | */ |
| | | long waitTime() default 30; |
| | | |
| | | /** |
| | | * èªå¨è§£éæ¶é´ï¼èªå¨è§£éæ¶é´ä¸å®å¾å¤§äºæ¹æ³æ§è¡æ¶é´ï¼å¦åä¼å¯¼è´éæåéæ¾ï¼é»è®¤100 |
| | | * |
| | | * @return int |
| | | */ |
| | | long leaseTime() default 100; |
| | | |
| | | /** |
| | | * æ¶é´å温ï¼é»è®¤ä¸ºç§ |
| | | * |
| | | * @return æ¶é´åä½ |
| | | */ |
| | | TimeUnit timeUnit() default TimeUnit.SECONDS; |
| | | |
| | | /** |
| | | * é»è®¤å
¬å¹³é |
| | | * |
| | | * @return LockType |
| | | */ |
| | | LockType type() default LockType.FAIR; |
| | | } |