Package com.baidu.disconf.client.common.annotations

Examples of com.baidu.disconf.client.common.annotations.DisconfFile


                        + classFile.getName());
                continue;
            }

            // 校验配置文件类型是否合适(目前只支持.properties类型)
            DisconfFile disconfFile = (DisconfFile) classFile
                    .getAnnotation(DisconfFile.class);
            boolean fileTypeRight = ScanVerify
                    .isDisconfFileTypeRight(disconfFile);
            if (!fileTypeRight) {
                LOGGER.warn("now do not support NOT .properties file"
                        + disconfFile.toString());
                continue;
            }
        }

        // 设置
View Full Code Here


        //
        // class
        disconfCenterFile.setCls(disconfFileClass);

        DisconfFile disconfFileAnnotation = disconfFileClass
                .getAnnotation(DisconfFile.class);

        //
        // file name
        disconfCenterFile.setFileName(disconfFileAnnotation.filename());

        //
        // disConfCommonModel
        DisConfCommonModel disConfCommonModel = makeDisConfCommonModel(
                disconfFileAnnotation.env(), disconfFileAnnotation.version());
        disconfCenterFile.setDisConfCommonModel(disConfCommonModel);

        // Remote URL
        String url = DisconfWebPathMgr.getRemoteUrlParameter(
                DisClientSysConfig.getInstance().CONF_SERVER_STORE_ACTION,
View Full Code Here

            // 反索引
            for (Class<?> curClass : classes) {

                // 获取其注解
                DisconfFile disconfFile = curClass
                        .getAnnotation(DisconfFile.class);
                if (disconfFile == null) {

                    LOGGER.error(
                            "cannot find DisconfFile annotation for class when set callback: {} ",
                            curClass.toString());
                    continue;
                }

                DisconfKey disconfKey = new DisconfKey(DisConfigTypeEnum.FILE,
                        disconfFile.filename());
                addOne2InverseMap(disconfKey, inverseMap, iDisconfUpdate);
            }
        }

        // set data
View Full Code Here

        //
        // 文件名
        //
        Class<?> cls = method.getDeclaringClass();
        DisconfFile disconfFile = cls.getAnnotation(DisconfFile.class);

        //
        // Field名
        //
        Field field = MethodUtils.getFieldFromMethod(method,
                cls.getDeclaredFields(), DisConfigTypeEnum.FILE);
        if (field != null) {

            //
            // 请求仓库配置数据
            //
            DisconfStoreProcessor disconfStoreProcessor = DisconfStoreProcessorFactory
                    .getDisconfStoreFileProcessor();
            Object ret = disconfStoreProcessor.getConfig(
                    disconfFile.filename(), disconfFileItem.name());
            if (ret != null) {
                LOGGER.info("using disconf store value: "
                        + disconfFile.filename() + " ("
                        + disconfFileItem.name() + " , " + ret + ")");
                return ret;
            }
        }
View Full Code Here

        //
        // class
        disconfCenterFile.setCls(disconfFileClass);

        DisconfFile disconfFileAnnotation = disconfFileClass
                .getAnnotation(DisconfFile.class);

        //
        // file name
        disconfCenterFile.setFileName(disconfFileAnnotation.filename());

        //
        // disConfCommonModel
        DisConfCommonModel disConfCommonModel = makeDisConfCommonModel(
                disconfFileAnnotation.env(), disconfFileAnnotation.version(),
                disconfFileAnnotation.filename());
        disconfCenterFile.setDisConfCommonModel(disConfCommonModel);

        // Remote URL
        String url = DisconfWebPathMgr.getRemoteUrlParameter(
                DisClientSysConfig.getInstance().CONF_SERVER_STORE_ACTION,
View Full Code Here

            // 反索引
            for (Class<?> curClass : classes) {

                // 获取其注解
                DisconfFile disconfFile = curClass
                        .getAnnotation(DisconfFile.class);
                if (disconfFile == null) {

                    LOGGER.error(
                            "cannot find DisconfFile annotation for class when set callback: {} ",
                            curClass.toString());
                    continue;
                }

                DisconfKey disconfKey = new DisconfKey(DisConfigTypeEnum.FILE,
                        disconfFile.filename());
                addOne2InverseMap(disconfKey, inverseMap, iDisconfUpdate);
            }
        }

        // set data
View Full Code Here

        //
        // class
        disconfCenterFile.setCls(disconfFileClass);

        DisconfFile disconfFileAnnotation = disconfFileClass
                .getAnnotation(DisconfFile.class);

        //
        // file name
        disconfCenterFile.setFileName(disconfFileAnnotation.filename());

        //
        // disConfCommonModel
        DisConfCommonModel disConfCommonModel = makeDisConfCommonModel(
                disconfFileAnnotation.env(), disconfFileAnnotation.version(),
                disconfFileAnnotation.filename());
        disconfCenterFile.setDisConfCommonModel(disConfCommonModel);

        // Remote URL
        String url = DisconfWebPathMgr.getRemoteUrlParameter(
                DisClientSysConfig.getInstance().CONF_SERVER_STORE_ACTION,
View Full Code Here

                        + classFile.getName());
                continue;
            }

            // 校验配置文件类型是否合适(目前只支持.properties类型)
            DisconfFile disconfFile = (DisconfFile) classFile
                    .getAnnotation(DisconfFile.class);
            boolean fileTypeRight = ScanVerify
                    .isDisconfFileTypeRight(disconfFile);
            if (!fileTypeRight) {
                LOGGER.warn("now do not support NOT .properties file"
                        + disconfFile.toString());
                continue;
            }
        }

        // 设置
View Full Code Here

            // 反索引
            for (Class<?> curClass : classes) {

                // 获取其注解
                DisconfFile disconfFile = curClass
                        .getAnnotation(DisconfFile.class);
                if (disconfFile == null) {

                    LOGGER.error(
                            "cannot find DisconfFile annotation for class when set callback: {} ",
                            curClass.toString());
                    continue;
                }

                DisconfKey disconfKey = new DisconfKey(DisConfigTypeEnum.FILE,
                        disconfFile.filename());
                addOne2InverseMap(disconfKey, inverseMap, iDisconfUpdate);
            }
        }

        // set data
View Full Code Here

        //
        // 文件名
        //
        Class<?> cls = method.getDeclaringClass();
        DisconfFile disconfFile = cls.getAnnotation(DisconfFile.class);

        //
        // Field名
        //
        Field field = ScanVerify.getFieldFromMethod(method,
                cls.getDeclaredFields(), DisConfigTypeEnum.FILE);
        if (field != null) {

            //
            // 请求仓库配置数据
            //
            DisconfStoreProcessor disconfStoreProcessor = DisconfStoreProcessorFactory
                    .getDisconfStoreFileProcessor();
            Object ret = disconfStoreProcessor.getConfig(
                    disconfFile.filename(), disconfFileItem.name());
            if (ret != null) {
                LOGGER.info("using disconf store value: "
                        + disconfFile.filename() + " ("
                        + disconfFileItem.name() + " , " + ret + ")");
                return ret;
            }
        }
View Full Code Here

TOP

Related Classes of com.baidu.disconf.client.common.annotations.DisconfFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.