123456789101112131415161718192021222324252627282930313233343536373839 |
- package com.its.vds.global;
- import com.its.vds.entity.TbVdsCtlr;
- import io.netty.channel.Channel;
- import lombok.Getter;
- import lombok.Setter;
- import lombok.extern.slf4j.Slf4j;
- import java.util.concurrent.ConcurrentHashMap;
- @Slf4j
- @Getter
- @Setter
- public class AppRepository {
- private static AppRepository _instance = null;
- public ConcurrentHashMap<String, TbVdsCtlr> ctlrMap = null;
- public ConcurrentHashMap<String, TbVdsCtlr> ctlrIpMap = null;
- public ConcurrentHashMap<String, TbVdsCtlr> ctlrKeyMap = null;
- public ConcurrentHashMap<Channel, TbVdsCtlr> ctlrChannelMap = null;
- public static AppRepository getInstance() {
- if (_instance == null) {
- synchronized (AppRepository.class) {
- if (_instance == null)
- _instance = new AppRepository();
- }
- }
- return _instance;
- }
- public AppRepository() {
- this.ctlrMap = new ConcurrentHashMap<>();
- this.ctlrIpMap = new ConcurrentHashMap<>();
- this.ctlrKeyMap = new ConcurrentHashMap<>();
- this.ctlrChannelMap = new ConcurrentHashMap<>();
- }
- }
|