當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。