/** * @param configurationClient The configuration client * @param readTimeout The read timeout */ public DistributedPropertySourceLocator( ConfigurationClient configurationClient, @Value("${" + ConfigurationClient.READ_TIMEOUT + ":10s}") Duration readTimeout) { this.configurationClient = configurationClient; this.readTimeout = readTimeout; }
/** * @param springCloudConfigClient The Spring Cloud client * @param springCloudConfiguration The Spring Cloud configuration * @param applicationConfiguration The application configuration * @param uri The Spring cloud config server endpoint * @param executionService The executor service to use */ protected SpringCloudConfigurationClient(SpringCloudConfigClient springCloudConfigClient, SpringCloudConfigConfiguration springCloudConfiguration, ApplicationConfiguration applicationConfiguration, @Value(SpringCloudConfigConfiguration.SPRING_CLOUD_CONFIG_ENDPOINT) String uri, @Named(TaskExecutors.IO) @Nullable ExecutorService executionService) { this.springCloudConfigClient = springCloudConfigClient; this.springCloudConfiguration = springCloudConfiguration; this.applicationConfiguration = applicationConfiguration; this.uri = uri; this.executionService = executionService; }
/** * Constructor. * @param executionHandleLocator executionHandleLocator * @param uriNamingStrategy uriNamingStrategy * @param conversionService conversionService * @param codecRegistry codecRegistry * @param contextPath contextPath */ public AnnotatedFunctionRouteBuilder( ExecutionHandleLocator executionHandleLocator, UriNamingStrategy uriNamingStrategy, ConversionService<?> conversionService, MediaTypeCodecRegistry codecRegistry, @Value("${micronaut.function.context-path:/}") String contextPath) { super(executionHandleLocator, uriNamingStrategy, conversionService); this.localFunctionRegistry = new DefaultLocalFunctionRegistry(codecRegistry); this.contextPath = contextPath.endsWith("/") ? contextPath : contextPath + '/'; }
@Controller("/spring-cloud/issues") public class SpringCloudConfigDemoController { @Value("${environment-name:LOCAL}") protected String appPrefix; @Get("/{number}") String issue(Integer number) { return appPrefix + ": issue # " + number + "!"; } }
@Singleton @Requires(property = "aws.accessKeyId") public class AWSCredentialsProviderService implements AWSCredentialsProvider { @Value("${aws.accessKeyId}") String accessKey; @Value("${aws.secretKey}") String secretKey; @Override public AWSCredentials getCredentials() { return new BasicAWSCredentials(accessKey, secretKey); } @Override public void refresh() { } }
/** * @param resourceResolver A {@link ResourceResolver} * @param gitPropertiesPath The path for the git properties file */ public GitInfoSource( ResourceResolver resourceResolver, @Value("${endpoints.info.git.location:git.properties}") String gitPropertiesPath) { this.resourceResolver = resourceResolver; this.supplier = SupplierUtil.memoized(this::retrieveGitInfo); this.gitPropertiesPath = gitPropertiesPath; }
/** * @param resourceResolver A {@link ResourceResolver} * @param buildPropertiesPath The build properties path */ public BuildInfoSource( ResourceResolver resourceResolver, @Value("${endpoints.info.build.location:META-INF/build-info.properties}") String buildPropertiesPath) { this.resourceResolver = resourceResolver; this.supplier = SupplierUtil.memoized(this::retrieveBuildInfo); this.buildPropertiesPath = buildPropertiesPath; }
/** * @param resourceResolver A {@link ResourceResolver} * @param buildPropertiesPath The build properties path */ public BuildInfoSource( ResourceResolver resourceResolver, @Value("${endpoints.info.build.location:META-INF/build-info.properties}") String buildPropertiesPath) { this.resourceResolver = resourceResolver; this.supplier = SupplierUtil.memoized(this::retrieveBuildInfo); this.buildPropertiesPath = buildPropertiesPath; }
/** * @param resourceResolver A {@link ResourceResolver} * @param gitPropertiesPath The path for the git properties file */ public GitInfoSource( ResourceResolver resourceResolver, @Value("${endpoints.info.git.location:git.properties}") String gitPropertiesPath) { this.resourceResolver = resourceResolver; this.supplier = SupplierUtil.memoized(this::retrieveGitInfo); this.gitPropertiesPath = gitPropertiesPath; }
/** * @param defaultCharset The default charset used for serialization and deserialization * @param codecConfiguration The configuration for the codec */ @Inject public TextPlainCodec(@Value("${" + ApplicationConfiguration.DEFAULT_CHARSET + "}") Optional<Charset> defaultCharset, @Named(CONFIGURATION_QUALIFIER) @Nullable CodecConfiguration codecConfiguration) { this.defaultCharset = defaultCharset.orElse(StandardCharsets.UTF_8); if (codecConfiguration != null) { this.additionalTypes = codecConfiguration.getAdditionalTypes(); } else { this.additionalTypes = Collections.emptyList(); } }
protected Optional<ParameterNameProvider> parameterNameProvider = Optional.empty(); @Value("${hibernate.validator.ignore-xml-configuration:true}") protected boolean ignoreXmlConfiguration = true;