play.Application.configuration()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中play.Application.configuration()方法的一些代码示例,展示了Application.configuration()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Application.configuration()方法的具体详情如下:
包路径:play.Application
类名称:Application
方法名:configuration

Application.configuration介绍

[英]Get the application configuration.
[中]获取应用程序配置。

代码示例

代码示例来源:origin: stackoverflow.com

public void onStart(Application app)
{
 super.onStart(app);
 String value = app.configuration().getString("my.thing");
 // do something with value
}

代码示例来源:origin: com.typesafe.play/play-java-ebean

public String defaultServer() {
  //lookup key to set the default server otherwise the "default" data source is the default server
  return application.configuration().getString("ebeanconfig.datasource.default", "default");
}

代码示例来源:origin: com.atlassian.addon.connect.hercules/hercules-ac

@Inject
public Hercules(final IssueRetriever issueRetriever, final HerculesScanService scanService,
        final HerculesReportService reportService, final DarkFeaturesService darkFeaturesService,
        final ArticleRelevanceService relevanceService, final HerculesIssueService issueService,
        final HerculesArticleService articleService)
{
  this.issueRetriever = issueRetriever;
  this.scanService = scanService;
  this.reportService = reportService;
  this.darkFeaturesService = darkFeaturesService;
  this.relevanceService = relevanceService;
  this.issueService = issueService;
  this.articleService = articleService;
  hercArticleFieldName = play.Play.application().configuration().getString("herc.article.field", "Hercules Article");
}

代码示例来源:origin: si.urbas/pless

@Override
public boolean getBoolean(String configKey, boolean defaultValue) {
 return Play.application().configuration().getBoolean(configKey, defaultValue);
}

代码示例来源:origin: si.urbas/pless

@Override
public int getInt(String configKey, int defaultValue) {
 return Play.application().configuration().getInt(configKey, defaultValue);
}

代码示例来源:origin: si.urbas/pless

@Override
public String getString(String configKey) {
 return Play.application().configuration().getString(configKey);
}

代码示例来源:origin: com.atlassian.addon.connect.hercules/hercules-ac

@Inject
public HerculesScanServiceImpl(final MatchResultsPersister persister, final HerculesPatternService patternService,
                final HerculesAdminService adminService, final HerculesCommentService commentService,
                final HerculesConfigService configService, final DarkFeaturesService darkFeaturesService,
                final HerculesIssuePropertyService issuePropertyService, final SisyphusPropertyMatcher propertyMatcher)
{
  this.persister = persister;
  this.patternService = patternService;
  this.adminService = adminService;
  this.commentService = commentService;
  this.configService = configService;
  this.darkFeaturesService = darkFeaturesService;
  this.issuePropertyService = issuePropertyService;
  this.propertyMatcher = propertyMatcher;
  this.tempDir = initTempDir(Play.application().configuration().getString("temp.storage.path"));
  this.executorService = Executors.newFixedThreadPool(MAX_SCAN_THREADS);
}

代码示例来源:origin: com.github.gitssie/play-transport

public static Configuration getConfiguration() {
  Configuration conf = Configuration.empty();
  return play.api.Play.maybeApplication().isDefined() ? Play.application().configuration(): conf;
}

代码示例来源:origin: com.atlassian.addon.connect.hercules/hercules-ac

public DarkFeaturesServiceImpl()
{
  final String onlineKey = Play.application().configuration().getString(LAUNCH_DARKLY_KEY_NAME);
  final String proxyHost = System.getProperty("http.proxyHost");
  final Integer proxyPort = Integer.getInteger("http.proxyPort");
  if (StringUtils.isNotBlank(proxyHost) && proxyPort != null)
  {
    final LDConfig ldConfig = new LDConfig.Builder()
        .proxyScheme("http")
        .proxyHost(proxyHost)
        .proxyPort(proxyPort).build();
    this.ldClient = new LDClient(onlineKey, ldConfig);
  }
  else
  {
    this.ldClient = new LDClient(onlineKey);
  }
  if (StringUtils.isEmpty(onlineKey))
  {
    this.ldClient.setOffline();
  }
}

代码示例来源:origin: com.atlassian.addon.connect.hercules/hercules-ac

@Override
  public F.Promise<SimpleResult> call(Http.Context context) throws Throwable
  {
    final String authHeader = context.request().getHeader(AUTHORIZATION);
    if (authHeader == null)
    {
      context.response().setHeader(WWW_AUTHENTICATE, REALM);
      return F.Promise.pure((SimpleResult) unauthorized());
    }

    final String auth = authHeader.substring(6);
    final String[] credString = org.apache.commons.codec.binary.StringUtils.newStringUtf8(Base64.decodeBase64(auth)).split(":");

    if (credString.length != 2)
    {
      return F.Promise.pure((SimpleResult) unauthorized());
    }

    final String username = credString[0];
    final String password = credString[1];

    return (StringUtils.equals(username, play.Play.application().configuration().getString("rest.auth.user", "")) &&
        StringUtils.equals(password, play.Play.application().configuration().getString("rest.auth.pass", ""))) ?
        delegate.call(context) : F.Promise.pure((SimpleResult) unauthorized());
  }
}

代码示例来源:origin: com.typesafe.play/play-java-ebean

boolean evolutionsEnabled = !"disabled".equals(application.configuration().getString("evolutionplugin"));
if(evolutionsEnabled) {
  String evolutionScript = generateEvolutionScript(servers.get(key), config);

代码示例来源:origin: com.atlassian.addon.connect.hercules/hercules-ac

LOGGER.debug("DarkFeature {} is enabled: {}", HERC_ENCOURAGE_PROVIDE_LOG_FILES, featureFlag);
final String issueType = Play.application().configuration().getString(ADD_COMMENT_ISSUE_TYPE, CONFLUENCE_ISSUE_TYPE);
if (issue.getType().equals(issueType) && featureFlag)

相关文章