zoukankan      html  css  js  c++  java
  • @Inject注解

    在看eureka的源码看到了这个注解,百度一下说这个和autowored差不多,

    import javax.inject.Inject;
    import javax.inject.Singleton;
        @Inject
        public ApplicationInfoManager(EurekaInstanceConfig config, InstanceInfo instanceInfo, OptionalArgs optionalArgs) {
            this.config = config;
            this.instanceInfo = instanceInfo;
            this.listeners = new ConcurrentHashMap<String, StatusChangeListener>();
            if (optionalArgs != null) {
                this.instanceStatusMapper = optionalArgs.getInstanceStatusMapper();
            } else {
                this.instanceStatusMapper = NO_OP_MAPPER;
            }
    
            // Hack to allow for getInstance() to use the DI'd ApplicationInfoManager
            instance = this;
        }
    @Singleton
    public class ApplicationInfoManager {}
  • 相关阅读:
    HDU 2795
    HDU 1394
    HDU 1754
    HDU 1166
    SDOI 2006
    HDU 1423
    HDU 1561
    centos7.4 搭建zabbix-server 3.4.5
    vim 简单笔记
    jdk环境并配置环境变量
  • 原文地址:https://www.cnblogs.com/q1359720840/p/14812267.html
Copyright © 2011-2022 走看看