cn.lingyangwl.framework.lock.LyLockRedissonAutoConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lock-spring-boot-starter Show documentation
Show all versions of lock-spring-boot-starter Show documentation
lingyang framework 适用所有java项目的公共库, 方便快速集成和使用, 提供工作效率
The newest version!
package cn.lingyangwl.framework.lock;
import cn.lingyangwl.framework.lock.constant.LockBeanName;
import cn.lingyangwl.framework.lock.manager.RedissonManager;
import org.redisson.Redisson;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import javax.annotation.Resource;
/**
* @author shenguangyang
*/
@AutoConfiguration
@ConditionalOnClass(Redisson.class)
public class LyLockRedissonAutoConfiguration {
@Resource
private Redisson redisson;
@Bean(name = LockBeanName.REDISSON_SERVICE)
@ConditionalOnMissingBean(RedissonManager.class)
public RedissonManager redissonService() {
return new RedissonManager(redisson);
}
}