Merge remote-tracking branch 'upstream/master' into gh-304-add-discovery-clients-order-support.
Add changes after code review. Modify # Conflicts: # spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/composite/CompositeDiscoveryClient.java # spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/simple/SimpleDiscoveryProperties.java
This commit is contained in:
13
README.adoc
13
README.adoc
@@ -3,17 +3,22 @@
|
||||
image::https://circleci.com/gh/spring-cloud/spring-cloud-commons.svg?style=svg[Build Status, link=https://circleci.com/gh/spring-cloud/spring-cloud-commons]
|
||||
|
||||
|
||||
http://pivotal.io/platform-as-a-service/migrating-to-cloud-native-application-architectures-ebook[Cloud Native] is a style of application development that encourages easy adoption of best practices in the areas of continuous delivery and value-driven development. A related discipline is that of building http://12factor.net/[12-factor Apps] in which development practices are aligned with delivery and operations goals, for instance by using declarative programming and management and monitoring. Spring Cloud facilitates these styles of development in a number of specific ways and the starting point is a set of features that all components in a distributed system either need or need easy access to when required.
|
||||
http://pivotal.io/platform-as-a-service/migrating-to-cloud-native-application-architectures-ebook[Cloud Native] is a style of application development that encourages easy adoption of best practices in the areas of continuous delivery and value-driven development.
|
||||
A related discipline is that of building http://12factor.net/[12-factor Applications], in which development practices are aligned with delivery and operations goals -- for instance, by using declarative programming and management and monitoring.
|
||||
Spring Cloud facilitates these styles of development in a number of specific ways.
|
||||
The starting point is a set of features to which all components in a distributed system need easy access.
|
||||
|
||||
Many of those features are covered by http://projects.spring.io/spring-boot[Spring Boot], which we build on in Spring Cloud. Some more are delivered by Spring Cloud as two libraries: Spring Cloud Context and Spring Cloud Commons. Spring Cloud Context provides utilities and special services for the `ApplicationContext` of a Spring Cloud application (bootstrap context, encryption, refresh scope and environment endpoints). Spring Cloud Commons is a set of abstractions and common classes used in different Spring Cloud implementations (eg. Spring Cloud Netflix vs. Spring Cloud Consul).
|
||||
Many of those features are covered by http://projects.spring.io/spring-boot[Spring Boot], on which Spring Cloud builds. Some more features are delivered by Spring Cloud as two libraries: Spring Cloud Context and Spring Cloud Commons.
|
||||
Spring Cloud Context provides utilities and special services for the `ApplicationContext` of a Spring Cloud application (bootstrap context, encryption, refresh scope, and environment endpoints). Spring Cloud Commons is a set of abstractions and common classes used in different Spring Cloud implementations (such as Spring Cloud Netflix and Spring Cloud Consul).
|
||||
|
||||
If you are getting an exception due to "Illegal key size" and you are using Sun's JDK, you need to install the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files. See the following links for more information:
|
||||
If you get an exception due to "Illegal key size" and you use Sun's JDK, you need to install the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files.
|
||||
See the following links for more information:
|
||||
|
||||
* http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html[Java 6 JCE]
|
||||
* http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html[Java 7 JCE]
|
||||
* http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html[Java 8 JCE]
|
||||
|
||||
Extract files into JDK/jre/lib/security folder (whichever version of JRE/JDK x64/x86 you are using).
|
||||
Extract the files into the JDK/jre/lib/security folder for whichever version of JRE/JDK x64/x86 you use.
|
||||
|
||||
== Building
|
||||
|
||||
|
||||
84
docs/pom.xml
84
docs/pom.xml
@@ -1,62 +1,64 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-commons-docs</artifactId>
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-commons-parent</artifactId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<packaging>pom</packaging>
|
||||
<name>Spring Cloud Commons Docs</name>
|
||||
<description>Spring Cloud Commons Docs</description>
|
||||
<properties>
|
||||
<docs.main>spring-cloud-commons</docs.main>
|
||||
<docs.main>spring-cloud-commons</docs.main>
|
||||
<main.basedir>${basedir}/..</main.basedir>
|
||||
<docs.whitelisted.branches>1.1.x,1.2.x,1.3.x</docs.whitelisted.branches>
|
||||
<docs.whitelisted.branches>1.2.x,1.3.x,2.0.x</docs.whitelisted.branches>
|
||||
</properties>
|
||||
<build>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<!--skip deploy (this is just a test module) -->
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<!--skip deploy (this is just a test module) -->
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<profiles>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>docs</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.asciidoctor</groupId>
|
||||
<artifactId>asciidoctor-maven-plugin</artifactId>
|
||||
<inherited>false</inherited>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.agilejava.docbkx</groupId>
|
||||
<artifactId>docbkx-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<inherited>false</inherited>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<inherited>false</inherited>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.asciidoctor</groupId>
|
||||
<artifactId>asciidoctor-maven-plugin</artifactId>
|
||||
<inherited>false</inherited>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.agilejava.docbkx</groupId>
|
||||
<artifactId>docbkx-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<inherited>false</inherited>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<inherited>false</inherited>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</profiles>
|
||||
</project>
|
||||
|
||||
@@ -24,7 +24,7 @@ Spring Cloud builds on top of that and adds a few features that probably all com
|
||||
A Spring Cloud application operates by creating a "`bootstrap`" context, which is a parent context for the main application.
|
||||
It is responsible for loading configuration properties from the external sources and for decrypting properties in the local external configuration files.
|
||||
The two contexts share an `Environment`, which is the source of external properties for any Spring application.
|
||||
By default, bootstrap properties are added with high precedence, so they cannot be overridden by local configuration.
|
||||
By default, bootstrap properties (not `bootstrap.properties` but properties that are loaded during the bootstrap phase) are added with high precedence, so they cannot be overridden by local configuration.
|
||||
|
||||
The bootstrap context uses a different convention for locating external configuration than the main application context.
|
||||
Instead of `application.yml` (or `.properties`), you can use `bootstrap.yml`, keeping the external configuration for bootstrap and main context
|
||||
@@ -87,12 +87,12 @@ context you are building), properties in that profile get loaded as well, the sa
|
||||
=== Overriding the Values of Remote Properties
|
||||
|
||||
The property sources that are added to your application by the bootstrap context are often "`remote`" (from example, from Spring Cloud Config Server).
|
||||
By default, they cannot be overridden locally, except on the command line.
|
||||
By default, they cannot be overridden locally.
|
||||
If you want to let your applications override the remote properties with their own System properties or config files, the remote property source has to grant it permission by setting `spring.cloud.config.allowOverride=true` (it does not work to set this locally).
|
||||
Once that flag is set, two finer-grained settings control the location of the remote properties in relation to system properties and the application's local configuration:
|
||||
|
||||
* `spring.cloud.config.overrideNone=true`: Override from any local property source.
|
||||
* `spring.cloud.config.overrideSystemProperties=false`: Only system properties and environment variables (but not the local config files) should override the remote settings.
|
||||
* `spring.cloud.config.overrideSystemProperties=false`: Only system properties, command line arguments, and environment variables (but not the local config files) should override the remote settings.
|
||||
|
||||
=== Customizing the Bootstrap Configuration
|
||||
|
||||
@@ -140,6 +140,15 @@ If you create a jar with this class in it and then add a `META-INF/spring.factor
|
||||
org.springframework.cloud.bootstrap.BootstrapConfiguration=sample.custom.CustomPropertySourceLocator
|
||||
----
|
||||
|
||||
=== Logging Configuration
|
||||
|
||||
If you are going to use Spring Boot to configure log settings than
|
||||
you should place this configuration in `bootstrap.[yml | properties]
|
||||
if you would like it to apply to all events.
|
||||
|
||||
NOTE: For Spring Cloud to initialize logging configuration properly you cannot use a custom prefix. For example,
|
||||
using `custom.loggin.logpath` will not be recognized by Spring Cloud when initializing the logging system.
|
||||
|
||||
=== Environment Changes
|
||||
|
||||
The application listens for an `EnvironmentChangeEvent` and reacts to the change in a couple of standard ways (additional `ApplicationListeners` can be added as `@Beans` by the user in the normal way).
|
||||
@@ -160,6 +169,7 @@ For instance, a `DataSource` can have its `maxPoolSize` changed at runtime (the
|
||||
Re-binding `@ConfigurationProperties` does not cover another large class of use cases, where you need more control over the refresh and where you need a change to be atomic over the whole `ApplicationContext`.
|
||||
To address those concerns, we have `@RefreshScope`.
|
||||
|
||||
[[refresh-scope]]
|
||||
=== Refresh Scope
|
||||
|
||||
When there is a configuration change, a Spring `@Bean` that is marked as `@RefreshScope` gets special treatment.
|
||||
@@ -167,6 +177,12 @@ This feature addresses the problem of stateful beans that only get their configu
|
||||
For instance, if a `DataSource` has open connections when the database URL is changed via the `Environment`, you probably want the holders of those connections to be able to complete what they are doing.
|
||||
Then, the next time something borrows a connection from the pool, it gets one with the new URL.
|
||||
|
||||
Sometimes, it might even be mandatory to apply the `@RefreshScope`
|
||||
annotation on some beans which can be only initialized once. If a bean
|
||||
is "immutable", you will have to either annotate the bean with `@RefreshScope`
|
||||
or specify the classname under the property key
|
||||
`spring.cloud.refresh.extra-refreshable`.
|
||||
|
||||
Refresh scope beans are lazy proxies that initialize when they are used (that is, when a method is called), and the scope acts as a cache of initialized values.
|
||||
To force a bean to re-initialize on the next method call, you must invalidate its cache entry.
|
||||
|
||||
@@ -208,6 +224,9 @@ For a Spring Boot Actuator application, some additional management endpoints are
|
||||
* `/actuator/restart` to close the `ApplicationContext` and restart it (disabled by default).
|
||||
* `/actuator/pause` and `/actuator/resume` for calling the `Lifecycle` methods (`stop()` and `start()` on the `ApplicationContext`).
|
||||
|
||||
NOTE: If you disable the `/actuator/restart` endpoint then the `/actuator/pause` and `/actuator/resume` endpoints
|
||||
will also be disabled since they are just a special case of `/actuator/restart`.
|
||||
|
||||
== Spring Cloud Commons: Common Abstractions
|
||||
|
||||
Patterns such as service discovery, load balancing, and circuit breakers lend themselves to a common abstraction layer that can be consumed by all Spring Cloud clients, independent of the implementation (for example, discovery with Eureka or Consul).
|
||||
@@ -287,6 +306,14 @@ public class MyConfiguration {
|
||||
|
||||
Each `ServiceRegistry` implementation has its own `Registry` implementation.
|
||||
|
||||
* `ZookeeperRegistration` used with `ZookeeperServiceRegistry`
|
||||
* `EurekaRegistration` used with `EurekaServiceRegistry`
|
||||
* `ConsulRegistration` used with `ConsulServiceRegistry`
|
||||
|
||||
If you are using the `ServiceRegistry` interface, you are going to need to pass the
|
||||
correct `Registry` implementation for the `ServiceRegistry` implementation you
|
||||
are using.
|
||||
|
||||
|
||||
==== ServiceRegistry Auto-Registration
|
||||
|
||||
@@ -527,7 +554,7 @@ spring:
|
||||
|
||||
You can also force the use of only specified network addresses by using a list of regular expressions, as shown in the following example:
|
||||
|
||||
.application.yml
|
||||
.bootstrap.yml
|
||||
----
|
||||
spring:
|
||||
cloud:
|
||||
|
||||
315
eclipse/eclipse-code-formatter.xml
Normal file
315
eclipse/eclipse-code-formatter.xml
Normal file
@@ -0,0 +1,315 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<profiles version="13">
|
||||
<profile kind="CodeFormatterProfile" name="Spring Cloud Java Conventions" version="12">
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="90"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_module_statements" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_conditional_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines" value="2147483647"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.source" value="9"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="9"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.compliance" value="9"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration" value="common_lines"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="tab"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="90"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
|
||||
</profile>
|
||||
</profiles>
|
||||
412
eclipse/org.eclipse.jdt.core.prefs
Normal file
412
eclipse/org.eclipse.jdt.core.prefs
Normal file
@@ -0,0 +1,412 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.codeComplete.argumentPrefixes=
|
||||
org.eclipse.jdt.core.codeComplete.argumentSuffixes=
|
||||
org.eclipse.jdt.core.codeComplete.fieldPrefixes=
|
||||
org.eclipse.jdt.core.codeComplete.fieldSuffixes=
|
||||
org.eclipse.jdt.core.codeComplete.localPrefixes=
|
||||
org.eclipse.jdt.core.codeComplete.localSuffixes=
|
||||
org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
|
||||
org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
|
||||
org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
|
||||
org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
|
||||
org.eclipse.jdt.core.compiler.problem.deadCode=warning
|
||||
org.eclipse.jdt.core.compiler.problem.deprecation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
|
||||
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
|
||||
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
|
||||
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=default
|
||||
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=default
|
||||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
|
||||
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.nullReference=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
|
||||
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
|
||||
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
|
||||
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
|
||||
org.eclipse.jdt.core.compiler.processAnnotations=disabled
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
|
||||
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_module_statements=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
|
||||
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
|
||||
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_method=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_package=0
|
||||
org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
|
||||
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
|
||||
org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=false
|
||||
org.eclipse.jdt.core.formatter.comment.format_block_comments=true
|
||||
org.eclipse.jdt.core.formatter.comment.format_header=false
|
||||
org.eclipse.jdt.core.formatter.comment.format_html=true
|
||||
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
|
||||
org.eclipse.jdt.core.formatter.comment.format_line_comments=true
|
||||
org.eclipse.jdt.core.formatter.comment.format_source_code=false
|
||||
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
|
||||
org.eclipse.jdt.core.formatter.comment.indent_root_tags=false
|
||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=do not insert
|
||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
|
||||
org.eclipse.jdt.core.formatter.comment.line_length=90
|
||||
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
|
||||
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
|
||||
org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
|
||||
org.eclipse.jdt.core.formatter.compact_else_if=true
|
||||
org.eclipse.jdt.core.formatter.continuation_indentation=2
|
||||
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
|
||||
org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
|
||||
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
|
||||
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
|
||||
org.eclipse.jdt.core.formatter.indent_empty_lines=false
|
||||
org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
|
||||
org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
|
||||
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
|
||||
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
|
||||
org.eclipse.jdt.core.formatter.indentation.size=4
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
|
||||
org.eclipse.jdt.core.formatter.join_lines_in_comments=true
|
||||
org.eclipse.jdt.core.formatter.join_wrapped_lines=true
|
||||
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
|
||||
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
|
||||
org.eclipse.jdt.core.formatter.lineSplit=90
|
||||
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
|
||||
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
|
||||
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
|
||||
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
|
||||
org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines
|
||||
org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines
|
||||
org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines
|
||||
org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines
|
||||
org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines
|
||||
org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines
|
||||
org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines
|
||||
org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines
|
||||
org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines
|
||||
org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines
|
||||
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
|
||||
org.eclipse.jdt.core.formatter.tabulation.char=tab
|
||||
org.eclipse.jdt.core.formatter.tabulation.size=4
|
||||
org.eclipse.jdt.core.formatter.use_on_off_tags=true
|
||||
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
|
||||
org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false
|
||||
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
|
||||
org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true
|
||||
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
|
||||
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
|
||||
org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter
|
||||
125
eclipse/org.eclipse.jdt.ui.prefs
Normal file
125
eclipse/org.eclipse.jdt.ui.prefs
Normal file
File diff suppressed because one or more lines are too long
9
pom.xml
9
pom.xml
@@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-commons-parent</artifactId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Spring Cloud Commons Parent</name>
|
||||
<description>Spring Cloud Commons Parent</description>
|
||||
@@ -11,7 +11,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-build</artifactId>
|
||||
<version>2.0.1.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<scm>
|
||||
@@ -21,7 +21,6 @@
|
||||
<tag>HEAD</tag>
|
||||
</scm>
|
||||
<properties>
|
||||
<main.basedir>.</main.basedir>
|
||||
<bintray.package>commons</bintray.package>
|
||||
</properties>
|
||||
<build>
|
||||
@@ -34,11 +33,11 @@
|
||||
<additionalConfig>
|
||||
<file>
|
||||
<name>.settings/org.eclipse.jdt.ui.prefs</name>
|
||||
<location>${main.basedir}/eclipse/org.eclipse.jdt.ui.prefs</location>
|
||||
<location>${maven.multiModuleProjectDirectory}/eclipse/org.eclipse.jdt.ui.prefs</location>
|
||||
</file>
|
||||
<file>
|
||||
<name>.settings/org.eclipse.jdt.core.prefs</name>
|
||||
<location>${main.basedir}/eclipse/org.eclipse.jdt.core.prefs</location>
|
||||
<location>${maven.multiModuleProjectDirectory}/eclipse/org.eclipse.jdt.core.prefs</location>
|
||||
</file>
|
||||
</additionalConfig>
|
||||
</configuration>
|
||||
|
||||
@@ -5,16 +5,16 @@
|
||||
<parent>
|
||||
<artifactId>spring-cloud-dependencies-parent</artifactId>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
<artifactId>spring-cloud-commons-dependencies</artifactId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>spring-cloud-commons-dependencies</name>
|
||||
<description>Spring Cloud Commons Dependencies</description>
|
||||
<properties>
|
||||
<spring-security-rsa.version>1.0.5.RELEASE</spring-security-rsa.version>
|
||||
<spring-security-rsa.version>1.0.7.RELEASE</spring-security-rsa.version>
|
||||
</properties>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-commons-parent</artifactId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>spring-cloud-commons</artifactId>
|
||||
@@ -113,6 +113,11 @@
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-autoconfigure-processor</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.retry</groupId>
|
||||
<artifactId>spring-retry</artifactId>
|
||||
|
||||
@@ -64,9 +64,9 @@ public class DefaultServiceInstance implements ServiceInstance {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a uri from the given ServiceInstance's host:port
|
||||
* Creates a URI from the given ServiceInstance's host:port.
|
||||
* @param instance
|
||||
* @return URI of the form (secure)?https:http + "host:port"
|
||||
* @return URI of the form (secure)?https:http + "host:port".
|
||||
*/
|
||||
public static URI getUri(ServiceInstance instance) {
|
||||
String scheme = (instance.isSecure()) ? "https" : "http";
|
||||
|
||||
@@ -20,43 +20,43 @@ import java.net.URI;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Represents an instance of a Service in a Discovery System
|
||||
* Represents an instance of a service in a discovery system.
|
||||
* @author Spencer Gibb
|
||||
*/
|
||||
public interface ServiceInstance {
|
||||
|
||||
/**
|
||||
* @return the service id as registered.
|
||||
* @return The service ID as registered.
|
||||
*/
|
||||
String getServiceId();
|
||||
|
||||
/**
|
||||
* @return the hostname of the registered ServiceInstance
|
||||
* @return The hostname of the registered service instance.
|
||||
*/
|
||||
String getHost();
|
||||
|
||||
/**
|
||||
* @return the port of the registered ServiceInstance
|
||||
* @return The port of the registered service instance.
|
||||
*/
|
||||
int getPort();
|
||||
|
||||
/**
|
||||
* @return if the port of the registered ServiceInstance is https or not
|
||||
* @return Whether the port of the registered service instance uses HTTPS.
|
||||
*/
|
||||
boolean isSecure();
|
||||
|
||||
/**
|
||||
* @return the service uri address
|
||||
* @return The service URI address.
|
||||
*/
|
||||
URI getUri();
|
||||
|
||||
/**
|
||||
* @return the key value pair metadata associated with the service instance
|
||||
* @return The key / value pair metadata associated with the service instance.
|
||||
*/
|
||||
Map<String, String> getMetadata();
|
||||
|
||||
/**
|
||||
* @return the scheme of the instance
|
||||
* @return The scheme of the service instance.
|
||||
*/
|
||||
default String getScheme() {
|
||||
return null;
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.springframework.core.Ordered;
|
||||
import org.springframework.core.annotation.Order;
|
||||
|
||||
/**
|
||||
* Import a single circuit breaker implementation Configuration
|
||||
* Imports a single circuit breaker implementation configuration.
|
||||
* @author Spencer Gibb
|
||||
*/
|
||||
@Order(Ordered.LOWEST_PRECEDENCE - 100)
|
||||
|
||||
@@ -22,28 +22,28 @@ import org.springframework.cloud.client.ServiceInstance;
|
||||
import org.springframework.core.Ordered;
|
||||
|
||||
/**
|
||||
* DiscoveryClient represents read operations commonly available to Discovery service such as
|
||||
* Netflix Eureka or consul.io
|
||||
* Represents read operations commonly available to discovery services such as Netflix
|
||||
* Eureka or consul.io.
|
||||
* @author Spencer Gibb
|
||||
* @author Olga Maciaszek-Sharma
|
||||
*/
|
||||
public interface DiscoveryClient extends Ordered {
|
||||
|
||||
/**
|
||||
* A human readable description of the implementation, used in HealthIndicator
|
||||
* @return the description
|
||||
* A human-readable description of the implementation, used in HealthIndicator.
|
||||
* @return The description.
|
||||
*/
|
||||
String description();
|
||||
|
||||
/**
|
||||
* Get all ServiceInstances associated with a particular serviceId
|
||||
* @param serviceId the serviceId to query
|
||||
* @return a List of ServiceInstance
|
||||
* Gets all ServiceInstances associated with a particular serviceId.
|
||||
* @param serviceId The serviceId to query.
|
||||
* @return A List of ServiceInstance.
|
||||
*/
|
||||
List<ServiceInstance> getInstances(String serviceId);
|
||||
|
||||
/**
|
||||
* @return all known service ids
|
||||
* @return All known service IDs.
|
||||
*/
|
||||
List<String> getServices();
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ import org.springframework.cloud.client.discovery.DiscoveryClient;
|
||||
import org.springframework.core.annotation.AnnotationAwareOrderComparator;
|
||||
|
||||
/**
|
||||
* A {@link DiscoveryClient} composed of other Discovery Clients that will delegate the
|
||||
* calls to each of them in order
|
||||
* A {@link DiscoveryClient} that is composed of other discovery clients and delegates
|
||||
* calls to each of them in order.
|
||||
*
|
||||
* @author Biju Kunjummen
|
||||
* @author Olga Maciaszek-Sharma
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.springframework.context.annotation.Primary;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Auto-configuration for Composite Discovery Client.
|
||||
* Auto-configuration for composite discovery client.
|
||||
*
|
||||
* @author Biju Kunjummen
|
||||
*/
|
||||
|
||||
@@ -19,9 +19,9 @@ package org.springframework.cloud.client.discovery.event;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
|
||||
/**
|
||||
* Event DiscoveryClient implementation can broadcast if they support heartbeat's from the
|
||||
* discovery server. Provides listeners with a basic indication of a state change in the
|
||||
* service catalog.
|
||||
* An event that a DiscoveryClient implementation can broadcast if it supports
|
||||
* heartbeats from the discovery server. Provides listeners with a basic indication
|
||||
* of a state change in the service catalog.
|
||||
*
|
||||
* @author Spencer Gibb
|
||||
* @author Dave Syer
|
||||
@@ -32,11 +32,11 @@ public class HeartbeatEvent extends ApplicationEvent {
|
||||
private final Object state;
|
||||
|
||||
/**
|
||||
* Create a new event with a source (for example a discovery client) and a value.
|
||||
* Creates a new event with a source (for example, a discovery client) and a value.
|
||||
* Neither parameter should be relied on to have specific content or format.
|
||||
*
|
||||
* @param source the source of the event
|
||||
* @param state the value indicating state of the catalog
|
||||
* @param source The source of the event.
|
||||
* @param state The value indicating state of the catalog.
|
||||
*/
|
||||
public HeartbeatEvent(Object source, Object state) {
|
||||
super(source);
|
||||
@@ -45,12 +45,12 @@ public class HeartbeatEvent extends ApplicationEvent {
|
||||
|
||||
/**
|
||||
* A value representing the state of the service catalog. The only requirement is that
|
||||
* it changes when the catalog is updated, so it can be as simple as a version
|
||||
* conuter, or a hash. Implementations can provide information to help users visualize
|
||||
* it changes when the catalog is updated; it can be as simple as a version counter or
|
||||
* a hash. Implementations can provide information to help users visualize
|
||||
* what is going on in the catalog, but users should not rely on the content (since
|
||||
* the implementation of the underlying discovery might change).
|
||||
*
|
||||
* @return A value representing state of the service catalog
|
||||
* @return A value representing state of the service catalog.
|
||||
*/
|
||||
public Object getValue() {
|
||||
return this.state;
|
||||
|
||||
@@ -19,8 +19,8 @@ package org.springframework.cloud.client.discovery.event;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
/**
|
||||
* Helper class for listeners to the {@link HeartbeatEvent} providing a convenient way to
|
||||
* determine if there has been a change in state.
|
||||
* Helper class for listeners to the {@link HeartbeatEvent}, providing a convenient way
|
||||
* to determine if there has been a change in state.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*/
|
||||
@@ -29,8 +29,8 @@ public class HeartbeatMonitor {
|
||||
private AtomicReference<Object> latestHeartbeat = new AtomicReference<>();
|
||||
|
||||
/**
|
||||
* @param value the latest heartbeat
|
||||
* @return true if the state changed
|
||||
* @param value The latest heartbeat.
|
||||
* @return True if the state changed.
|
||||
*/
|
||||
public boolean update(Object value) {
|
||||
Object last = this.latestHeartbeat.get();
|
||||
|
||||
@@ -30,9 +30,9 @@ public class InstanceRegisteredEvent<T> extends ApplicationEvent {
|
||||
private T config;
|
||||
|
||||
/**
|
||||
* Create a new {@link InstanceRegisteredEvent} instance.
|
||||
* @param source the component that published the event (never {@code null})
|
||||
* @param config the configuration of the instance
|
||||
* Creates a new {@link InstanceRegisteredEvent} instance.
|
||||
* @param source The component that published the event (never {@code null}).
|
||||
* @param config The configuration of the instance.
|
||||
*/
|
||||
public InstanceRegisteredEvent(Object source, T config) {
|
||||
super(source);
|
||||
|
||||
@@ -19,8 +19,8 @@ package org.springframework.cloud.client.discovery.event;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
|
||||
/**
|
||||
* Heartbeat Event that a Parent ApplicationContext can send to a child Context. Useful,
|
||||
* for example, when config server is located via DiscoveryClient, in which case the
|
||||
* Heartbeat event that a parent ApplicationContext can send to a child context. Useful,
|
||||
* for example, when a config server is located via a DiscoveryClient, in which case the
|
||||
* {@link HeartbeatEvent} that triggers this event is fired in the parent (bootstrap)
|
||||
* context.
|
||||
*
|
||||
|
||||
@@ -26,8 +26,8 @@ import org.springframework.boot.actuate.health.HealthAggregator;
|
||||
import org.springframework.boot.actuate.health.HealthIndicator;
|
||||
|
||||
/**
|
||||
* Gathers all DiscoveryHealthIndicator's from a DiscoveryClient implementation
|
||||
* and aggregates the statuses.
|
||||
* Gathers all instances of DiscoveryHealthIndicator from a DiscoveryClient
|
||||
* implementation and aggregates the statuses.
|
||||
* @author Spencer Gibb
|
||||
*/
|
||||
//TODO: do we need this? Can they just be independent HealthIndicators?
|
||||
|
||||
@@ -19,7 +19,7 @@ package org.springframework.cloud.client.discovery.health;
|
||||
import org.springframework.boot.actuate.health.Health;
|
||||
|
||||
/**
|
||||
* A health indicator interface specific for a DiscoveryClient implementation
|
||||
* A health indicator interface specific to a DiscoveryClient implementation.
|
||||
* @author Spencer Gibb
|
||||
*/
|
||||
public interface DiscoveryHealthIndicator {
|
||||
@@ -27,7 +27,7 @@ public interface DiscoveryHealthIndicator {
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* @return an indication of health
|
||||
* @return An indication of health.
|
||||
*/
|
||||
Health health();
|
||||
|
||||
|
||||
@@ -23,9 +23,9 @@ import org.springframework.cloud.client.ServiceInstance;
|
||||
import org.springframework.cloud.client.discovery.DiscoveryClient;
|
||||
|
||||
/**
|
||||
* DiscoveryClient used when no implementations are found on the classpath
|
||||
* DiscoveryClient used when no implementations are found on the classpath.
|
||||
*
|
||||
* @deprecated Use {@link org.springframework.cloud.client.discovery.simple.SimpleDiscoveryClient instead}
|
||||
* @deprecated Use {@link org.springframework.cloud.client.discovery.simple.SimpleDiscoveryClient instead}.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*/
|
||||
|
||||
@@ -41,7 +41,7 @@ import org.springframework.core.env.Environment;
|
||||
/**
|
||||
*
|
||||
* @deprecated Use
|
||||
* {@link org.springframework.cloud.client.discovery.simple.SimpleDiscoveryClientAutoConfiguration instead}
|
||||
* {@link org.springframework.cloud.client.discovery.simple.SimpleDiscoveryClientAutoConfiguration instead}.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*/
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.springframework.cloud.client.discovery.simple.SimpleDiscoveryProperti
|
||||
|
||||
/**
|
||||
* A {@link org.springframework.cloud.client.discovery.DiscoveryClient} that will use the
|
||||
* properties file as a source of service instances
|
||||
* properties file as a source of service instances.
|
||||
*
|
||||
* @author Biju Kunjummen
|
||||
* @author Olga Maciaszek-Sharma
|
||||
|
||||
@@ -19,7 +19,7 @@ import org.springframework.util.ClassUtils;
|
||||
import java.net.URI;
|
||||
|
||||
/**
|
||||
* Spring Boot Auto-Configuration for Simple Properties based Discovery Client
|
||||
* Spring Boot auto-configuration for simple properties-based discovery client.
|
||||
*
|
||||
* @author Biju Kunjummen
|
||||
*/
|
||||
|
||||
@@ -69,8 +69,8 @@ public class SimpleDiscoveryProperties {
|
||||
public static class SimpleServiceInstance implements ServiceInstance {
|
||||
|
||||
/**
|
||||
* The URI of the service instance. Will be parsed to extract the scheme, hos and
|
||||
* port.
|
||||
* The URI of the service instance. Will be parsed to extract the scheme, host,
|
||||
* and port.
|
||||
*/
|
||||
private URI uri;
|
||||
private String host;
|
||||
@@ -83,7 +83,7 @@ public class SimpleDiscoveryProperties {
|
||||
private Map<String, String> metadata = new LinkedHashMap<>();
|
||||
/**
|
||||
* The identifier or name for the service. Multiple instances might share the same
|
||||
* service id.
|
||||
* service ID.
|
||||
*/
|
||||
private String serviceId;
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* Registers a default {@link RemoteResourceRefresher} if at least one {@link RemoteResource} is declared in the system
|
||||
* and applies verification timings defined in the application properties.
|
||||
* Registers a default {@link RemoteResourceRefresher} if at least one {@link RemoteResource} is declared in the system.
|
||||
* Applies verification timings defined in the application properties.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
|
||||
@@ -53,7 +53,7 @@ public class DiscoveredResource implements RemoteResource {
|
||||
/**
|
||||
* Configures the {@link RestOperations} to use to execute the traversal and verifying HEAD calls.
|
||||
*
|
||||
* @param restOperations can be {@literal null}, resorting to a default {@link RestTemplate} in that case.
|
||||
* @param restOperations Can be {@literal null}; resorts to a default {@link RestTemplate} in that case.
|
||||
*/
|
||||
public void setRestOperations(RestOperations restOperations) {
|
||||
this.restOperations = restOperations == null ? new RestTemplate() : restOperations;
|
||||
@@ -81,7 +81,7 @@ public class DiscoveredResource implements RemoteResource {
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies the link to the current
|
||||
* Verifies the link to the current.
|
||||
*/
|
||||
public void verifyOrDiscover() {
|
||||
this.link = link == null ? discoverLink() : verify(link);
|
||||
@@ -90,7 +90,7 @@ public class DiscoveredResource implements RemoteResource {
|
||||
/**
|
||||
* Verifies the given {@link Link} by issuing an HTTP HEAD request to the resource.
|
||||
*
|
||||
* @param link must not be {@literal null}.
|
||||
* @param link Must not be {@literal null}.
|
||||
* @return
|
||||
*/
|
||||
private Link verify(Link link) {
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.springframework.cloud.client.ServiceInstance;
|
||||
import org.springframework.cloud.client.discovery.DiscoveryClient;
|
||||
|
||||
/**
|
||||
* {@link ServiceInstanceProvider} to work with a {@link DiscoveryClient} to lookup a service by name. Will pick the
|
||||
* {@link ServiceInstanceProvider} to work with a {@link DiscoveryClient} to look up a service by name. Picks the
|
||||
* first one returned by the configured {@link DiscoveryClient}.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
|
||||
@@ -25,15 +25,15 @@ import org.springframework.hateoas.Link;
|
||||
public interface RemoteResource {
|
||||
|
||||
/**
|
||||
* Returns the {@link Link} to the resource in case it is available or {@literal null}
|
||||
* in case it's gone, i.e. either generally unavailable or can't be discovered.
|
||||
* Returns the {@link Link} to the resource if it is available, or {@literal null}
|
||||
* if it is gone (i.e. it either is generally unavailable or can't be discovered).
|
||||
*/
|
||||
Link getLink();
|
||||
|
||||
/**
|
||||
* Discovers the the resource in case it hasn't been yet or became unavailable. In
|
||||
* case a link has been discovered previously, it is verified and either confirmed or
|
||||
* the link is removed to indicate it's not available anymore.
|
||||
* Discovers the resource if it hasn't been discovered yet or has become
|
||||
* unavailable. If a link has been discovered previously, it is verified and either
|
||||
* confirmed or removed to indicate that it's not available anymore.
|
||||
*/
|
||||
void verifyOrDiscover();
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.springframework.scheduling.config.IntervalTask;
|
||||
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
|
||||
|
||||
/**
|
||||
* A {@link ScheduledTaskRegistrar} that verifies all {@link DiscoveredResource} instances in the system based
|
||||
* A {@link ScheduledTaskRegistrar} that verifies all {@link DiscoveredResource} instances in the system, based
|
||||
* on the given timing configuration.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
|
||||
@@ -18,17 +18,17 @@ package org.springframework.cloud.client.hypermedia;
|
||||
import org.springframework.cloud.client.ServiceInstance;
|
||||
|
||||
/**
|
||||
* A component that will provide a {@link ServiceInstance} or can express the absence of one by returning
|
||||
* {@literal null}.
|
||||
* A component that will provide a {@link ServiceInstance}, or can express the absence of one by
|
||||
* returning {@literal null}.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
public interface ServiceInstanceProvider {
|
||||
|
||||
/**
|
||||
* Returns the service instance or {@literal null} in case the service is currently unavailable.
|
||||
* Returns the service instance or {@literal null} if the service is currently unavailable.
|
||||
*
|
||||
* @return the service instance or {@literal null} in case the service is currently unavailable.
|
||||
* @return The service instance, or {@literal null} if the service is currently unavailable.
|
||||
*/
|
||||
ServiceInstance getServiceInstance();
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.springframework.hateoas.client.Traverson.TraversalBuilder;
|
||||
public interface TraversalDefinition {
|
||||
|
||||
/**
|
||||
* @param traverson the Traverson instance to run the traversal on.
|
||||
* @param traverson The Traverson instance to run the traversal on.
|
||||
*/
|
||||
TraversalBuilder buildTraversal(Traverson traverson);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.http.client.AsyncClientHttpRequestInterceptor;
|
||||
import org.springframework.web.client.AsyncRestTemplate;
|
||||
|
||||
/**
|
||||
* Auto configuration for Ribbon (client side load balancing).
|
||||
* Auto-configuration for Ribbon (client-side load balancing).
|
||||
*
|
||||
* @author Rob Worsnop
|
||||
*/
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.springframework.http.client.AbstractClientHttpResponse;
|
||||
import org.springframework.http.client.ClientHttpResponse;
|
||||
|
||||
/**
|
||||
* {@link RetryableStatusCodeException} that captures a {@link ClientHttpResponse}
|
||||
* {@link RetryableStatusCodeException} that captures a {@link ClientHttpResponse}.
|
||||
* @author Ryan Baxter
|
||||
*/
|
||||
public class ClientHttpResponseStatusCodeException extends RetryableStatusCodeException {
|
||||
@@ -31,10 +31,10 @@ public class ClientHttpResponseStatusCodeException extends RetryableStatusCodeEx
|
||||
private ClientHttpResponseWrapper response;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param serviceId The service id
|
||||
* @param response The response object
|
||||
* @throws IOException Thrown if the {@link ClientHttpResponse} response code cant be retrieved
|
||||
* Constructor.
|
||||
* @param serviceId The service ID.
|
||||
* @param response The response object.
|
||||
* @throws IOException Thrown if the {@link ClientHttpResponse} response code cannot be retrieved.
|
||||
*/
|
||||
public ClientHttpResponseStatusCodeException(String serviceId, ClientHttpResponse response, byte[] body) throws IOException {
|
||||
super(serviceId, response.getRawStatusCode(), response, null);
|
||||
|
||||
@@ -32,10 +32,10 @@ public class InterceptorRetryPolicy implements RetryPolicy {
|
||||
|
||||
/**
|
||||
* Creates a new retry policy.
|
||||
* @param request the request that will be retried
|
||||
* @param policy the retry policy from the load balancer
|
||||
* @param serviceInstanceChooser the load balancer client
|
||||
* @param serviceName the name of the service
|
||||
* @param request The request that will be retried.
|
||||
* @param policy The retry policy from the load balancer.
|
||||
* @param serviceInstanceChooser The load balancer client.
|
||||
* @param serviceName The name of the service.
|
||||
*/
|
||||
public InterceptorRetryPolicy(HttpRequest request, LoadBalancedRetryPolicy policy,
|
||||
ServiceInstanceChooser serviceInstanceChooser, String serviceName) {
|
||||
|
||||
@@ -26,7 +26,7 @@ import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Annotation to mark a RestTemplate bean to be configured to use a LoadBalancerClient
|
||||
* Annotation to mark a RestTemplate bean to be configured to use a LoadBalancerClient.
|
||||
* @author Spencer Gibb
|
||||
*/
|
||||
@Target({ ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD })
|
||||
|
||||
@@ -22,18 +22,18 @@ import org.springframework.retry.RetryException;
|
||||
import java.net.URI;
|
||||
|
||||
/**
|
||||
* An implementation of {@link RecoveryCallback} which relies on an implemtation
|
||||
* An implementation of {@link RecoveryCallback} which relies on an implementation
|
||||
* of {@link RetryableStatusCodeException} to contain the last response object from
|
||||
* the request
|
||||
* the request.
|
||||
* @author LiYuan Lee
|
||||
*/
|
||||
public abstract class LoadBalancedRecoveryCallback<T, R> implements RecoveryCallback<T> {
|
||||
|
||||
/**
|
||||
* Create the response returned in the {@link RecoveryCallback}
|
||||
* @param response The response from the HTTP client
|
||||
* @param uri The URI the response is from
|
||||
* @return The response to be returned
|
||||
* Creates the response returned in the {@link RecoveryCallback}.
|
||||
* @param response The response from the HTTP client.
|
||||
* @param uri The URI the response is from.
|
||||
* @return The response to be returned.
|
||||
*/
|
||||
protected abstract T createResponse(R response, URI uri);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.springframework.retry.RetryContext;
|
||||
import org.springframework.retry.context.RetryContextSupport;
|
||||
|
||||
/**
|
||||
* {@link RetryContext} for load balanced retries.
|
||||
* {@link RetryContext} for load-balanced retries.
|
||||
* @author Ryan Baxter
|
||||
*/
|
||||
public class LoadBalancedRetryContext extends RetryContextSupport {
|
||||
@@ -30,9 +30,9 @@ public class LoadBalancedRetryContext extends RetryContextSupport {
|
||||
private ServiceInstance serviceInstance;
|
||||
|
||||
/**
|
||||
* Creates a new load balanced context.
|
||||
* @param parent the parent context
|
||||
* @param request the request that is being load balanced
|
||||
* Creates a new load-balanced context.
|
||||
* @param parent The parent context.
|
||||
* @param request The request that is being load-balanced.
|
||||
*/
|
||||
public LoadBalancedRetryContext(RetryContext parent, HttpRequest request) {
|
||||
super(parent);
|
||||
@@ -40,16 +40,16 @@ public class LoadBalancedRetryContext extends RetryContextSupport {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the request that is being load balanced.
|
||||
* @return the request that is being load balanced
|
||||
* Gets the request that is being load-balanced.
|
||||
* @return The request that is being load-balanced.
|
||||
*/
|
||||
public HttpRequest getRequest() {
|
||||
return request;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the request that is being load baalnced.
|
||||
* @param request the request to load balanced
|
||||
* Sets the request that is being load-balanced.
|
||||
* @param request The request to be load balanced.
|
||||
*/
|
||||
public void setRequest(HttpRequest request) {
|
||||
this.request = request;
|
||||
@@ -57,7 +57,7 @@ public class LoadBalancedRetryContext extends RetryContextSupport {
|
||||
|
||||
/**
|
||||
* Gets the service instance used during the retry.
|
||||
* @return the service instance used during the retry
|
||||
* @return The service instance used during the retry.
|
||||
*/
|
||||
public ServiceInstance getServiceInstance() {
|
||||
return serviceInstance;
|
||||
@@ -65,7 +65,7 @@ public class LoadBalancedRetryContext extends RetryContextSupport {
|
||||
|
||||
/**
|
||||
* Sets the service instance to use during the retry.
|
||||
* @param serviceInstance the service instance to use during the retry
|
||||
* @param serviceInstance The service instance to use during the retry.
|
||||
*/
|
||||
public void setServiceInstance(ServiceInstance serviceInstance) {
|
||||
this.serviceInstance = serviceInstance;
|
||||
|
||||
@@ -20,7 +20,7 @@ import org.springframework.retry.backoff.BackOffPolicy;
|
||||
import org.springframework.retry.backoff.NoBackOffPolicy;
|
||||
|
||||
/**
|
||||
* Factory class used to customize the retry functionality throughout Spring Cloud
|
||||
* Factory class used to customize the retry functionality throughout Spring Cloud.
|
||||
* @author Ryan Baxter
|
||||
*/
|
||||
public interface LoadBalancedRetryFactory {
|
||||
@@ -28,7 +28,7 @@ public interface LoadBalancedRetryFactory {
|
||||
/**
|
||||
* Creates a {@link LoadBalancedRetryPolicy}.
|
||||
* @param service The ID of the service to create the retry policy for.
|
||||
* @param serviceInstanceChooser Used to get the next server from a load balancer
|
||||
* @param serviceInstanceChooser Used to get the next server from a load balancer.
|
||||
* @return A retry policy for the service.
|
||||
*/
|
||||
default LoadBalancedRetryPolicy createRetryPolicy(String service, ServiceInstanceChooser serviceInstanceChooser) {
|
||||
@@ -36,18 +36,18 @@ public interface LoadBalancedRetryFactory {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an array of {@link RetryListener}s for a given service
|
||||
* @param service The service to create the {@link RetryListener}s for
|
||||
* @return An array of {@link RetryListener}s
|
||||
* Creates an array of {@link RetryListener}s for a given service.
|
||||
* @param service The service to create the {@link RetryListener}s for.
|
||||
* @return An array of {@link RetryListener}s.
|
||||
*/
|
||||
default RetryListener[] createRetryListeners(String service) {
|
||||
return new RetryListener[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link BackOffPolicy} for a given service
|
||||
* @param service The service to create the {@link BackOffPolicy} for
|
||||
* @return The {@link BackOffPolicy}
|
||||
* Creates a {@link BackOffPolicy} for a given service.
|
||||
* @param service The service to create the {@link BackOffPolicy} for.
|
||||
* @return The {@link BackOffPolicy}.
|
||||
*/
|
||||
default BackOffPolicy createBackOffPolicy(String service) {
|
||||
return new NoBackOffPolicy();
|
||||
|
||||
@@ -24,41 +24,40 @@ public interface LoadBalancedRetryPolicy {
|
||||
/**
|
||||
* Return true to retry the failed request on the same server.
|
||||
* This method may be called more than once when executing a single operation.
|
||||
* @param context the context for the retry operation
|
||||
* @return true to retry the failed request on the same server, false otherwise
|
||||
* @param context The context for the retry operation.
|
||||
* @return True to retry the failed request on the same server; false otherwise.
|
||||
*/
|
||||
public boolean canRetrySameServer(LoadBalancedRetryContext context);
|
||||
|
||||
/**
|
||||
* Return true to retry the failed request on the next server from the load balancer.
|
||||
* This method may be called more than once when executing a single operation.
|
||||
* @param context the context for the retry operation
|
||||
* @return true to retry the failed request on the next server from the load balancer, false otherwise
|
||||
* @param context The context for the retry operation.
|
||||
* @return True to retry the failed request on the next server from the load balancer; false otherwise.
|
||||
*/
|
||||
public boolean canRetryNextServer(LoadBalancedRetryContext context);
|
||||
|
||||
/**
|
||||
* Called when the retry operation has ended.
|
||||
* @param context the context for the retry operation
|
||||
* @param context The context for the retry operation.
|
||||
*/
|
||||
public abstract void close(LoadBalancedRetryContext context);
|
||||
|
||||
/**
|
||||
* Called when the execution fails.
|
||||
* @param context the context for the retry operation
|
||||
* @param throwable the throwable from the failed execution.
|
||||
* @param context The context for the retry operation.
|
||||
* @param throwable The throwable from the failed execution.
|
||||
*/
|
||||
public abstract void registerThrowable(LoadBalancedRetryContext context, Throwable throwable);
|
||||
|
||||
/**
|
||||
* If an exception is not thrown when making a request, than this method will be
|
||||
* called to see if the client would like to retry the request based on the status
|
||||
* code returned. For example in CloudFoundry the router will return a <code>404</code>
|
||||
* when an app is not available. Since HTTP clients do not throw an exception when
|
||||
* a <code>404</code> is returned than <code>retryableStatusCode</code> allows
|
||||
* clients to force a retry.
|
||||
* If an exception is not thrown when making a request, this method will be called to see if the
|
||||
* client would like to retry the request based on the status code returned. For example, in
|
||||
* Cloud Foundry, the router will return a <code>404</code> when an app is not available. Since
|
||||
* HTTP clients do not throw an exception when a <code>404</code> is returned,
|
||||
* <code>retryableStatusCode</code> allows clients to force a retry.
|
||||
* @param statusCode The HTTP status code.
|
||||
* @return True if a retry should be attempted, false to just return the response
|
||||
* @return True if a retry should be attempted; false to just return the response.
|
||||
*/
|
||||
public boolean retryableStatusCode(int statusCode);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Auto configuration for Ribbon (client side load balancing).
|
||||
* Auto-configuration for Ribbon (client-side load balancing).
|
||||
*
|
||||
* @author Spencer Gibb
|
||||
* @author Dave Syer
|
||||
|
||||
@@ -22,42 +22,42 @@ import java.io.IOException;
|
||||
import java.net.URI;
|
||||
|
||||
/**
|
||||
* Represents a client side load balancer
|
||||
* Represents a client-side load balancer.
|
||||
* @author Spencer Gibb
|
||||
*/
|
||||
public interface LoadBalancerClient extends ServiceInstanceChooser {
|
||||
|
||||
/**
|
||||
* execute request using a ServiceInstance from the LoadBalancer for the specified
|
||||
* service
|
||||
* @param serviceId the service id to look up the LoadBalancer
|
||||
* @param request allows implementations to execute pre and post actions such as
|
||||
* incrementing metrics
|
||||
* @return the result of the LoadBalancerRequest callback on the selected
|
||||
* ServiceInstance
|
||||
* Executes request using a ServiceInstance from the LoadBalancer for the specified
|
||||
* service.
|
||||
* @param serviceId The service ID to look up the LoadBalancer.
|
||||
* @param request Allows implementations to execute pre and post actions, such as
|
||||
* incrementing metrics.
|
||||
* @return The result of the LoadBalancerRequest callback on the selected
|
||||
* ServiceInstance.
|
||||
*/
|
||||
<T> T execute(String serviceId, LoadBalancerRequest<T> request) throws IOException;
|
||||
|
||||
/**
|
||||
* execute request using a ServiceInstance from the LoadBalancer for the specified
|
||||
* service
|
||||
* @param serviceId the service id to look up the LoadBalancer
|
||||
* @param serviceInstance the service to execute the request to
|
||||
* @param request allows implementations to execute pre and post actions such as
|
||||
* incrementing metrics
|
||||
* @return the result of the LoadBalancerRequest callback on the selected
|
||||
* ServiceInstance
|
||||
* Executes request using a ServiceInstance from the LoadBalancer for the specified
|
||||
* service.
|
||||
* @param serviceId The service ID to look up the LoadBalancer.
|
||||
* @param serviceInstance The service to execute the request to.
|
||||
* @param request Allows implementations to execute pre and post actions, such as
|
||||
* incrementing metrics.
|
||||
* @return The result of the LoadBalancerRequest callback on the selected
|
||||
* ServiceInstance.
|
||||
*/
|
||||
<T> T execute(String serviceId, ServiceInstance serviceInstance, LoadBalancerRequest<T> request) throws IOException;
|
||||
|
||||
/**
|
||||
* Create a proper URI with a real host and port for systems to utilize.
|
||||
* Some systems use a URI with the logical serivce name as the host,
|
||||
* Creates a proper URI with a real host and port for systems to utilize.
|
||||
* Some systems use a URI with the logical service name as the host,
|
||||
* such as http://myservice/path/to/service. This will replace the
|
||||
* service name with the host:port from the ServiceInstance.
|
||||
* @param instance
|
||||
* @param original a URI with the host as a logical service name
|
||||
* @return a reconstructed URI
|
||||
* @param original A URI with the host as a logical service name.
|
||||
* @return A reconstructed URI.
|
||||
*/
|
||||
URI reconstructURI(ServiceInstance instance, URI original);
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ import org.springframework.core.annotation.Order;
|
||||
import org.springframework.http.HttpRequest;
|
||||
|
||||
/**
|
||||
* Allows applications to transform the load balanced {@link HttpRequest} given
|
||||
* the chosen {@link ServiceInstance}
|
||||
* Allows applications to transform the load-balanced {@link HttpRequest} given
|
||||
* the chosen {@link ServiceInstance}.
|
||||
*
|
||||
* @author Will Tran
|
||||
*/
|
||||
@@ -30,4 +30,4 @@ public interface LoadBalancerRequestTransformer {
|
||||
public static final int DEFAULT_ORDER = 0;
|
||||
|
||||
HttpRequest transformRequest(HttpRequest request, ServiceInstance instance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,15 +27,15 @@ public class LoadBalancerRetryProperties {
|
||||
|
||||
/**
|
||||
* Returns true if the load balancer should retry failed requests.
|
||||
* @return true if the load balancer should retry failed request, false otherwise.
|
||||
* @return True if the load balancer should retry failed requests; false otherwise.
|
||||
*/
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether the load balancer should retry failed request.
|
||||
* @param enabled whether the load balancer should retry failed requests
|
||||
* Sets whether the load balancer should retry failed requests.
|
||||
* @param enabled Whether the load balancer should retry failed requests.
|
||||
*/
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
|
||||
@@ -27,9 +27,9 @@ import org.springframework.cloud.client.ServiceInstance;
|
||||
public interface ServiceInstanceChooser {
|
||||
|
||||
/**
|
||||
* Choose a ServiceInstance from the LoadBalancer for the specified service
|
||||
* @param serviceId the service id to look up the LoadBalancer
|
||||
* @return a ServiceInstance that matches the serviceId
|
||||
* Chooses a ServiceInstance from the LoadBalancer for the specified service.
|
||||
* @param serviceId The service ID to look up the LoadBalancer.
|
||||
* @return A ServiceInstance that matches the serviceId.
|
||||
*/
|
||||
ServiceInstance choose(String serviceId);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
package org.springframework.cloud.client.serviceregistry;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import javax.annotation.PreDestroy;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.boot.web.context.ConfigurableWebServerApplicationContext;
|
||||
import org.springframework.boot.web.context.WebServerInitializedEvent;
|
||||
@@ -9,25 +15,21 @@ import org.springframework.cloud.client.discovery.ManagementServerPortUtils;
|
||||
import org.springframework.cloud.client.discovery.event.InstanceRegisteredEvent;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.core.env.Environment;
|
||||
|
||||
import javax.annotation.PreDestroy;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
* Lifecycle methods that may be useful and common to {@link ServiceRegistry}
|
||||
* implementations.
|
||||
*
|
||||
* TODO: document the lifecycle
|
||||
* TODO: Document the lifecycle.
|
||||
*
|
||||
* @param <R> registration type passed to the {@link ServiceRegistry}.
|
||||
* @param <R> Registration type passed to the {@link ServiceRegistry}.
|
||||
*
|
||||
* @author Spencer Gibb
|
||||
*/
|
||||
public abstract class AbstractAutoServiceRegistration<R extends Registration>
|
||||
implements AutoServiceRegistration, ApplicationContextAware {
|
||||
implements AutoServiceRegistration, ApplicationContextAware, ApplicationListener<WebServerInitializedEvent> {
|
||||
private static final Log logger = LogFactory
|
||||
.getLog(AbstractAutoServiceRegistration.class);
|
||||
|
||||
@@ -60,7 +62,13 @@ public abstract class AbstractAutoServiceRegistration<R extends Registration>
|
||||
return context;
|
||||
}
|
||||
|
||||
@EventListener(WebServerInitializedEvent.class)
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public void onApplicationEvent(WebServerInitializedEvent event) {
|
||||
bind(event);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void bind(WebServerInitializedEvent event) {
|
||||
ApplicationContext context = event.getApplicationContext();
|
||||
if (context instanceof ConfigurableWebServerApplicationContext) {
|
||||
@@ -117,8 +125,8 @@ public abstract class AbstractAutoServiceRegistration<R extends Registration>
|
||||
}
|
||||
|
||||
/**
|
||||
* @return if the management service should be registered with the
|
||||
* {@link ServiceRegistry}
|
||||
* @return Whether the management service should be registered with the
|
||||
* {@link ServiceRegistry}.
|
||||
*/
|
||||
protected boolean shouldRegisterManagement() {
|
||||
if (this.properties == null || this.properties.isRegisterManagement()) {
|
||||
@@ -129,18 +137,18 @@ public abstract class AbstractAutoServiceRegistration<R extends Registration>
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the object used to configure the registration
|
||||
* @return The object used to configure the registration.
|
||||
*/
|
||||
@Deprecated
|
||||
protected abstract Object getConfiguration();
|
||||
|
||||
/**
|
||||
* @return true, if this is enabled
|
||||
* @return True, if this is enabled.
|
||||
*/
|
||||
protected abstract boolean isEnabled();
|
||||
|
||||
/**
|
||||
* @return the serviceId of the Management Service
|
||||
* @return The serviceId of the Management Service.
|
||||
*/
|
||||
@Deprecated
|
||||
protected String getManagementServiceId() {
|
||||
@@ -149,7 +157,7 @@ public abstract class AbstractAutoServiceRegistration<R extends Registration>
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the service name of the Management Service
|
||||
* @return The service name of the Management Service.
|
||||
*/
|
||||
@Deprecated
|
||||
protected String getManagementServiceName() {
|
||||
@@ -158,7 +166,7 @@ public abstract class AbstractAutoServiceRegistration<R extends Registration>
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the management server port
|
||||
* @return The management server port.
|
||||
*/
|
||||
@Deprecated
|
||||
protected Integer getManagementPort() {
|
||||
@@ -166,7 +174,7 @@ public abstract class AbstractAutoServiceRegistration<R extends Registration>
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the app name, currently the spring.application.name property
|
||||
* @return The app name (currently the spring.application.name property).
|
||||
*/
|
||||
@Deprecated
|
||||
protected String getAppName() {
|
||||
@@ -203,14 +211,14 @@ public abstract class AbstractAutoServiceRegistration<R extends Registration>
|
||||
protected abstract R getManagementRegistration();
|
||||
|
||||
/**
|
||||
* Register the local service with the {@link ServiceRegistry}
|
||||
* Register the local service with the {@link ServiceRegistry}.
|
||||
*/
|
||||
protected void register() {
|
||||
this.serviceRegistry.register(getRegistration());
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the local management service with the {@link ServiceRegistry}
|
||||
* Register the local management service with the {@link ServiceRegistry}.
|
||||
*/
|
||||
protected void registerManagement() {
|
||||
R registration = getManagementRegistration();
|
||||
@@ -220,14 +228,14 @@ public abstract class AbstractAutoServiceRegistration<R extends Registration>
|
||||
}
|
||||
|
||||
/**
|
||||
* De-register the local service with the {@link ServiceRegistry}
|
||||
* De-register the local service with the {@link ServiceRegistry}.
|
||||
*/
|
||||
protected void deregister() {
|
||||
this.serviceRegistry.deregister(getRegistration());
|
||||
}
|
||||
|
||||
/**
|
||||
* De-register the local management service with the {@link ServiceRegistry}
|
||||
* De-register the local management service with the {@link ServiceRegistry}.
|
||||
*/
|
||||
protected void deregisterManagement() {
|
||||
R registration = getManagementRegistration();
|
||||
|
||||
@@ -8,13 +8,13 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@ConfigurationProperties("spring.cloud.service-registry.auto-registration")
|
||||
public class AutoServiceRegistrationProperties {
|
||||
|
||||
/** If Auto-Service Registration is enabled, default to true. */
|
||||
/** Whether service auto-registration is enabled. Defaults to true. */
|
||||
private boolean enabled = true;
|
||||
|
||||
/** Whether to register the management as a service, defaults to true */
|
||||
/** Whether to register the management as a service. Defaults to true. */
|
||||
private boolean registerManagement = true;
|
||||
|
||||
/** Should startup fail if there is no AutoServiceRegistration, default to false. */
|
||||
/** Whether startup fails if there is no AutoServiceRegistration. Defaults to false. */
|
||||
private boolean failFast = false;
|
||||
|
||||
public boolean isEnabled() {
|
||||
|
||||
@@ -9,20 +9,20 @@ package org.springframework.cloud.client.serviceregistry;
|
||||
public interface ServiceRegistry<R extends Registration> {
|
||||
|
||||
/**
|
||||
* Register the registration. Registrations typically have information about
|
||||
* instances such as: hostname and port.
|
||||
* @param registration the registraion
|
||||
* Registers the registration. A registration typically has information about
|
||||
* an instance, such as its hostname and port.
|
||||
* @param registration The registration.
|
||||
*/
|
||||
void register(R registration);
|
||||
|
||||
/**
|
||||
* Deregister the registration.
|
||||
* Deregisters the registration.
|
||||
* @param registration
|
||||
*/
|
||||
void deregister(R registration);
|
||||
|
||||
/**
|
||||
* Close the ServiceRegistry. This a lifecycle method.
|
||||
* Closes the ServiceRegistry. This is a lifecycle method.
|
||||
*/
|
||||
void close();
|
||||
|
||||
@@ -31,8 +31,8 @@ public interface ServiceRegistry<R extends Registration> {
|
||||
* by the individual implementations.
|
||||
*
|
||||
* @see org.springframework.cloud.client.serviceregistry.endpoint.ServiceRegistryEndpoint
|
||||
* @param registration the registration to update
|
||||
* @param status the status to set
|
||||
* @param registration The registration to update.
|
||||
* @param status The status to set.
|
||||
*/
|
||||
void setStatus(R registration, String status);
|
||||
|
||||
@@ -40,9 +40,9 @@ public interface ServiceRegistry<R extends Registration> {
|
||||
* Gets the status of a particular registration.
|
||||
*
|
||||
* @see org.springframework.cloud.client.serviceregistry.endpoint.ServiceRegistryEndpoint
|
||||
* @param registration the registration to query
|
||||
* @param <T> the type of the status
|
||||
* @return the status of the registration
|
||||
* @param registration The registration to query.
|
||||
* @param <T> The type of the status.
|
||||
* @return The status of the registration.
|
||||
*/
|
||||
<T> T getStatus(R registration);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Endpoint to display and set the service instance status using the service registry.
|
||||
* Endpoint to display and set the service instance status using the ServiceRegistry.
|
||||
*
|
||||
* @author Spencer Gibb
|
||||
*/
|
||||
|
||||
@@ -33,13 +33,13 @@ public interface ApacheHttpClientConnectionManagerFactory {
|
||||
|
||||
/**
|
||||
* Creates a new {@link HttpClientConnectionManager}.
|
||||
* @param disableSslValidation True to disable SSL validation, false otherwise
|
||||
* @param maxTotalConnections The total number of connections
|
||||
* @param maxConnectionsPerRoute The total number of connections per route
|
||||
* @param timeToLive The time a connection is allowed to exist
|
||||
* @param timeUnit The time unit for the time to live value
|
||||
* @param registryBuilder The {@link RegistryBuilder} to use in the connection manager
|
||||
* @return A new {@link HttpClientConnectionManager}
|
||||
* @param disableSslValidation If true, SSL validation will be disabled.
|
||||
* @param maxTotalConnections The total number of connections.
|
||||
* @param maxConnectionsPerRoute The total number of connections per route.
|
||||
* @param timeToLive The time a connection is allowed to exist.
|
||||
* @param timeUnit The time unit for the time-to-live value.
|
||||
* @param registryBuilder The {@link RegistryBuilder} to use in the connection manager.
|
||||
* @return A new {@link HttpClientConnectionManager}.
|
||||
*/
|
||||
public HttpClientConnectionManager newConnectionManager(boolean disableSslValidation,
|
||||
int maxTotalConnections, int maxConnectionsPerRoute, long timeToLive,
|
||||
|
||||
@@ -29,7 +29,7 @@ public interface ApacheHttpClientFactory {
|
||||
|
||||
/**
|
||||
* Creates an {@link HttpClientBuilder} that can be used to create a new {@link CloseableHttpClient}.
|
||||
* @return A {@link HttpClientBuilder}
|
||||
* @return A {@link HttpClientBuilder}.
|
||||
*/
|
||||
public HttpClientBuilder createBuilder();
|
||||
}
|
||||
|
||||
@@ -16,7 +16,8 @@ public class DefaultApacheHttpClientFactory implements ApacheHttpClientFactory {
|
||||
|
||||
/**
|
||||
* A default {@link HttpClientBuilder}. The {@link HttpClientBuilder} returned will
|
||||
* have content compression disabled, cookie management disabled, and use system properties.
|
||||
* have content compression disabled, have cookie management disabled, and use system
|
||||
* properties.
|
||||
*/
|
||||
@Override
|
||||
public HttpClientBuilder createBuilder() {
|
||||
|
||||
@@ -5,17 +5,17 @@ import okhttp3.ConnectionPool;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Creates {@link ConnectionPool}s for {@link okhttp3.OkHttpClient}s
|
||||
* Creates {@link ConnectionPool}s for {@link okhttp3.OkHttpClient}s.
|
||||
* @author Ryan Baxter
|
||||
*/
|
||||
public interface OkHttpClientConnectionPoolFactory {
|
||||
|
||||
/**
|
||||
* Creates a new {@link ConnectionPool}.
|
||||
* @param maxIdleConnections number of max idle connections to allow
|
||||
* @param keepAliveDuration amount of time to keep connections alive
|
||||
* @param timeUnit the time unit for the keep alive duration
|
||||
* @return A new {@link ConnectionPool}
|
||||
* @param maxIdleConnections Number of max idle connections to allow.
|
||||
* @param keepAliveDuration Amount of time to keep connections alive.
|
||||
* @param timeUnit The time unit for the keep-alive duration.
|
||||
* @return A new {@link ConnectionPool}.
|
||||
*/
|
||||
public ConnectionPool create(int maxIdleConnections, long keepAliveDuration, TimeUnit timeUnit);
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ public class InetUtils implements Closeable {
|
||||
return null;
|
||||
}
|
||||
|
||||
/** for testing */ boolean isPreferredAddress(InetAddress address) {
|
||||
/** For testing. */ boolean isPreferredAddress(InetAddress address) {
|
||||
|
||||
if (this.properties.isUseOnlySiteLocalInterfaces()) {
|
||||
final boolean siteLocalAddress = address.isSiteLocalAddress();
|
||||
@@ -148,7 +148,7 @@ public class InetUtils implements Closeable {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** for testing */ boolean ignoreInterface(String interfaceName) {
|
||||
/** For testing. */ boolean ignoreInterface(String interfaceName) {
|
||||
for (String regex : this.properties.getIgnoredInterfaces()) {
|
||||
if (interfaceName.matches(regex)) {
|
||||
log.trace("Ignoring interface: " + interfaceName);
|
||||
|
||||
@@ -36,28 +36,29 @@ public class InetUtilsProperties {
|
||||
private String defaultHostname = "localhost";
|
||||
|
||||
/**
|
||||
* The default ipaddress. Used in case of errors.
|
||||
* The default IP address. Used in case of errors.
|
||||
*/
|
||||
private String defaultIpAddress = "127.0.0.1";
|
||||
|
||||
/**
|
||||
* Timeout in seconds for calculating hostname.
|
||||
* Timeout, in seconds, for calculating hostname.
|
||||
*/
|
||||
@Value("${spring.util.timeout.sec:${SPRING_UTIL_TIMEOUT_SEC:1}}")
|
||||
private int timeoutSeconds = 1;
|
||||
|
||||
/**
|
||||
* List of Java regex expressions for network interfaces that will be ignored.
|
||||
* List of Java regular expressions for network interfaces that will be ignored.
|
||||
*/
|
||||
private List<String> ignoredInterfaces = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Use only interfaces with site local addresses. See {@link InetAddress#isSiteLocalAddress()} for more details.
|
||||
* Whether to use only interfaces with site local addresses.
|
||||
* See {@link InetAddress#isSiteLocalAddress()} for more details.
|
||||
*/
|
||||
private boolean useOnlySiteLocalInterfaces = false;
|
||||
|
||||
/**
|
||||
* List of Java regex expressions for network addresses that will be preferred.
|
||||
* List of Java regular expressions for network addresses that will be preferred.
|
||||
*/
|
||||
private List<String> preferredNetworks = new ArrayList<>();
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.springframework.util.Assert;
|
||||
|
||||
|
||||
/**
|
||||
* Selects configurations to load defined by the generic type T. Loads implementations
|
||||
* Selects configurations to load, defined by the generic type T. Loads implementations
|
||||
* using {@link SpringFactoriesLoader}.
|
||||
*
|
||||
* @author Spencer Gibb
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.springframework.cloud.client;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.boot.WebApplicationType;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.cloud.client.actuator.FeaturesEndpoint;
|
||||
@@ -81,7 +82,7 @@ public class CommonsClientAutoConfigurationTests {
|
||||
}
|
||||
|
||||
protected ConfigurableApplicationContext init(String... pairs) {
|
||||
return new SpringApplicationBuilder().web(false).sources(Config.class)
|
||||
return new SpringApplicationBuilder().web(WebApplicationType.NONE).sources(Config.class)
|
||||
.properties(pairs).run();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.springframework.cloud.client.discovery;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.boot.WebApplicationType;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
@@ -19,7 +20,7 @@ public class EnableDiscoveryClientMissingImplTests {
|
||||
@Test
|
||||
public void testContextFails() {
|
||||
try (ConfigurableApplicationContext context = new SpringApplicationBuilder()
|
||||
.sources(App.class).web(false).run(new String[0]);) {
|
||||
.sources(App.class).web(WebApplicationType.NONE).run(new String[0]);) {
|
||||
}
|
||||
catch (NestedRuntimeException e) {
|
||||
Throwable rootCause = e.getRootCause();
|
||||
|
||||
@@ -31,6 +31,7 @@ import java.util.Random;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.WebApplicationType;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.cloud.client.DefaultServiceInstance;
|
||||
import org.springframework.cloud.client.ServiceInstance;
|
||||
@@ -81,7 +82,7 @@ public abstract class AbstractLoadBalancerAutoConfigurationTests {
|
||||
}
|
||||
|
||||
protected ConfigurableApplicationContext init(Class<?> config) {
|
||||
return new SpringApplicationBuilder().web(false)
|
||||
return new SpringApplicationBuilder().web(WebApplicationType.NONE)
|
||||
.properties("spring.aop.proxyTargetClass=true")
|
||||
.sources(config, LoadBalancerAutoConfiguration.class).run();
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ package org.springframework.cloud.client.loadbalancer;
|
||||
import org.hamcrest.MatcherAssert;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.WebApplicationType;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.cloud.client.DefaultServiceInstance;
|
||||
import org.springframework.cloud.client.ServiceInstance;
|
||||
@@ -89,7 +90,7 @@ public class AsyncLoadBalancerAutoConfigurationTests {
|
||||
}
|
||||
|
||||
protected ConfigurableApplicationContext init(Class<?> config) {
|
||||
return new SpringApplicationBuilder().web(false)
|
||||
return new SpringApplicationBuilder().web(WebApplicationType.NONE)
|
||||
.properties("spring.aop.proxyTargetClass=true")
|
||||
.sources(config, AsyncLoadBalancerAutoConfiguration.class).run();
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ import org.junit.runner.RunWith;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.runners.MockitoJUnitRunner;
|
||||
import org.springframework.boot.WebApplicationType;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.cloud.client.ServiceInstance;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
@@ -62,7 +63,7 @@ public class LoadBalancerRequestFactoryConfigurationTests {
|
||||
}
|
||||
|
||||
protected ConfigurableApplicationContext init(Class<?> config) {
|
||||
ConfigurableApplicationContext context = new SpringApplicationBuilder().web(false)
|
||||
ConfigurableApplicationContext context = new SpringApplicationBuilder().web(WebApplicationType.NONE)
|
||||
.properties("spring.aop.proxyTargetClass=true")
|
||||
.sources(config, LoadBalancerAutoConfiguration.class).run();
|
||||
|
||||
|
||||
@@ -8,8 +8,9 @@ import org.hamcrest.Matchers;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
import org.springframework.beans.factory.BeanCreationException;
|
||||
import org.springframework.boot.test.util.EnvironmentTestUtils;
|
||||
import org.springframework.boot.test.util.TestPropertyValues;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -74,7 +75,7 @@ public class AutoServiceRegistrationAutoConfigurationTests {
|
||||
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
context.register(list.toArray(new Class[0]));
|
||||
if (StringUtils.hasText(property)) {
|
||||
EnvironmentTestUtils.addEnvironment(context, property);
|
||||
TestPropertyValues.of(property).applyTo(context);
|
||||
}
|
||||
context.refresh();
|
||||
return context;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-commons-parent</artifactId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>spring-cloud-context-integration-tests</artifactId>
|
||||
|
||||
@@ -49,6 +49,7 @@ import static org.junit.Assert.assertTrue;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = TestConfiguration.class)
|
||||
@SuppressWarnings("Duplicates")
|
||||
public class RefreshScopeIntegrationTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-commons-parent</artifactId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>spring-cloud-context</artifactId>
|
||||
@@ -55,6 +55,11 @@
|
||||
<artifactId>spring-integration-jmx</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-autoconfigure-processor</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
|
||||
@@ -24,8 +24,8 @@ import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
|
||||
/**
|
||||
* Autoconfiguration for some MVC endpoints governing the application context lifecycle.
|
||||
* Provides restart, pause, resume, refresh (environment) and environment update
|
||||
* Auto-configuration for some MVC endpoints governing the application context lifecycle.
|
||||
* Provides restart, pause, resume, refresh (environment), and environment update
|
||||
* endpoints.
|
||||
*
|
||||
* @author Dave Syer
|
||||
|
||||
@@ -23,13 +23,14 @@ import java.util.Set;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.springframework.aop.scope.ScopedProxyUtils;
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.ListableBeanFactory;
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.config.BeanDefinitionHolder;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor;
|
||||
@@ -62,10 +63,14 @@ import org.springframework.stereotype.Component;
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnClass(RefreshScope.class)
|
||||
@ConditionalOnProperty(name = "spring.cloud.refresh.enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(name = RefreshAutoConfiguration.REFRESH_SCOPE_ENABLED, matchIfMissing = true)
|
||||
@AutoConfigureBefore(HibernateJpaAutoConfiguration.class)
|
||||
public class RefreshAutoConfiguration {
|
||||
|
||||
public static final String REFRESH_SCOPE_NAME = "refresh";
|
||||
public static final String REFRESH_SCOPE_PREFIX = "spring.cloud.refresh";
|
||||
public static final String REFRESH_SCOPE_ENABLED = REFRESH_SCOPE_PREFIX + ".enabled";
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(RefreshScope.class)
|
||||
public static RefreshScope refreshScope() {
|
||||
@@ -95,7 +100,9 @@ public class RefreshAutoConfiguration {
|
||||
|
||||
@Component
|
||||
protected static class RefreshScopeBeanDefinitionEnhancer
|
||||
implements BeanDefinitionRegistryPostProcessor {
|
||||
implements BeanPostProcessor, BeanDefinitionRegistryPostProcessor {
|
||||
|
||||
private BeanDefinitionRegistry registry;
|
||||
|
||||
/**
|
||||
* Class names for beans to post process into refresh scope. Useful when you don't
|
||||
@@ -104,8 +111,6 @@ public class RefreshAutoConfiguration {
|
||||
private Set<String> refreshables = new HashSet<>(
|
||||
Arrays.asList("com.zaxxer.hikari.HikariDataSource"));
|
||||
|
||||
private Environment environment;
|
||||
|
||||
public Set<String> getRefreshable() {
|
||||
return this.refreshables;
|
||||
}
|
||||
@@ -124,29 +129,42 @@ public class RefreshAutoConfiguration {
|
||||
@Override
|
||||
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
|
||||
throws BeansException {
|
||||
Environment environment = beanFactory.getBean(Environment.class);
|
||||
if (environment == null) {
|
||||
environment = new StandardEnvironment();
|
||||
}
|
||||
Binder.get(environment).bind(REFRESH_SCOPE_PREFIX, Bindable.ofInstance(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry)
|
||||
throws BeansException {
|
||||
for (String name : registry.getBeanDefinitionNames()) {
|
||||
BeanDefinition definition = registry.getBeanDefinition(name);
|
||||
if (isApplicable(registry, name, definition)) {
|
||||
BeanDefinitionHolder holder = new BeanDefinitionHolder(definition,
|
||||
name);
|
||||
BeanDefinitionHolder proxy = ScopedProxyUtils
|
||||
.createScopedProxy(holder, registry, true);
|
||||
definition.setScope("refresh");
|
||||
registry.registerBeanDefinition(proxy.getBeanName(),
|
||||
proxy.getBeanDefinition());
|
||||
}
|
||||
this.registry = registry;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object postProcessAfterInitialization(Object bean, String beanName)
|
||||
throws BeansException {
|
||||
BeanDefinition definition = null;
|
||||
try {
|
||||
definition = registry.getBeanDefinition(beanName);
|
||||
}
|
||||
catch (NoSuchBeanDefinitionException e) {
|
||||
// just ignore and move on
|
||||
return bean;
|
||||
}
|
||||
if (isApplicable(registry, beanName, definition)) {
|
||||
definition.setScope(REFRESH_SCOPE_NAME);
|
||||
ProxyFactory proxyFactory = new ProxyFactory(bean);
|
||||
return proxyFactory.getProxy();
|
||||
}
|
||||
return bean;
|
||||
}
|
||||
|
||||
private boolean isApplicable(BeanDefinitionRegistry registry, String name,
|
||||
BeanDefinition definition) {
|
||||
String scope = definition.getScope();
|
||||
if ("refresh".equals(scope)) {
|
||||
if (REFRESH_SCOPE_NAME.equals(scope)) {
|
||||
// Already refresh scoped
|
||||
return false;
|
||||
}
|
||||
@@ -158,15 +176,6 @@ public class RefreshAutoConfiguration {
|
||||
}
|
||||
}
|
||||
if (type != null) {
|
||||
if (this.environment == null && registry instanceof BeanFactory) {
|
||||
this.environment = ((BeanFactory) registry)
|
||||
.getBean(Environment.class);
|
||||
}
|
||||
if (this.environment == null) {
|
||||
this.environment = new StandardEnvironment();
|
||||
}
|
||||
Binder.get(environment).bind("spring.cloud.refresh",
|
||||
Bindable.ofInstance(this));
|
||||
return this.refreshables.contains(type);
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -54,7 +54,7 @@ public class WritableEnvironmentEndpointAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnEnabledEndpoint
|
||||
public WritableEnvironmentEndpointWebExtension environmentWebEndpointExtension(
|
||||
public WritableEnvironmentEndpointWebExtension environmentEndpointWebExtension(
|
||||
WritableEnvironmentEndpoint endpoint, EnvironmentManager environment) {
|
||||
return new WritableEnvironmentEndpointWebExtension(endpoint, environment);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ import java.lang.annotation.Target;
|
||||
public @interface BootstrapConfiguration {
|
||||
|
||||
/**
|
||||
* Exclude specific auto-configuration classes such that they will never be applied.
|
||||
* Excludes specific auto-configuration classes such that they will never be applied.
|
||||
*/
|
||||
Class<?>[] exclude() default {};
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ public class PropertySourceBootstrapProperties {
|
||||
|
||||
/**
|
||||
* Flag to indicate that when {@link #setAllowOverride(boolean) allowOverride} is
|
||||
* true, external properties should take lowest priority, and not override any
|
||||
* true, external properties should take lowest priority and should not override any
|
||||
* existing property sources (including local config files). Default false.
|
||||
*/
|
||||
private boolean overrideNone = false;
|
||||
|
||||
@@ -29,10 +29,10 @@ import org.springframework.core.env.PropertySource;
|
||||
public interface PropertySourceLocator {
|
||||
|
||||
/**
|
||||
* @param environment the current Environment
|
||||
* @return a PropertySource or null if there is none
|
||||
* @param environment The current Environment.
|
||||
* @return A PropertySource, or null if there is none.
|
||||
*
|
||||
* @throws IllegalStateException if there is a fail fast condition
|
||||
* @throws IllegalStateException if there is a fail-fast condition.
|
||||
*/
|
||||
PropertySource<?> locate(Environment environment);
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ import org.springframework.core.env.SystemEnvironmentPropertySource;
|
||||
import org.springframework.security.crypto.encrypt.TextEncryptor;
|
||||
|
||||
/**
|
||||
* Decrypt properties from the environment and insert them with high priority so they
|
||||
* Decrypts properties from the environment and inserts them with high priority so they
|
||||
* override the encrypted values.
|
||||
*
|
||||
* @author Dave Syer
|
||||
@@ -67,7 +67,7 @@ public class EnvironmentDecryptApplicationInitializer implements
|
||||
/**
|
||||
* Strategy to determine how to handle exceptions during decryption.
|
||||
*
|
||||
* @param failOnError the flag value (default true)
|
||||
* @param failOnError The flag value (default true).
|
||||
*/
|
||||
public void setFailOnError(boolean failOnError) {
|
||||
this.failOnError = failOnError;
|
||||
|
||||
@@ -22,13 +22,13 @@ import org.springframework.core.io.Resource;
|
||||
public class KeyProperties {
|
||||
|
||||
/**
|
||||
* A symmetric key. As a stronger alternative consider using a keystore.
|
||||
* A symmetric key. As a stronger alternative, consider using a keystore.
|
||||
*/
|
||||
private String key;
|
||||
|
||||
/**
|
||||
* A salt for the symmetric key in the form of a hex-encoded byte array. As a stronger
|
||||
* alternative consider using a keystore.
|
||||
* A salt for the symmetric key, in the form of a hex-encoded byte array. As a stronger
|
||||
* alternative, consider using a keystore.
|
||||
*/
|
||||
private String salt = "deadbeef";
|
||||
|
||||
@@ -131,4 +131,4 @@ public class KeyProperties {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,22 +27,22 @@ import org.springframework.security.rsa.crypto.RsaAlgorithm;
|
||||
public class RsaProperties {
|
||||
|
||||
/**
|
||||
* The RSA algorithm to use (DEFAULT or OEAP). Once it is set do not change it (or
|
||||
* existing ciphers will not a decryptable).
|
||||
* The RSA algorithm to use (DEFAULT or OEAP). Once it is set, do not change it (or
|
||||
* existing ciphers will not be decryptable).
|
||||
*/
|
||||
private RsaAlgorithm algorithm = RsaAlgorithm.DEFAULT;
|
||||
|
||||
/**
|
||||
* Flag to indicate that "strong" AES encryption should be used internally. If
|
||||
* true then the GCM algorithm is applied to the AES encrypted bytes. Default is
|
||||
* false (in which case "standard" CBC is used instead). Once it is set do not
|
||||
* change it (or existing ciphers will not a decryptable).
|
||||
* true, then the GCM algorithm is applied to the AES encrypted bytes. Default is
|
||||
* false (in which case "standard" CBC is used instead). Once it is set, do not
|
||||
* change it (or existing ciphers will not be decryptable).
|
||||
*/
|
||||
private boolean strong = false;
|
||||
|
||||
/**
|
||||
* Salt for the random secret used to encrypt cipher text. Once it is set do not
|
||||
* change it (or existing ciphers will not a decryptable).
|
||||
* Salt for the random secret used to encrypt cipher text. Once it is set, do not
|
||||
* change it (or existing ciphers will not be decryptable).
|
||||
*/
|
||||
private String salt = "deadbeef";
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public class EnvironmentChangeEvent extends ApplicationEvent {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the keys
|
||||
* @return The keys.
|
||||
*/
|
||||
public Set<String> getKeys() {
|
||||
return keys;
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.springframework.stereotype.Component;
|
||||
/**
|
||||
* Entry point for making local (but volatile) changes to the {@link Environment} of a
|
||||
* running application. Allows properties to be added and values changed, simply by adding
|
||||
* them to a high priority property source in the existing Environment.
|
||||
* them to a high-priority property source in the existing Environment.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.springframework.boot.actuate.endpoint.web.annotation.EndpointWebExten
|
||||
import org.springframework.boot.actuate.env.EnvironmentEndpointWebExtension;
|
||||
|
||||
/**
|
||||
* MVC endpoint for the {@link EnvironmentManager} providing a POST to /env as a simple
|
||||
* MVC endpoint for the {@link EnvironmentManager}, providing a POST to /env as a simple
|
||||
* way to change the Environment.
|
||||
*
|
||||
* @author Dave Syer
|
||||
|
||||
@@ -74,7 +74,7 @@ ApplicationContextAware {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param beans the bean meta data to set
|
||||
* @param beans The bean meta data to set.
|
||||
*/
|
||||
public void setBeanMetaDataStore(ConfigurationBeanFactoryMetadata beans) {
|
||||
this.metaData = beans;
|
||||
|
||||
@@ -20,7 +20,6 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.springframework.aop.framework.Advised;
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@@ -34,15 +33,16 @@ import org.springframework.jmx.export.annotation.ManagedAttribute;
|
||||
import org.springframework.jmx.export.annotation.ManagedOperation;
|
||||
import org.springframework.jmx.export.annotation.ManagedResource;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.cloud.util.ProxyUtils;
|
||||
|
||||
/**
|
||||
* Listens for {@link EnvironmentChangeEvent} and rebinds beans that were bound to the
|
||||
* {@link Environment} using {@link ConfigurationProperties
|
||||
* <code>@ConfigurationProperties</code>}. When these beans are re-bound and
|
||||
* re-initialized the changes are available immediately to any component that is using the
|
||||
* re-initialized, the changes are available immediately to any component that is using the
|
||||
* <code>@ConfigurationProperties</code> bean.
|
||||
*
|
||||
* @see RefreshScope for a deeper and optionally more focused refresh of bean components
|
||||
* @see RefreshScope for a deeper and optionally more focused refresh of bean components.
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
@@ -71,7 +71,7 @@ public class ConfigurationPropertiesRebinder
|
||||
/**
|
||||
* A map of bean name to errors when instantiating the bean.
|
||||
*
|
||||
* @return the errors accumulated since the latest destroy
|
||||
* @return The errors accumulated since the latest destroy.
|
||||
*/
|
||||
public Map<String, Exception> getErrors() {
|
||||
return this.errors;
|
||||
@@ -94,7 +94,7 @@ public class ConfigurationPropertiesRebinder
|
||||
try {
|
||||
Object bean = this.applicationContext.getBean(name);
|
||||
if (AopUtils.isAopProxy(bean)) {
|
||||
bean = getTargetObject(bean);
|
||||
bean = ProxyUtils.getTargetObject(bean);
|
||||
}
|
||||
if (bean != null) {
|
||||
this.applicationContext.getAutowireCapableBeanFactory().destroyBean(bean);
|
||||
@@ -115,19 +115,6 @@ public class ConfigurationPropertiesRebinder
|
||||
return false;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private static <T> T getTargetObject(Object candidate) {
|
||||
try {
|
||||
if (AopUtils.isAopProxy(candidate) && (candidate instanceof Advised)) {
|
||||
return (T) ((Advised) candidate).getTargetSource().getTarget();
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new IllegalStateException("Failed to unwrap proxied object", ex);
|
||||
}
|
||||
return (T) candidate;
|
||||
}
|
||||
|
||||
@ManagedAttribute
|
||||
public Set<String> getBeanNames() {
|
||||
return new HashSet<String>(this.beans.getBeanNames());
|
||||
|
||||
@@ -56,18 +56,31 @@ public class ContextRefresher {
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
protected ConfigurableApplicationContext getContext() {
|
||||
return this.context;
|
||||
}
|
||||
|
||||
protected RefreshScope getScope() {
|
||||
return this.scope;
|
||||
}
|
||||
|
||||
public synchronized Set<String> refresh() {
|
||||
Set<String> keys = refreshEnvironment();
|
||||
this.scope.refreshAll();
|
||||
return keys;
|
||||
}
|
||||
|
||||
public synchronized Set<String> refreshEnvironment() {
|
||||
Map<String, Object> before = extract(
|
||||
this.context.getEnvironment().getPropertySources());
|
||||
addConfigFilesToEnvironment();
|
||||
Set<String> keys = changes(before,
|
||||
extract(this.context.getEnvironment().getPropertySources())).keySet();
|
||||
this.context.publishEvent(new EnvironmentChangeEvent(context, keys));
|
||||
this.scope.refreshAll();
|
||||
return keys;
|
||||
}
|
||||
|
||||
/* for testing */ ConfigurableApplicationContext addConfigFilesToEnvironment() {
|
||||
/* For testing. */ ConfigurableApplicationContext addConfigFilesToEnvironment() {
|
||||
ConfigurableApplicationContext capture = null;
|
||||
try {
|
||||
StandardEnvironment environment = copyEnvironment(
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.context.event.SmartApplicationListener;
|
||||
|
||||
/**
|
||||
* A listener that stores enough information about an application as it starts, to be able
|
||||
* A listener that stores enough information about an application, as it starts, to be able
|
||||
* to restart it later if needed.
|
||||
*
|
||||
* @author Dave Syer
|
||||
|
||||
@@ -91,10 +91,10 @@ public class GenericScope implements Scope, BeanFactoryPostProcessor,
|
||||
private ConcurrentMap<String, ReadWriteLock> locks = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
* Manual override for the serialization id that will be used to identify the bean
|
||||
* Manual override for the serialization ID that will be used to identify the bean
|
||||
* factory. The default is a unique key based on the bean names in the bean factory.
|
||||
*
|
||||
* @param id the id to set
|
||||
* @param id The ID to set.
|
||||
*/
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
@@ -103,7 +103,7 @@ public class GenericScope implements Scope, BeanFactoryPostProcessor,
|
||||
/**
|
||||
* The name of this scope. Default "generic".
|
||||
*
|
||||
* @param name the name value to set
|
||||
* @param name The name value to set.
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
@@ -112,7 +112,7 @@ public class GenericScope implements Scope, BeanFactoryPostProcessor,
|
||||
/**
|
||||
* The cache implementation to use for bean instances in this scope.
|
||||
*
|
||||
* @param cache the cache to use
|
||||
* @param cache The cache to use.
|
||||
*/
|
||||
public void setScopeCache(ScopeCache cache) {
|
||||
this.cache = new BeanLifecycleWrapperCache(cache);
|
||||
@@ -121,7 +121,7 @@ public class GenericScope implements Scope, BeanFactoryPostProcessor,
|
||||
/**
|
||||
* A map of bean name to errors when instantiating the bean.
|
||||
*
|
||||
* @return the errors accumulated since the latest destroy
|
||||
* @return The errors accumulated since the latest destroy.
|
||||
*/
|
||||
public Map<String, Exception> getErrors() {
|
||||
return this.errors;
|
||||
@@ -153,10 +153,10 @@ public class GenericScope implements Scope, BeanFactoryPostProcessor,
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy the named bean (i.e. flush it from the cache by default).
|
||||
* Destroys the named bean (i.e. flushes it from the cache by default).
|
||||
*
|
||||
* @param name the bean name to flush
|
||||
* @return true if the bean was already cached, false otherwise
|
||||
* @param name The bean name to flush.
|
||||
* @return True if the bean was already cached; false otherwise.
|
||||
*/
|
||||
protected boolean destroy(String name) {
|
||||
BeanLifecycleWrapper wrapper = this.cache.remove(name);
|
||||
@@ -258,6 +258,7 @@ public class GenericScope implements Scope, BeanFactoryPostProcessor,
|
||||
if (getName().equals(root.getDecoratedDefinition().getBeanDefinition()
|
||||
.getScope())) {
|
||||
root.setBeanClass(LockedScopedProxyFactoryBean.class);
|
||||
root.getConstructorArgumentValues().addGenericArgumentValue(this);
|
||||
// surprising that a scoped proxy bean definition is not already
|
||||
// marked as synthetic?
|
||||
root.setSynthetic(true);
|
||||
@@ -268,13 +269,13 @@ public class GenericScope implements Scope, BeanFactoryPostProcessor,
|
||||
}
|
||||
|
||||
/**
|
||||
* If the bean factory is a DefaultListableBeanFactory then it can serialize scoped
|
||||
* If the bean factory is a DefaultListableBeanFactory, then it can serialize scoped
|
||||
* beans and deserialize them in another context (even in another JVM), as long as the
|
||||
* ids of the bean factories match. This method sets up the serialization id to be
|
||||
* either the id provided to the scope instance, or if that is null, a hash of all the
|
||||
* IDs of the bean factories match. This method sets up the serialization ID to be
|
||||
* either the ID provided to the scope instance, or if that is null, a hash of all the
|
||||
* bean names.
|
||||
*
|
||||
* @param beanFactory the bean factory to configure
|
||||
* @param beanFactory The bean factory to configure.
|
||||
*/
|
||||
private void setSerializationId(ConfigurableListableBeanFactory beanFactory) {
|
||||
|
||||
@@ -316,6 +317,10 @@ public class GenericScope implements Scope, BeanFactoryPostProcessor,
|
||||
return this.name;
|
||||
}
|
||||
|
||||
protected ReadWriteLock getLock(String beanName) {
|
||||
return locks.get(beanName);
|
||||
}
|
||||
|
||||
private static class BeanLifecycleWrapperCache {
|
||||
|
||||
private final ScopeCache cache;
|
||||
@@ -437,11 +442,16 @@ public class GenericScope implements Scope, BeanFactoryPostProcessor,
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class LockedScopedProxyFactoryBean extends ScopedProxyFactoryBean
|
||||
implements MethodInterceptor {
|
||||
public static class LockedScopedProxyFactoryBean<S extends GenericScope>
|
||||
extends ScopedProxyFactoryBean implements MethodInterceptor {
|
||||
|
||||
private final S scope;
|
||||
private String targetBeanName;
|
||||
|
||||
public LockedScopedProxyFactoryBean(S scope) {
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) {
|
||||
super.setBeanFactory(beanFactory);
|
||||
@@ -467,10 +477,11 @@ public class GenericScope implements Scope, BeanFactoryPostProcessor,
|
||||
return invocation.proceed();
|
||||
}
|
||||
Object proxy = getObject();
|
||||
ReadWriteLock readWriteLock = locks.get(this.targetBeanName);
|
||||
ReadWriteLock readWriteLock = scope.getLock(this.targetBeanName);
|
||||
if (readWriteLock == null) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("For bean with name [" + this.targetBeanName + "] there is no read write lock. Will create a new one to avoid NPE");
|
||||
logger.debug("For bean with name [" + this.targetBeanName
|
||||
+ "] there is no read write lock. Will create a new one to avoid NPE");
|
||||
}
|
||||
readWriteLock = new ReentrantReadWriteLock();
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ package org.springframework.cloud.context.scope;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* A special purpose cache interface specifically for the {@link GenericScope} to use to manage cached bean instances.
|
||||
* A special-purpose cache interface specifically for the {@link GenericScope} to use to manage cached bean instances.
|
||||
* Implementations generally fall into two categories: those that store values "globally" (i.e. one instance per key),
|
||||
* and those that store potentially multiple instances per key based on context (e.g. via a thread local). All
|
||||
* implementations should be thread safe.
|
||||
@@ -30,25 +30,25 @@ import java.util.Collection;
|
||||
public interface ScopeCache {
|
||||
|
||||
/**
|
||||
* Remove the object with this name from the cache.
|
||||
* Removes the object with this name from the cache.
|
||||
*
|
||||
* @param name the object name
|
||||
* @return the object removed or null if there was none
|
||||
* @param name The object name.
|
||||
* @return The object removed, or null if there was none.
|
||||
*/
|
||||
Object remove(String name);
|
||||
|
||||
/**
|
||||
* Clear the cache and return all objects in an unmodifiable collection.
|
||||
* Clears the cache and returns all objects in an unmodifiable collection.
|
||||
*
|
||||
* @return all objects stored in the cache
|
||||
* @return All objects stored in the cache.
|
||||
*/
|
||||
Collection<Object> clear();
|
||||
|
||||
/**
|
||||
* Get the named object from the cache.
|
||||
* Gets the named object from the cache.
|
||||
*
|
||||
* @param name the name of the object
|
||||
* @return the object with that name or null if there is none
|
||||
* @param name The name of the object.
|
||||
* @return The object with that name, or null if there is none.
|
||||
*/
|
||||
Object get(String name);
|
||||
|
||||
@@ -56,9 +56,9 @@ public interface ScopeCache {
|
||||
* Put a value in the cache if the key is not already used. If one is already present with the name provided, it is
|
||||
* not replaced, but is returned to the caller.
|
||||
*
|
||||
* @param name the key
|
||||
* @param value the new candidate value
|
||||
* @return the value that is in the cache at the end of the operation
|
||||
* @param name The key.
|
||||
* @param value The new candidate value.
|
||||
* @return The value that is in the cache at the end of the operation.
|
||||
*/
|
||||
Object put(String name, Object value);
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.cloud.context.scope.GenericScope;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.jmx.export.annotation.ManagedOperation;
|
||||
import org.springframework.jmx.export.annotation.ManagedResource;
|
||||
@@ -46,20 +46,20 @@ import org.springframework.jmx.export.annotation.ManagedResource;
|
||||
* proxy for every bean in the scope, so there is a flag
|
||||
* {@link #setProxyTargetClass(boolean) proxyTargetClass} which controls the proxy
|
||||
* creation, defaulting to JDK dynamic proxies and therefore only exposing the interfaces
|
||||
* implemented by a bean. If callers need access to other methods then the flag needs to
|
||||
* be set (and CGLib present on the classpath). Because this scope automatically proxies
|
||||
* all its beans, there is no need to add <code><aop:auto-proxy/></code> to any bean
|
||||
* definitions.
|
||||
* implemented by a bean. If callers need access to other methods, then the flag needs to
|
||||
* be set (and CGLib must be present on the classpath). Because this scope automatically
|
||||
* proxies all its beans, there is no need to add <code><aop:auto-proxy/></code> to
|
||||
* any bean definitions.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* The scoped proxy approach adopted here has a side benefit that bean instances are
|
||||
* automatically {@link Serializable}, and can be sent across the wire as long as the
|
||||
* receiver has an identical application context on the other side. To ensure that the two
|
||||
* contexts agree that they are identical they have to have the same serialization id. One
|
||||
* will be generated automatically by default from the bean names, so two contexts with
|
||||
* the same bean names are by default able to exchange beans by name. If you need to
|
||||
* override the default id then provide an explicit {@link #setId(String) id} when the
|
||||
* contexts agree that they are identical, they have to have the same serialization ID.
|
||||
* One will be generated automatically by default from the bean names, so two contexts
|
||||
* with the same bean names are by default able to exchange beans by name. If you need to
|
||||
* override the default ID, then provide an explicit {@link #setId(String) id} when the
|
||||
* Scope is declared.
|
||||
* </p>
|
||||
*
|
||||
@@ -70,7 +70,7 @@ import org.springframework.jmx.export.annotation.ManagedResource;
|
||||
*/
|
||||
@ManagedResource
|
||||
public class RefreshScope extends GenericScope
|
||||
implements ApplicationContextAware, Ordered {
|
||||
implements ApplicationContextAware, ApplicationListener<ContextRefreshedEvent>, Ordered {
|
||||
|
||||
private ApplicationContext context;
|
||||
private BeanDefinitionRegistry registry;
|
||||
@@ -78,7 +78,7 @@ public class RefreshScope extends GenericScope
|
||||
private int order = Ordered.LOWEST_PRECEDENCE - 100;
|
||||
|
||||
/**
|
||||
* Create a scope instance and give it the default name: "refresh".
|
||||
* Creates a scope instance and gives it the default name: "refresh".
|
||||
*/
|
||||
public RefreshScope() {
|
||||
super.setName("refresh");
|
||||
@@ -97,7 +97,7 @@ public class RefreshScope extends GenericScope
|
||||
* Flag to determine whether all beans in refresh scope should be instantiated eagerly
|
||||
* on startup. Default true.
|
||||
*
|
||||
* @param eager the flag to set
|
||||
* @param eager The flag to set.
|
||||
*/
|
||||
public void setEager(boolean eager) {
|
||||
this.eager = eager;
|
||||
@@ -110,7 +110,11 @@ public class RefreshScope extends GenericScope
|
||||
super.postProcessBeanDefinitionRegistry(registry);
|
||||
}
|
||||
|
||||
@EventListener
|
||||
@Override
|
||||
public void onApplicationEvent(ContextRefreshedEvent event) {
|
||||
start(event);
|
||||
}
|
||||
|
||||
public void start(ContextRefreshedEvent event) {
|
||||
if (event.getApplicationContext() == this.context && this.eager
|
||||
&& this.registry != null) {
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.springframework.cloud.context.scope.GenericScope;
|
||||
public class ThreadScope extends GenericScope {
|
||||
|
||||
/**
|
||||
* Create a scope instance and give it the default name: "thread".
|
||||
* Creates a scope instance and gives it the default name: "thread".
|
||||
*/
|
||||
public ThreadScope() {
|
||||
super();
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.springframework.cloud.endpoint.RefreshEndpoint;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
|
||||
/**
|
||||
* Event that triggers a call to {@link RefreshEndpoint#refresh()}
|
||||
* Event that triggers a call to {@link RefreshEndpoint#refresh()}.
|
||||
* @author Spencer Gibb
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
|
||||
@@ -8,14 +8,15 @@ import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||
import org.springframework.cloud.context.refresh.ContextRefresher;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
import org.springframework.context.event.SmartApplicationListener;
|
||||
|
||||
/**
|
||||
* Calls {@link RefreshEventListener#refresh} when a {@link RefreshEvent} is received.
|
||||
* Only responds to {@link RefreshEvent} after receiving an {@link ApplicationReadyEvent} as the RefreshEvent's might come to early in the application lifecycle.
|
||||
* Only responds to {@link RefreshEvent} after receiving an {@link ApplicationReadyEvent}, as the RefreshEvents might come too early in the application lifecycle.
|
||||
* @author Spencer Gibb
|
||||
*/
|
||||
public class RefreshEventListener {
|
||||
public class RefreshEventListener implements SmartApplicationListener {
|
||||
private static Log log = LogFactory.getLog(RefreshEventListener.class);
|
||||
private ContextRefresher refresh;
|
||||
private AtomicBoolean ready = new AtomicBoolean(false);
|
||||
@@ -24,12 +25,25 @@ public class RefreshEventListener {
|
||||
this.refresh = refresh;
|
||||
}
|
||||
|
||||
@EventListener
|
||||
@Override
|
||||
public boolean supportsEventType(Class<? extends ApplicationEvent> eventType) {
|
||||
return ApplicationReadyEvent.class.isAssignableFrom(eventType)
|
||||
|| RefreshEvent.class.isAssignableFrom(eventType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(ApplicationEvent event) {
|
||||
if (event instanceof ApplicationReadyEvent) {
|
||||
handle((ApplicationReadyEvent) event);
|
||||
} else if (event instanceof RefreshEvent) {
|
||||
handle((RefreshEvent) event);
|
||||
}
|
||||
}
|
||||
|
||||
public void handle(ApplicationReadyEvent event) {
|
||||
this.ready.compareAndSet(false, true);
|
||||
}
|
||||
|
||||
@EventListener
|
||||
public void handle(RefreshEvent event) {
|
||||
if (this.ready.get()) { // don't handle events before app is ready
|
||||
log.debug("Event received " + event.getEventDesc());
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.springframework.cloud.context.scope.refresh.RefreshScope;
|
||||
|
||||
/**
|
||||
* Health indicator for the refresh scope and configuration properties rebinding. If an
|
||||
* environment change causes a bean to fail in instantiate or bind this indicator will
|
||||
* environment change causes a bean to fail in instantiate or bind, this indicator will
|
||||
* generally say what the problem was and switch to DOWN.
|
||||
*
|
||||
* @author Dave Syer
|
||||
@@ -45,19 +45,22 @@ public class RefreshScopeHealthIndicator extends AbstractHealthIndicator {
|
||||
|
||||
@Override
|
||||
protected void doHealthCheck(Builder builder) throws Exception {
|
||||
Map<String, Exception> errors = new HashMap<>(this.scope.getIfAvailable().getErrors());
|
||||
errors.putAll(this.rebinder.getErrors());
|
||||
if (errors.isEmpty()) {
|
||||
builder.up();
|
||||
}
|
||||
else {
|
||||
builder.down();
|
||||
if (errors.size() == 1) {
|
||||
builder.withException(errors.values().iterator().next());
|
||||
RefreshScope refreshScope = this.scope.getIfAvailable();
|
||||
if (refreshScope != null) {
|
||||
Map<String, Exception> errors = new HashMap<>(refreshScope.getErrors());
|
||||
errors.putAll(this.rebinder.getErrors());
|
||||
if (errors.isEmpty()) {
|
||||
builder.up();
|
||||
}
|
||||
else {
|
||||
for (String name : errors.keySet()) {
|
||||
builder.withDetail(name, errors.get(name));
|
||||
builder.down();
|
||||
if (errors.size() == 1) {
|
||||
builder.withException(errors.values().iterator().next());
|
||||
}
|
||||
else {
|
||||
for (String name : errors.keySet()) {
|
||||
builder.withDetail(name, errors.get(name));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.cloud.util;
|
||||
|
||||
import org.springframework.aop.framework.Advised;
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
|
||||
/**
|
||||
* @author Ryan Baxter
|
||||
*/
|
||||
public class ProxyUtils {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> T getTargetObject(Object candidate) {
|
||||
try {
|
||||
if (AopUtils.isAopProxy(candidate) && (candidate instanceof Advised)) {
|
||||
return (T) ((Advised) candidate).getTargetSource().getTarget();
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
throw new IllegalStateException("Failed to unwrap proxied object", ex);
|
||||
}
|
||||
return (T) candidate;
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,7 @@ public class LifecycleMvcAutoConfigurationTests {
|
||||
|
||||
@Test
|
||||
public void environmentWebEndpointExtensionEnabled() {
|
||||
beanCreated("environmentWebEndpointExtension",
|
||||
beanCreated("environmentEndpointWebExtension",
|
||||
"management.endpoint.env.enabled=true");
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ public class RefreshAutoConfigurationTests {
|
||||
|
||||
@Configuration
|
||||
@EnableAutoConfiguration(exclude = DataSourceAutoConfiguration.class)
|
||||
@EnableConfigurationProperties(ConfigProps.class)
|
||||
@EnableConfigurationProperties
|
||||
static class Config {
|
||||
|
||||
}
|
||||
|
||||
@@ -24,23 +24,26 @@ import javax.servlet.ServletException;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties;
|
||||
import org.springframework.boot.actuate.env.EnvironmentEndpoint;
|
||||
import org.springframework.boot.actuate.env.EnvironmentEndpointWebExtension;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.cloud.context.environment.EnvironmentManagerIntegrationTests.TestConfiguration;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.fail;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||
@@ -64,6 +67,9 @@ public class EnvironmentManagerIntegrationTests {
|
||||
@Autowired
|
||||
private MockMvc mvc;
|
||||
|
||||
@Autowired
|
||||
private ApplicationContext context;
|
||||
|
||||
@Test
|
||||
public void testRefresh() throws Exception {
|
||||
assertEquals("Hello scope!", properties.getMessage());
|
||||
@@ -108,6 +114,21 @@ public class EnvironmentManagerIntegrationTests {
|
||||
.andExpect(status().isNotFound());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void environmentBeansConfiguredCorrectly() {
|
||||
Map<String, EnvironmentEndpoint> envbeans = this.context.getBeansOfType(EnvironmentEndpoint.class);
|
||||
assertThat(envbeans).hasSize(1)
|
||||
.containsKey("environmentEndpoint");
|
||||
assertThat(envbeans.get("environmentEndpoint"))
|
||||
.isInstanceOf(WritableEnvironmentEndpoint.class);
|
||||
|
||||
Map<String, EnvironmentEndpointWebExtension> extbeans = this.context.getBeansOfType(EnvironmentEndpointWebExtension.class);
|
||||
assertThat(extbeans).hasSize(1)
|
||||
.containsKey("environmentEndpointWebExtension");
|
||||
assertThat(extbeans.get("environmentEndpointWebExtension"))
|
||||
.isInstanceOf(WritableEnvironmentEndpointWebExtension.class);
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableAutoConfiguration
|
||||
protected static class TestConfiguration {
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ContextRefresherTests {
|
||||
@Test
|
||||
public void orderNewPropertiesConsistentWithNewContext() {
|
||||
try (ConfigurableApplicationContext context = SpringApplication.run(Empty.class,
|
||||
"--spring.main.webEnvironment=false", "--debug=false",
|
||||
"--spring.main.web-application-type=none", "--debug=false",
|
||||
"--spring.main.bannerMode=OFF")) {
|
||||
context.getEnvironment().setActiveProfiles("refresh");
|
||||
List<String> names = names(context.getEnvironment().getPropertySources());
|
||||
@@ -61,7 +61,7 @@ public class ContextRefresherTests {
|
||||
// Use spring.cloud.bootstrap.name to switch off the defaults (which would pick up
|
||||
// a bootstrapProperties immediately
|
||||
try (ConfigurableApplicationContext context = SpringApplication.run(Empty.class,
|
||||
"--spring.main.webEnvironment=false", "--debug=false",
|
||||
"--spring.main.web-application-type=none", "--debug=false",
|
||||
"--spring.main.bannerMode=OFF",
|
||||
"--spring.cloud.bootstrap.name=refresh")) {
|
||||
List<String> names = names(context.getEnvironment().getPropertySources());
|
||||
@@ -82,7 +82,7 @@ public class ContextRefresherTests {
|
||||
// Use spring.cloud.bootstrap.name to switch off the defaults (which would pick up
|
||||
// a bootstrapProperties immediately
|
||||
try (ConfigurableApplicationContext context = SpringApplication.run(
|
||||
ContextRefresherTests.class, "--spring.main.webEnvironment=false",
|
||||
ContextRefresherTests.class, "--spring.main.web-application-type=none",
|
||||
"--debug=false", "--spring.main.bannerMode=OFF",
|
||||
"--spring.cloud.bootstrap.name=refresh")) {
|
||||
ContextRefresher refresher = new ContextRefresher(context, scope);
|
||||
@@ -107,7 +107,7 @@ public class ContextRefresherTests {
|
||||
.get(getClass().getClassLoader());
|
||||
assertThat(system.getCount()).isEqualTo(0);
|
||||
try (ConfigurableApplicationContext context = SpringApplication.run(Empty.class,
|
||||
"--spring.main.webEnvironment=false", "--debug=false",
|
||||
"--spring.main.web-application-type=none", "--debug=false",
|
||||
"--spring.main.bannerMode=OFF",
|
||||
"--spring.cloud.bootstrap.name=refresh")) {
|
||||
assertThat(system.getCount()).isEqualTo(4);
|
||||
@@ -123,7 +123,7 @@ public class ContextRefresherTests {
|
||||
TestBootstrapConfiguration.fooSightings = new ArrayList<>();
|
||||
|
||||
try (ConfigurableApplicationContext context = SpringApplication.run(ContextRefresherTests.class,
|
||||
"--spring.main.webEnvironment=false", "--debug=false",
|
||||
"--spring.main.web-application-type=none", "--debug=false",
|
||||
"--spring.main.bannerMode=OFF",
|
||||
"--spring.cloud.bootstrap.name=refresh",
|
||||
"--test.bootstrap.foo=bar")) {
|
||||
|
||||
@@ -16,10 +16,6 @@
|
||||
|
||||
package org.springframework.cloud.endpoint;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@@ -29,6 +25,7 @@ import java.util.Map;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.Banner.Mode;
|
||||
import org.springframework.boot.WebApplicationType;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
@@ -42,7 +39,7 @@ import org.springframework.cloud.context.scope.refresh.RefreshScopeRefreshedEven
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.context.event.SmartApplicationListener;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.core.env.MapPropertySource;
|
||||
import org.springframework.core.env.PropertySource;
|
||||
@@ -50,6 +47,10 @@ import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
* @author Venil Noronha
|
||||
@@ -147,16 +148,17 @@ public class RefreshEndpointTests {
|
||||
|
||||
@Test
|
||||
public void shutdownHooksCleaned() {
|
||||
ConfigurableApplicationContext context = new SpringApplicationBuilder(Empty.class)
|
||||
.web(WebApplicationType.NONE).bannerMode(Mode.OFF).run();
|
||||
RefreshScope scope = new RefreshScope();
|
||||
scope.setApplicationContext(context);
|
||||
ContextRefresher contextRefresher = new ContextRefresher(context, scope);
|
||||
RefreshEndpoint endpoint = new RefreshEndpoint(contextRefresher);
|
||||
int count = countShutdownHooks();
|
||||
endpoint.refresh();
|
||||
int after = countShutdownHooks();
|
||||
assertEquals("Shutdown hooks not cleaned on refresh", count, after);
|
||||
try (ConfigurableApplicationContext context = new SpringApplicationBuilder(Empty.class)
|
||||
.web(WebApplicationType.NONE).bannerMode(Mode.OFF).run()) {
|
||||
RefreshScope scope = new RefreshScope();
|
||||
scope.setApplicationContext(context);
|
||||
ContextRefresher contextRefresher = new ContextRefresher(context, scope);
|
||||
RefreshEndpoint endpoint = new RefreshEndpoint(contextRefresher);
|
||||
int count = countShutdownHooks();
|
||||
endpoint.refresh();
|
||||
int after = countShutdownHooks();
|
||||
assertEquals("Shutdown hooks not cleaned on refresh", count, after);
|
||||
}
|
||||
}
|
||||
|
||||
private int countShutdownHooks() {
|
||||
@@ -170,17 +172,22 @@ public class RefreshEndpointTests {
|
||||
}
|
||||
|
||||
@Configuration
|
||||
protected static class Empty {
|
||||
protected static class Empty implements SmartApplicationListener {
|
||||
private List<ApplicationEvent> events = new ArrayList<ApplicationEvent>();
|
||||
|
||||
@EventListener(EnvironmentChangeEvent.class)
|
||||
public void changed(EnvironmentChangeEvent event) {
|
||||
this.events.add(event);
|
||||
|
||||
@Override
|
||||
public boolean supportsEventType(Class<? extends ApplicationEvent> eventType) {
|
||||
return EnvironmentChangeEvent.class.isAssignableFrom(eventType)
|
||||
|| RefreshScopeRefreshedEvent.class.isAssignableFrom(eventType);
|
||||
}
|
||||
|
||||
@EventListener(RefreshScopeRefreshedEvent.class)
|
||||
public void refreshed(RefreshScopeRefreshedEvent event) {
|
||||
this.events.add(event);
|
||||
@Override
|
||||
public void onApplicationEvent(ApplicationEvent event) {
|
||||
if (event instanceof EnvironmentChangeEvent ||
|
||||
event instanceof RefreshScopeRefreshedEvent) {
|
||||
this.events.add(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,4 +81,11 @@ public class RefreshScopeHealthIndicatorTests {
|
||||
assertEquals(Status.DOWN, this.indicator.health().getStatus());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nullRefreshScope() {
|
||||
ObjectProvider<RefreshScope> scopeProvider = mock(ObjectProvider.class);
|
||||
BDDMockito.willReturn(null).given(scopeProvider).getIfAvailable();
|
||||
assertEquals(Status.UP, this.indicator.health().getStatus());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-commons-parent</artifactId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>spring-cloud-starter</artifactId>
|
||||
<name>spring-cloud-starter</name>
|
||||
@@ -15,9 +15,6 @@
|
||||
<name>Pivotal Software, Inc.</name>
|
||||
<url>https://www.spring.io</url>
|
||||
</organization>
|
||||
<properties>
|
||||
<main.basedir>${basedir}/../..</main.basedir>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-commons-parent</artifactId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>spring-cloud-test-support</artifactId>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -28,6 +28,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.jar.Attributes;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
|
||||
@@ -66,6 +67,9 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
public class ModifiedClassPathRunner extends BlockJUnit4ClassRunner {
|
||||
|
||||
private static final Pattern INTELLIJ_CLASSPATH_JAR_PATTERN = Pattern
|
||||
.compile(".*classpath(\\d+)?\\.jar");
|
||||
|
||||
public ModifiedClassPathRunner(Class<?> testClass) throws InitializationError {
|
||||
super(testClass);
|
||||
}
|
||||
@@ -98,14 +102,14 @@ public class ModifiedClassPathRunner extends BlockJUnit4ClassRunner {
|
||||
private URL[] extractUrls(ClassLoader classLoader) throws Exception {
|
||||
List<URL> extractedUrls = new ArrayList<>();
|
||||
doExtractUrls(classLoader).forEach((URL url) -> {
|
||||
if (isSurefireBooterJar(url)) {
|
||||
if (isManifestOnlyJar(url)) {
|
||||
extractedUrls.addAll(extractUrlsFromManifestClassPath(url));
|
||||
}
|
||||
else {
|
||||
extractedUrls.add(url);
|
||||
}
|
||||
});
|
||||
return extractedUrls.toArray(new URL[extractedUrls.size()]);
|
||||
return extractedUrls.toArray(new URL[0]);
|
||||
}
|
||||
|
||||
private Stream<URL> doExtractUrls(ClassLoader classLoader) throws Exception {
|
||||
@@ -125,10 +129,29 @@ public class ModifiedClassPathRunner extends BlockJUnit4ClassRunner {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isManifestOnlyJar(URL url) {
|
||||
return isSurefireBooterJar(url) || isShortenedIntelliJJar(url);
|
||||
}
|
||||
|
||||
private boolean isSurefireBooterJar(URL url) {
|
||||
return url.getPath().contains("surefirebooter");
|
||||
}
|
||||
|
||||
private boolean isShortenedIntelliJJar(URL url) {
|
||||
String urlPath = url.getPath();
|
||||
boolean isCandidate = INTELLIJ_CLASSPATH_JAR_PATTERN.matcher(urlPath).matches();
|
||||
if (isCandidate) {
|
||||
try {
|
||||
Attributes attributes = getManifestMainAttributesFromUrl(url);
|
||||
String createdBy = attributes.getValue("Created-By");
|
||||
return createdBy != null && createdBy.contains("IntelliJ");
|
||||
}
|
||||
catch (Exception ex) {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private List<URL> extractUrlsFromManifestClassPath(URL booterJar) {
|
||||
List<URL> urls = new ArrayList<>();
|
||||
try {
|
||||
@@ -143,9 +166,14 @@ public class ModifiedClassPathRunner extends BlockJUnit4ClassRunner {
|
||||
}
|
||||
|
||||
private String[] getClassPath(URL booterJar) throws Exception {
|
||||
try (JarFile jarFile = new JarFile(new File(booterJar.toURI()))) {
|
||||
return StringUtils.delimitedListToStringArray(jarFile.getManifest()
|
||||
.getMainAttributes().getValue(Attributes.Name.CLASS_PATH), " ");
|
||||
Attributes attributes = getManifestMainAttributesFromUrl(booterJar);
|
||||
return StringUtils.delimitedListToStringArray(
|
||||
attributes.getValue(Attributes.Name.CLASS_PATH), " ");
|
||||
}
|
||||
|
||||
private Attributes getManifestMainAttributesFromUrl(URL url) throws Exception {
|
||||
try (JarFile jarFile = new JarFile(new File(url.toURI()))) {
|
||||
return jarFile.getManifest().getMainAttributes();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,7 +186,7 @@ public class ModifiedClassPathRunner extends BlockJUnit4ClassRunner {
|
||||
processedUrls.add(url);
|
||||
}
|
||||
}
|
||||
return processedUrls.toArray(new URL[processedUrls.size()]);
|
||||
return processedUrls.toArray(new URL[0]);
|
||||
}
|
||||
|
||||
private List<URL> getAdditionalUrls(Class<?> testClass) throws Exception {
|
||||
@@ -185,7 +213,7 @@ public class ModifiedClassPathRunner extends BlockJUnit4ClassRunner {
|
||||
repositorySystem.newLocalRepositoryManager(session, localRepository));
|
||||
CollectRequest collectRequest = new CollectRequest(null,
|
||||
Arrays.asList(new RemoteRepository.Builder("central", "default",
|
||||
"http://central.maven.org/maven2").build()));
|
||||
"https://repo.maven.apache.org/maven2").build()));
|
||||
|
||||
collectRequest.setDependencies(createDependencies(coordinates));
|
||||
DependencyRequest dependencyRequest = new DependencyRequest(collectRequest, null);
|
||||
@@ -317,7 +345,7 @@ public class ModifiedClassPathRunner extends BlockJUnit4ClassRunner {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object invokeExplosively(final Object target, final Object... params)
|
||||
public Object invokeExplosively(Object target, Object... params)
|
||||
throws Throwable {
|
||||
return doWithModifiedClassPathThreadContextClassLoader(
|
||||
() -> ModifiedClassPathFrameworkMethod.super.invokeExplosively(
|
||||
@@ -351,4 +379,4 @@ public class ModifiedClassPathRunner extends BlockJUnit4ClassRunner {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user