当前位置: 首页>>代码示例>>Java>>正文


Java SimpleCommandLinePropertySource.containsProperty方法代码示例

本文整理汇总了Java中org.springframework.core.env.SimpleCommandLinePropertySource.containsProperty方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleCommandLinePropertySource.containsProperty方法的具体用法?Java SimpleCommandLinePropertySource.containsProperty怎么用?Java SimpleCommandLinePropertySource.containsProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.core.env.SimpleCommandLinePropertySource的用法示例。


在下文中一共展示了SimpleCommandLinePropertySource.containsProperty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addDefaultProfile

import org.springframework.core.env.SimpleCommandLinePropertySource; //导入方法依赖的package包/类
/**
 * If no profile has been configured, set by default the "dev" profile.
 */
protected static void addDefaultProfile(SpringApplication app, SimpleCommandLinePropertySource source) {
    if ((System.getProperty("spring.profiles.active") == null)
            && !source.containsProperty("spring.profiles.active")
            && !System.getenv().containsKey("SPRING_PROFILES_ACTIVE")) {
        app.setAdditionalProfiles(Constants.SPRING_PROFILE_DEVELOPMENT);
    }
}
 
开发者ID:heikehuan,项目名称:fly4j,代码行数:11,代码来源:AbstractApplication.java

示例2: addDefaultProfile

import org.springframework.core.env.SimpleCommandLinePropertySource; //导入方法依赖的package包/类
/**
 * If no profile has been configured, set by default the "dev" profile.
 */
private static void addDefaultProfile(SpringApplication app, SimpleCommandLinePropertySource source) {
    if (!source.containsProperty("spring.profiles.active") &&
            !System.getenv().containsKey("SPRING_PROFILES_ACTIVE")) {

        app.setAdditionalProfiles(Constants.SPRING_PROFILE_DEVELOPMENT);
    }
}
 
开发者ID:GastonMauroDiaz,项目名称:buenojo,代码行数:11,代码来源:Application.java

示例3: onApplicationEvent

import org.springframework.core.env.SimpleCommandLinePropertySource; //导入方法依赖的package包/类
@SuppressWarnings("ALL")
@Override
public void onApplicationEvent(ApplicationFailedEvent event) {

    SimpleCommandLinePropertySource commandLinePropertySource = new SimpleCommandLinePropertySource(event.getArgs());


    if (commandLinePropertySource.containsProperty("ding-url")) {
        final String name = ListenerUtils.getServerName(commandLinePropertySource.getProperty("ding-app-name"));

        //ding-url  ding-msg
        Map<String, Object> map = of(
                "msgtype", "text",
                "text", of("content", "【[对不起]】" + name + "启动失败。")
        );

        new Thread() {
            @Override
            public void run() {
                super.run();
                String url = commandLinePropertySource.getProperty("ding-url");
                try {
                    String returnString = Request.Post(url).connectTimeout(8000)
                            .bodyString(JSON.toJSONString(map), ContentType.APPLICATION_JSON).execute().returnContent().asString();
                    log.info("钉钉通知已发送 return:" + returnString);
                } catch (Exception e) {
                    log.warn("发送钉钉通知失败", e);
                }
            }
        }.start();
    }
}
 
开发者ID:chenjazz,项目名称:DingTalkRobot-SpringBoot,代码行数:33,代码来源:MyFailListener.java

示例4: addDefaultProfile

import org.springframework.core.env.SimpleCommandLinePropertySource; //导入方法依赖的package包/类
/**
 * If no profile has been configured, set by default the "dev" profile.
 */
private static void addDefaultProfile(SpringApplication app, SimpleCommandLinePropertySource source) {
    if (!source.containsProperty("spring.profiles.active") &&
        !System.getenv().containsKey("SPRING_PROFILES_ACTIVE")) {

        app.setAdditionalProfiles(Constants.SPRING_PROFILE_DEVELOPMENT);
    }
}
 
开发者ID:quanticc,项目名称:ugc-bot-redux,代码行数:11,代码来源:Application.java

示例5: addDefaultProfile

import org.springframework.core.env.SimpleCommandLinePropertySource; //导入方法依赖的package包/类
/**
 * If no profile has been configured, set by default the "local" profile.
 */
private static void addDefaultProfile(SpringApplication app, SimpleCommandLinePropertySource source) {
    if (!source.containsProperty("spring.profiles.active") &&
            !System.getenv().containsKey("SPRING_PROFILES_ACTIVE")) {
        app.setAdditionalProfiles(Constants.SPRING_PROFILE_LOCAL);
    }
}
 
开发者ID:VHAINNOVATIONS,项目名称:BCDS,代码行数:10,代码来源:Application.java

示例6: addDefaultProfile

import org.springframework.core.env.SimpleCommandLinePropertySource; //导入方法依赖的package包/类
/**
 * If no profile has been configured, set by default the "local" profile.
 */
protected static void addDefaultProfile(SpringApplication app, SimpleCommandLinePropertySource source) {
    if (!source.containsProperty("spring.profiles.active") &&
            !System.getenv().containsKey("SPRING_PROFILES_ACTIVE")) {
        app.setAdditionalProfiles(Constants.SPRING_PROFILE_LOCAL);
    }
}
 
开发者ID:VHAINNOVATIONS,项目名称:BCDS,代码行数:10,代码来源:BaseApplication.java

示例7: addDefaultProfile

import org.springframework.core.env.SimpleCommandLinePropertySource; //导入方法依赖的package包/类
/**
 * If no profile has been configured, set by default the "dev" profile.
 */
private static void addDefaultProfile(SpringApplication app, SimpleCommandLinePropertySource source) {
	if (!source.containsProperty("spring.profiles.active") &&
			!System.getenv().containsKey("SPRING_PROFILES_ACTIVE")) {

		app.setAdditionalProfiles(Constants.SPRING_PROFILE_DEVELOPMENT);
	}
}
 
开发者ID:giovannicandido,项目名称:audit-mq-collector,代码行数:11,代码来源:AuditMQCollector.java

示例8: loadConfigurationProperties

import org.springframework.core.env.SimpleCommandLinePropertySource; //导入方法依赖的package包/类
private Properties loadConfigurationProperties(SimpleCommandLinePropertySource cmdSource, Properties defaultProps) throws IOException {
	Properties properties = new Properties(defaultProps);
	if(cmdSource.containsProperty(CONF_OPT)) {
		String configTextPath = cmdSource.getProperty(CONF_OPT);
		String configTextAsResourcePath = guessResourceUri(configTextPath);
		Properties fileProperties = ResourceUtils.asProperties(configTextAsResourcePath);
		properties.putAll(fileProperties);
	} else {
		LOGGER.debug("No property {} presented, using defaults", CONF_OPT);
	}
	return properties;
}
 
开发者ID:kucera-jan-cz,项目名称:esBench,代码行数:13,代码来源:EsBenchCommandLine.java

示例9: addDefaultProfile

import org.springframework.core.env.SimpleCommandLinePropertySource; //导入方法依赖的package包/类
/**
 * If no profile has been configured, set by default the "local" profile.
 */
private static void addDefaultProfile(SpringApplication app,
    SimpleCommandLinePropertySource source) {
  if (!source.containsProperty("spring.profiles.active") && !System.getenv()
      .containsKey("SPRING_PROFILES_ACTIVE")) {

    app.setAdditionalProfiles(Constants.SPRING_PROFILE_LOCAL);
  }
}
 
开发者ID:dzhw,项目名称:metadatamanagement,代码行数:12,代码来源:Application.java

示例10: addDefaultProfile

import org.springframework.core.env.SimpleCommandLinePropertySource; //导入方法依赖的package包/类
/**
 * If no profile has been configured, set by default the "dev" profile.
 */
private static void addDefaultProfile(SpringApplication app, SimpleCommandLinePropertySource source)
{
	if (!source.containsProperty("spring.profiles.active") && !System.getenv().containsKey("SPRING_PROFILES_ACTIVE"))
	{
		app.setAdditionalProfiles(Constants.SPRING_PROFILE_DEVELOPMENT);
	}
}
 
开发者ID:tinesoft,项目名称:droidlinguist,代码行数:11,代码来源:DroidLinguistApplication.java

示例11: addDefaultProfile

import org.springframework.core.env.SimpleCommandLinePropertySource; //导入方法依赖的package包/类
/**
 * Set a default profile if it has not been set
 */
private static void addDefaultProfile(SpringApplication app, SimpleCommandLinePropertySource source) {
    if (!source.containsProperty("spring.profiles.active")) {
        app.setAdditionalProfiles("local");
        LOGGER.info("Staring application with profiles: local");
    } else {
        LOGGER.info("Staring application with profiles: {}", source.getProperty("spring.profiles.active"));
    }
}
 
开发者ID:jfcorugedo,项目名称:RJavaServer,代码行数:12,代码来源:Application.java

示例12: onApplicationEvent

import org.springframework.core.env.SimpleCommandLinePropertySource; //导入方法依赖的package包/类
@Override
public void onApplicationEvent(ApplicationStartingEvent event) {

    SimpleCommandLinePropertySource commandLinePropertySource = new SimpleCommandLinePropertySource(event.getArgs());

    if (commandLinePropertySource.containsProperty("ding-url")) {

        final String name = ListenerUtils.getServerName(commandLinePropertySource.getProperty("ding-app-name"));

        //ding-url  ding-msg
        Map<String, Object> map = of(
                "msgtype", "text",
                "text", of("content", "【[出差]】" + name + "正在启动。\n 当前时间:" +
                        LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss")))
        );

        new Thread() {
            @Override
            public void run() {
                super.run();
                String url = commandLinePropertySource.getProperty("ding-url");
                try {
                    String returnString = Request.Post(url).connectTimeout(8000)
                            .bodyString(JSON.toJSONString(map), ContentType.APPLICATION_JSON).execute().returnContent().asString();
                    if (log.isInfoEnabled()) {
                        log.info("钉钉通知已发送 return:" + returnString);
                    } else {
                        System.out.println("钉钉通知已发送 return: + returnString");
                    }
                } catch (Exception e) {
                    log.warn("发送钉钉通知失败", e);
                }
            }
        }.start();
    } else {
        if (log.isInfoEnabled()) {
            log.info("程序开始启动:钉钉群通知命令行参数 [--ding-url],[--ding-app-name]未配置");
        } else {
            System.out.println("程序开始启动:钉钉群通知命令行参数 [--ding-url],[--ding-app-name]未配置");
        }
    }
}
 
开发者ID:chenjazz,项目名称:DingTalkRobot-SpringBoot,代码行数:43,代码来源:MyStartListener.java

示例13: argumentsDoesNotContainProfile

import org.springframework.core.env.SimpleCommandLinePropertySource; //导入方法依赖的package包/类
private static boolean argumentsDoesNotContainProfile(final String... args) {
	final SimpleCommandLinePropertySource argsSource = new SimpleCommandLinePropertySource(args);
	return !argsSource.containsProperty(SPRING_PROFILES_ACTIVE);
}
 
开发者ID:JanLoebel,项目名称:uaa-service,代码行数:5,代码来源:DefaultProfileUtils.java

示例14: addDefaultProfile

import org.springframework.core.env.SimpleCommandLinePropertySource; //导入方法依赖的package包/类
/**
 * Set a default profile if it has not been set
 */
private static void addDefaultProfile(SpringApplication app, SimpleCommandLinePropertySource source) {
  if (!source.containsProperty("spring.profiles.active")) {
    app.setAdditionalProfiles(Constants.SPRING_PROFILE_DEVELOPMENT);
  }
}
 
开发者ID:EMN-FILA2-2015,项目名称:telosys-tools-saas-back,代码行数:9,代码来源:Application.java

示例15: addDefaultProfile

import org.springframework.core.env.SimpleCommandLinePropertySource; //导入方法依赖的package包/类
private static void addDefaultProfile(SpringApplication app, SimpleCommandLinePropertySource source) {
  if (!source.containsProperty("spring.profiles.active") && !System.getenv().containsKey("SPRING_PROFILES_ACTIVE")) {
    app.setAdditionalProfiles(SPRING_PROFILE_DEVELOPMENT);
  }
}
 
开发者ID:priitl,项目名称:p2p-webtv,代码行数:6,代码来源:Application.java


注:本文中的org.springframework.core.env.SimpleCommandLinePropertySource.containsProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。