All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.lingyangwl.framework.lock.LyLockRedissonAutoConfiguration Maven / Gradle / Ivy

Go to download

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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy