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


Java Value类代码示例

本文整理汇总了Java中org.springframework.beans.factory.annotation.Value的典型用法代码示例。如果您正苦于以下问题:Java Value类的具体用法?Java Value怎么用?Java Value使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: SourceFactory

import org.springframework.beans.factory.annotation.Value; //导入依赖的package包/类
@Autowired
public SourceFactory(
    SourceCatalog sourceCatalog,
    @Value("#{sourceHiveConf}") HiveConf sourceHiveConf,
    @Value("#{sourceMetaStoreClientSupplier}") Supplier<CloseableMetaStoreClient> sourceMetaStoreClientSupplier,
    SourceCatalogListener sourceCatalogListener) {
  this.sourceCatalog = sourceCatalog;
  this.sourceHiveConf = sourceHiveConf;
  this.sourceMetaStoreClientSupplier = sourceMetaStoreClientSupplier;
  this.sourceCatalogListener = sourceCatalogListener;
}
 
开发者ID:HotelsDotCom,项目名称:circus-train,代码行数:12,代码来源:SourceFactory.java

示例2: RocketChatEndpoint

import org.springframework.beans.factory.annotation.Value; //导入依赖的package包/类
public RocketChatEndpoint(
        @Value("${rocketchat.proxy.hostname:}") String proxyHostname,
        @Value("${rocketchat.proxy.port:80}") int proxyPort,
        @Value("${rocketchat.proxy.scheme:http}") String proxyScheme
) {

    httpClientBuilder = HttpClientBuilder.create()
            .setRetryHandler((exception, executionCount, context) -> executionCount < 3)
            .setConnectionBackoffStrategy(new ConnectionBackoffStrategy() {
                @Override
                public boolean shouldBackoff(Throwable t) {
                    return t instanceof IOException;
                }

                @Override
                public boolean shouldBackoff(HttpResponse resp) {
                    return false;
                }
            })
            .setUserAgent("Smarti/0.0 Rocket.Chat-Endpoint/0.1");

    if(StringUtils.isNotBlank(proxyHostname)) {
        httpClientBuilder.setProxy(new HttpHost(proxyHostname, proxyPort, proxyScheme));
    }
}
 
开发者ID:redlink-gmbh,项目名称:smarti,代码行数:26,代码来源:RocketChatEndpoint.java

示例3: DuoAuthenticationService

import org.springframework.beans.factory.annotation.Value; //导入依赖的package包/类
/**
 * Creates the duo authentication service.
 * @param duoIntegrationKey duo integration key
 * @param duoSecretKey duo secret key
 * @param duoApplicationKey duo application key
 * @param duoApiHost duo API host url
 */
@Autowired
public DuoAuthenticationService(@NotNull @Value("${cas.duo.integration.key:}") final String duoIntegrationKey,
                                @NotNull @Value("${cas.duo.secret.key:}") final String duoSecretKey,
                                @NotNull @Value("${cas.duo.application.key:}") final String duoApplicationKey,
                                @NotNull @Value("${cas.duo.api.host:}") final String duoApiHost) {

    if (StringUtils.isBlank(duoIntegrationKey)) {
        throw new IllegalArgumentException("Duo integration key cannot be blank");
    }
    if (StringUtils.isBlank(duoSecretKey)) {
        throw new IllegalArgumentException("Duo secret key cannot be blank");
    }
    if (StringUtils.isBlank(duoApplicationKey)) {
        throw new IllegalArgumentException("Duo application key cannot be blank");
    }
    if (StringUtils.isBlank(duoApiHost)) {
        throw new IllegalArgumentException("Duo api host cannot be blank");
    }

    this.duoIntegrationKey = duoIntegrationKey;
    this.duoSecretKey = duoSecretKey;
    this.duoApplicationKey = duoApplicationKey;
    this.duoApiHost = duoApiHost;
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:32,代码来源:DuoAuthenticationService.java

示例4: jettyEmbeddedServletContainerFactory

import org.springframework.beans.factory.annotation.Value; //导入依赖的package包/类
/**
 * Configures the embedded jetty server. The values are configured in
 * <b>application.yaml</b> file.
 *
 * @param port        jetty server port
 * @param maxThreads  thread pool min thread
 * @param minThreads  thread pool max thread
 * @param idleTimeout maximum thread idle time
 * @param jmxEnabled  true, if jetty jmx is enabled.
 * @return {@link JettyEmbeddedServletContainerFactory}
 */
@Bean
public JettyEmbeddedServletContainerFactory jettyEmbeddedServletContainerFactory(@Value("${server.port:8443}") final int port,
                                                                                 @Value("${jetty.thread-pool.max-threads:200}") final int maxThreads,
                                                                                 @Value("${jetty.thread-pool.min-threads:8}") final int minThreads,
                                                                                 @Value("${jetty.thread-pool.idle-timeout:60000}") final int idleTimeout,
                                                                                 @Value("${jetty.jmx.enabled:true}") final boolean jmxEnabled) {
    log.info("Configuring Jetty server.");
    final JettyEmbeddedServletContainerFactory factory = new JettyEmbeddedServletContainerFactory(port);
    factory.addServerCustomizers(server -> {
        final QueuedThreadPool threadPool = server.getBean(QueuedThreadPool.class);
        threadPool.setMinThreads(minThreads);
        threadPool.setMaxThreads(maxThreads);
        threadPool.setIdleTimeout(idleTimeout);
        log.info("Server thread pool config:  " + server.getThreadPool());
        // Jetty JMX config.
        if (jmxEnabled) {
            log.info("Exposing Jetty managed beans to the JMX platform server.");
            server.addBean(new MBeanContainer(ManagementFactory.getPlatformMBeanServer()));
        }
    });
    return factory;
}
 
开发者ID:oneops,项目名称:secrets-proxy,代码行数:34,代码来源:EmbeddedServerConfig.java

示例5: serverMeta

import org.springframework.beans.factory.annotation.Value; //导入依赖的package包/类
@Bean
public ServerMeta serverMeta(@Value("#{publickeyPem}") String publickeyPem) {
	ServerMeta meta = new ServerMeta();
	meta.setSignaturePublickey(publickeyPem);
	meta.setSkinDomains(skinDomains);
	meta.setMeta(ofEntries(
			entry("serverName", "yggdrasil mock server"),
			entry("implementationName", "yggdrasil-mock-server"),
			entry("implementationVersion", "0.0.1")));
	return meta;
}
 
开发者ID:to2mbn,项目名称:yggdrasil-mock,代码行数:12,代码来源:YggdrasilMockServer.java

示例6: setKerberosConf

import org.springframework.beans.factory.annotation.Value; //导入依赖的package包/类
/**
 * Sets the kerberos conf.
 *
 * @param kerberosConf the new kerberos conf
 */
@Autowired
public void setKerberosConf(@Value("${cas.spnego.kerb.conf:}") final String kerberosConf) {
    if (StringUtils.isNotBlank(kerberosConf)) {
        logger.debug("kerberosConf is set to :{}", kerberosConf);
        System.setProperty(SYS_PROP_KERBEROS_CONF, kerberosConf);
    }
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:13,代码来源:JcifsConfig.java

示例7: CatalogClient

import org.springframework.beans.factory.annotation.Value; //导入依赖的package包/类
@Autowired
public CatalogClient(@Value("${catalog.service.host:catalog}") String catalogServiceHost,
		@Value("${catalog.service.port:8080}") long catalogServicePort) {
	super();
	this.restTemplate = getRestTemplate();
	this.catalogServiceHost = catalogServiceHost;
	this.catalogServicePort = catalogServicePort;
}
 
开发者ID:ewolff,项目名称:microservice-kubernetes,代码行数:9,代码来源:CatalogClient.java

示例8: LoggingConfiguration

import org.springframework.beans.factory.annotation.Value; //导入依赖的package包/类
public LoggingConfiguration(@Value("${spring.application.name}") String appName, @Value("${server.port}") String serverPort,
    @Value("${eureka.instance.instanceId}") String instanceId, JHipsterProperties jHipsterProperties) {
    this.appName = appName;
    this.serverPort = serverPort;
    this.instanceId = instanceId;
    this.jHipsterProperties = jHipsterProperties;
    if (jHipsterProperties.getLogging().getLogstash().isEnabled()) {
        addLogstashAppender(context);

        // Add context listener
        LogbackLoggerContextListener loggerContextListener = new LogbackLoggerContextListener();
        loggerContextListener.setContext(context);
        context.addListener(loggerContextListener);
    }
}
 
开发者ID:oktadeveloper,项目名称:jhipster-microservices-example,代码行数:16,代码来源:LoggingConfiguration.java

示例9: setKafkaSuscribedTopics

import org.springframework.beans.factory.annotation.Value; //导入依赖的package包/类
@Value("${kafka.subscribed.topics}")
public void setKafkaSuscribedTopics(final String rawKafkaSubscribedTopics) {

	final List<String> topicNumThreadPairs = splitCsStrings(rawKafkaSubscribedTopics);
	this.kafkaSubscribedTopics = topicNumThreadPairs.stream().map(p -> {
		final List<String> topicNumThreadPair = Splitter.on(':').omitEmptyStrings().splitToList(p);
		return new TopicInfo(topicNumThreadPair.get(0), topicNumThreadPair.size() == 2 ? Integer.valueOf(topicNumThreadPair.get(1)) : 1);
	}).collect(Collectors.toList());
}
 
开发者ID:dcsolutions,项目名称:kalinka,代码行数:10,代码来源:ContextConfiguration.java

示例10: getStepResultSerializer

import org.springframework.beans.factory.annotation.Value; //导入依赖的package包/类
@Bean
StepResultSerializer getStepResultSerializer(
	@Value("${json.step.result.serializer.impl:#{null}}") Class<? extends StepResultSerializer> impl
) {
	return null == impl ?
		beanFactory.createBean(DefaultStepResultSerializer.class) :
		beanFactory.createBean(impl);
}
 
开发者ID:qas-guru,项目名称:martini-core,代码行数:9,代码来源:JsonMarshallerConfiguration.java

示例11: sourceMetaStoreClientSupplier

import org.springframework.beans.factory.annotation.Value; //导入依赖的package包/类
@Profile({ Modules.REPLICATION })
@Bean
Supplier<CloseableMetaStoreClient> sourceMetaStoreClientSupplier(
    SourceCatalog sourceCatalog,
    @Value("#{sourceHiveConf}") HiveConf sourceHiveConf,
    MetaStoreClientFactoryManager metaStoreClientFactoryManager) {
  String metaStoreUris = sourceCatalog.getHiveMetastoreUris();
  if (metaStoreUris == null) {
    // Default to Thrift is not specified - optional attribute in SourceCatalog
    metaStoreUris = ThriftMetaStoreClientFactory.ACCEPT_PREFIX;
  }
  MetaStoreClientFactory sourceMetaStoreClientFactory = metaStoreClientFactoryManager.factoryForUrl(metaStoreUris);
  return metaStoreClientSupplier(sourceCatalog.getName(), sourceHiveConf, sourceCatalog.getMetastoreTunnel(),
      sourceMetaStoreClientFactory);
}
 
开发者ID:HotelsDotCom,项目名称:circus-train,代码行数:16,代码来源:CommonBeans.java

示例12: setUseSubjectCredsOnly

import org.springframework.beans.factory.annotation.Value; //导入依赖的package包/类
/**
 * Sets the use subject creds only.
 *
 * @param useSubjectCredsOnly the new use subject creds only
 */
@Autowired
public void setUseSubjectCredsOnly(@Value("${cas.spnego.use.subject.creds:false}")
                                   final boolean useSubjectCredsOnly) {
    logger.debug("useSubjectCredsOnly is set to {}", useSubjectCredsOnly);
    System.setProperty(SYS_PROP_USE_SUBJECT_CRED_ONLY, Boolean.toString(useSubjectCredsOnly));
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:12,代码来源:JcifsConfig.java

示例13: LoggingConfiguration

import org.springframework.beans.factory.annotation.Value; //导入依赖的package包/类
public LoggingConfiguration(@Value("${spring.application.name}") String appName, @Value("${server.port}") String serverPort,
     JHipsterProperties jHipsterProperties) {
    this.appName = appName;
    this.serverPort = serverPort;
    this.jHipsterProperties = jHipsterProperties;
    if (jHipsterProperties.getLogging().getLogstash().isEnabled()) {
        addLogstashAppender(context);
        addContextListener(context);
    }
    if (jHipsterProperties.getMetrics().getLogs().isEnabled()) {
        setMetricsMarkerLogbackFilter(context);
    }
}
 
开发者ID:torgcrm,项目名称:TorgCRM-Server,代码行数:14,代码来源:LoggingConfiguration.java

示例14: setAfterInitialization

import org.springframework.beans.factory.annotation.Value; //导入依赖的package包/类
@Override
@Autowired
public void setAfterInitialization(
        @Value("${validation.processing.afterinit:true}")
        final boolean afterInitialization) {
    super.setAfterInitialization(afterInitialization);
}
 
开发者ID:yuweijun,项目名称:cas-server-4.2.1,代码行数:8,代码来源:CustomBeanValidationPostProcessor.java

示例15: DefaultMixologist

import org.springframework.beans.factory.annotation.Value; //导入依赖的package包/类
@Autowired
protected DefaultMixologist(
	GherkinResourceLoader loader,
	Mixology mixology,
	Categories categories,
	@Value("${unimplemented.steps.fatal:#{false}}") boolean missingStepFatal
) {
	this.loader = loader;
	this.mixology = mixology;
	this.categories = categories;
	this.unimplementedStepsFatal = missingStepFatal;
	this.martinisReference = new AtomicReference<>();
}
 
开发者ID:qas-guru,项目名称:martini-core,代码行数:14,代码来源:DefaultMixologist.java


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