mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-05 00:56:58 +08:00
Merge branch 'zero-restructure'
* zero-restructure: Package restructure Further maven module restructure Polish and fix sonar warnings Minor pom tweaks Add structure 101 project Remove servet/filter class tangle Restructure autoconfigure project Remove tangles from core + minor polish Restructure packages Minor change to code formatting Move @AssertMissingBean to tests Polish Javadoc Restructure 'bootstrap' to use 'zero' Source formatting and clean-up Restructure projects layout
This commit is contained in:
commit
dcd120c477
2
.gitignore
vendored
2
.gitignore
vendored
@ -12,4 +12,4 @@ build
|
||||
target
|
||||
.springBeans
|
||||
dependency-reduced-pom.xml
|
||||
|
||||
build.log
|
||||
|
@ -1,5 +0,0 @@
|
||||
language: java
|
||||
|
||||
install: mvn -U install --quiet -DskipTests=true
|
||||
script: mvn clean test
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<profiles version="12">
|
||||
<profile kind="CodeFormatterProfile" name="Spring Bootstrap" version="12">
|
||||
<profile kind="CodeFormatterProfile" name="Spring Zero" version="12">
|
||||
<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.disabling_tag" value="@formatter:off"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
|
||||
|
@ -193,11 +193,11 @@ 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_at_end_of_file_if_missing=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=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=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=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
|
||||
|
390
pom.xml
390
pom.xml
@ -2,16 +2,18 @@
|
||||
<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.bootstrap</groupId>
|
||||
<artifactId>spring-bootstrap-parent</artifactId>
|
||||
<groupId>org.springframework.zero</groupId>
|
||||
<artifactId>spring-zero</artifactId>
|
||||
<version>0.5.0.BUILD-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<prerequisites>
|
||||
<maven>3.0.0</maven>
|
||||
</prerequisites>
|
||||
<properties>
|
||||
<main.basedir>${basedir}</main.basedir>
|
||||
<java.version>1.6</java.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.version>3.0.5</maven.version>
|
||||
<spring.version>4.0.0.BUILD-SNAPSHOT</spring.version>
|
||||
<spring.security.version>3.1.3.RELEASE</spring.security.version>
|
||||
<spring.security.javaconfig.version>1.0.0.CI-SNAPSHOT</spring.security.javaconfig.version>
|
||||
@ -21,47 +23,28 @@
|
||||
<jetty.version>8.1.9.v20130131</jetty.version>
|
||||
<aspectj.version>1.7.2</aspectj.version>
|
||||
</properties>
|
||||
|
||||
<scm>
|
||||
<url>http://github.com/SpringSource/spring-bootstrap</url>
|
||||
<connection>scm:git:git://github.com/SpringSource/spring-bootstrap.git</connection>
|
||||
<developerConnection>scm:git:ssh://git@github.com/SpringSource/spring-bootstrap.git</developerConnection>
|
||||
</scm>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<id>dsyer</id>
|
||||
<name>Dave Syer</name>
|
||||
<email>dsyer@gopivotal.com</email>
|
||||
</developer>
|
||||
<developer>
|
||||
<id>phillweb</id>
|
||||
<name>Phillip Webb</name>
|
||||
<email>pweb@gopivotal.com</email>
|
||||
<id>spring</id>
|
||||
<name>SpringSource</name>
|
||||
<url>http://www.springsource.org</url>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<distributionManagement>
|
||||
<!-- see 'staging' profile for dry-run deployment settings -->
|
||||
<downloadUrl>http://www.springsource.com/download/community
|
||||
</downloadUrl>
|
||||
<site>
|
||||
<id>spring-docs</id>
|
||||
<url>scp://static.springframework.org/var/www/domains/springframework.org/static/htdocs/spring-bootstrap/docs/${project.version}
|
||||
</url>
|
||||
</site>
|
||||
<repository>
|
||||
<id>spring-repo-release</id>
|
||||
<name>Spring Release Repository</name>
|
||||
<url>http://repo.springsource.org/libs-release-local</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>spring-repo-snapshot</id>
|
||||
<name>Spring Snapshot Repository</name>
|
||||
<url>http://repo.springsource.org/libs-snapshot-local</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
|
||||
<modules>
|
||||
<module>spring-bootstrap</module>
|
||||
<module>spring-autoconfigure</module>
|
||||
<module>spring-starters</module>
|
||||
<module>spring-actuator</module>
|
||||
<module>spring-launcher</module>
|
||||
<module>spring-package-maven-plugin</module>
|
||||
<module>spring-cli</module>
|
||||
<module>spring-zero-intergration-tests</module>
|
||||
</modules>
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
@ -82,7 +65,6 @@
|
||||
<version>2.7</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
</plugin>
|
||||
@ -106,6 +88,10 @@
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.9</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>3.2</version>
|
||||
@ -118,10 +104,6 @@
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>2.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.13</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.2</version>
|
||||
@ -131,17 +113,28 @@
|
||||
<version>2.2.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.9</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-exec-plugin</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.13</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>2.3</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.2.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>sonar-maven-plugin</artifactId>
|
||||
<version>2.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>versions-maven-plugin</artifactId>
|
||||
<version>2.0</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
@ -160,11 +153,11 @@
|
||||
<additionalConfig>
|
||||
<file>
|
||||
<name>.settings/org.eclipse.jdt.ui.prefs</name>
|
||||
<url>http://static.springsource.org/sts/jdtconfig/org.eclipse.jdt.ui.prefs</url>
|
||||
<location>${main.basedir}/eclipse/org.eclipse.jdt.ui.prefs</location>
|
||||
</file>
|
||||
<file>
|
||||
<name>.settings/org.eclipse.jdt.core.prefs</name>
|
||||
<url>http://static.springsource.org/sts/jdtconfig/org.eclipse.jdt.core.prefs</url>
|
||||
<location>${main.basedir}/eclipse/org.eclipse.jdt.core.prefs</location>
|
||||
</file>
|
||||
</additionalConfig>
|
||||
</configuration>
|
||||
@ -174,22 +167,17 @@
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<!-- is using JDK 8 <additionalparam>-Xdoclint:none -quiet</additionalparam> -->
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>jar-no-fork</goal>
|
||||
</goals>
|
||||
@ -206,16 +194,11 @@
|
||||
<excludes>
|
||||
<exclude>**/Abstract*.java</exclude>
|
||||
</excludes>
|
||||
<junitArtifactName>junit:junit</junitArtifactName>
|
||||
<systemPropertyVariables>
|
||||
<java.security.egd>file:/dev/./urandom</java.security.egd>
|
||||
</systemPropertyVariables>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>versions-maven-plugin</artifactId>
|
||||
<version>2.0</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
@ -224,7 +207,7 @@
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>1.0.7</version>
|
||||
<version>1.0.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
@ -286,6 +269,46 @@
|
||||
<artifactId>ivy</artifactId>
|
||||
<version>2.3.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-archiver</artifactId>
|
||||
<version>2.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-artifact</artifactId>
|
||||
<version>${maven.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-core</artifactId>
|
||||
<version>${maven.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-model</artifactId>
|
||||
<version>${maven.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>${maven.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-settings</artifactId>
|
||||
<version>${maven.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>1.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-annotations</artifactId>
|
||||
<version>3.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat.embed</groupId>
|
||||
<artifactId>tomcat-embed-core</artifactId>
|
||||
@ -326,6 +349,16 @@
|
||||
<artifactId>groovy-templates</artifactId>
|
||||
<version>2.1.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-archiver</artifactId>
|
||||
<version>2.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>3.0.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-webapp</artifactId>
|
||||
@ -352,16 +385,16 @@
|
||||
<artifactId>jetty-annotations</artifactId>
|
||||
<version>${jetty.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>1.3.171</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hamcrest</groupId>
|
||||
<artifactId>hamcrest-library</artifactId>
|
||||
<version>1.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>1.3.171</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-entitymanager</artifactId>
|
||||
@ -387,40 +420,30 @@
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>1.9.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ow2.asm</groupId>
|
||||
<artifactId>asm</artifactId>
|
||||
<version>4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jcl-over-slf4j</artifactId>
|
||||
<version>1.7.2</version>
|
||||
<version>1.7.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>1.7.2</version>
|
||||
<version>1.7.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>1.7.2</version>
|
||||
<version>1.7.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-jdk14</artifactId>
|
||||
<version>1.7.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-javaconfig</artifactId>
|
||||
<version>${spring.security.javaconfig.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-web</artifactId>
|
||||
<version>${spring.security.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-core</artifactId>
|
||||
<version>${spring.security.version}</version>
|
||||
<version>1.7.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
@ -432,11 +455,6 @@
|
||||
<artifactId>spring-beans</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-expression</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
@ -460,17 +478,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jms</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webmvc</artifactId>
|
||||
<artifactId>spring-expression</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -478,6 +486,11 @@
|
||||
<artifactId>spring-jdbc</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jms</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-orm</artifactId>
|
||||
@ -504,16 +517,21 @@
|
||||
<artifactId>spring-tx</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webmvc</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.batch</groupId>
|
||||
<artifactId>spring-batch-core</artifactId>
|
||||
<version>${spring.batch.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.integration</groupId>
|
||||
<artifactId>spring-integration-core</artifactId>
|
||||
<version>${spring.integration.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-jpa</artifactId>
|
||||
@ -530,9 +548,49 @@
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.hateoas</groupId>
|
||||
<artifactId>spring-hateoas</artifactId>
|
||||
<version>0.5.0.RELEASE</version>
|
||||
<groupId>org.springframework.integration</groupId>
|
||||
<artifactId>spring-integration-core</artifactId>
|
||||
<version>${spring.integration.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.integration</groupId>
|
||||
<artifactId>spring-integration-file</artifactId>
|
||||
<version>${spring.integration.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.integration</groupId>
|
||||
<artifactId>spring-integration-http</artifactId>
|
||||
<version>${spring.integration.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.integration</groupId>
|
||||
<artifactId>spring-integration-ip</artifactId>
|
||||
<version>${spring.integration.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.integration</groupId>
|
||||
<artifactId>spring-integration-stream</artifactId>
|
||||
<version>${spring.integration.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-core</artifactId>
|
||||
<version>${spring.security.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-javaconfig</artifactId>
|
||||
<version>${spring.security.javaconfig.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-web</artifactId>
|
||||
<version>${spring.security.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.thymeleaf</groupId>
|
||||
<artifactId>thymeleaf</artifactId>
|
||||
<version>2.0.16</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.thymeleaf</groupId>
|
||||
@ -563,92 +621,27 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<distributionManagement>
|
||||
<downloadUrl>http://www.springsource.com/download/community</downloadUrl>
|
||||
<site>
|
||||
<id>spring-docs</id>
|
||||
<url>scp://static.springframework.org/var/www/domains/springframework.org/static/htdocs/spring-bootstrap/docs/${project.version}</url>
|
||||
</site>
|
||||
<repository>
|
||||
<id>spring-repo-release</id>
|
||||
<name>Spring Release Repository</name>
|
||||
<url>http://repo.springsource.org/libs-release-local</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>spring-repo-snapshot</id>
|
||||
<name>Spring Snapshot Repository</name>
|
||||
<url>http://repo.springsource.org/libs-snapshot-local</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>setup</id>
|
||||
<modules>
|
||||
<module>spring-bootstrap-launcher</module>
|
||||
<module>spring-bootstrap-maven-plugin</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>default</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<modules>
|
||||
<module>spring-bootstrap</module>
|
||||
<module>spring-bootstrap-actuator</module>
|
||||
<module>spring-bootstrap-cli</module>
|
||||
<module>spring-bootstrap-launcher</module>
|
||||
<module>spring-bootstrap-maven-plugin</module>
|
||||
<module>spring-bootstrap-samples</module>
|
||||
<module>spring-bootstrap-starters</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>staging</id>
|
||||
<distributionManagement>
|
||||
<site>
|
||||
<id>spring-site-staging</id>
|
||||
<url>file:///${java.io.tmpdir}/spring-bootstrap/docs</url>
|
||||
</site>
|
||||
<repository>
|
||||
<id>spring-milestone-staging</id>
|
||||
<url>file:///${java.io.tmpdir}/spring-bootstrap/milestone</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>spring-snapshot-staging</id>
|
||||
<url>file:///${java.io.tmpdir}/spring-bootstrap/snapshot</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>milestone</id>
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>spring-repo-milestone</id>
|
||||
<name>Spring Milestone Repository</name>
|
||||
<url>https://repo.springsource.org/libs-milestone-local</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>central</id>
|
||||
<distributionManagement>
|
||||
<snapshotRepository>
|
||||
<id>sonatype-nexus-snapshots</id>
|
||||
<name>Sonatype Nexus Snapshots</name>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
|
||||
</snapshotRepository>
|
||||
<repository>
|
||||
<id>sonatype-nexus-staging</id>
|
||||
<name>Nexus Release Repository</name>
|
||||
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>sign-artifacts</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>sign</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>bootstrap</id>
|
||||
<!-- deactivate when released -->
|
||||
<!-- FIXME remove before release -->
|
||||
<id>snapshot-repositories</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
@ -671,6 +664,21 @@
|
||||
</repository>
|
||||
</repositories>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>jdk8</id>
|
||||
<activation>
|
||||
<jdk>1.8</jdk>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<configuration>
|
||||
<additionalparam>-Xdoclint:none -quiet</additionalparam>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
</project>
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Spring Bootstrap Actuator
|
||||
# Spring Zero Actuator
|
||||
|
||||
Minimum fuss for getting applications up and running in production,
|
||||
and in other environments. There is a strong emphasis on implementing
|
||||
@ -23,8 +23,8 @@ RESTful web services but many features are more generic than that.
|
||||
|
||||
For a quick introduction and to get started quickly with a new
|
||||
project, carry on reading. For more in depth coverage of the features
|
||||
of Spring Bootstrap Actuator, go to the
|
||||
[Feature Guide](https://github.com/SpringSource/spring-bootstrap/tree/master/spring-bootstrap-actuator/docs/Features.md).
|
||||
of Spring Zero Actuator, go to the
|
||||
[Feature Guide](https://github.com/SpringSource/spring-bootstrap/tree/master/spring-zero-actuator/docs/Features.md).
|
||||
|
||||
# Getting Started
|
||||
|
||||
@ -47,18 +47,18 @@ If you are using Maven create a really simple `pom.xml` with 2 dependencies:
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
<parent>
|
||||
<groupId>org.springframework.bootstrap</groupId>
|
||||
<artifactId>spring-bootstrap-applications</artifactId>
|
||||
<groupId>org.springframework.zero</groupId>
|
||||
<artifactId>spring-zero-starter</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.bootstrap</groupId>
|
||||
<artifactId>spring-bootstrap-web-application</artifactId>
|
||||
<groupId>org.springframework.zero</groupId>
|
||||
<artifactId>spring-zero-web-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.bootstrap</groupId>
|
||||
<artifactId>spring-bootstrap-service</artifactId>
|
||||
<groupId>org.springframework.zero</groupId>
|
||||
<artifactId>spring-zero-service</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
@ -72,7 +72,7 @@ If you are using Maven create a really simple `pom.xml` with 2 dependencies:
|
||||
</project>
|
||||
|
||||
If you like Gradle, that's fine, and you will know what to do with
|
||||
those dependencies. The first dependency adds Spring Bootstrap auto
|
||||
those dependencies. The first dependency adds Spring Zero auto
|
||||
configuration and the Jetty container to your application, and the
|
||||
second one adds some more opinionated stuff like the default
|
||||
management endpoints. If you prefer Tomcat you can just add the
|
||||
@ -89,7 +89,7 @@ Then in another terminal
|
||||
ok
|
||||
$ curl localhost:8080/metrics
|
||||
{"counter.status.200.health":1.0,"gauge.response.health":10.0,"mem":120768.0,"mem.free":105012.0,"processors":4.0}
|
||||
|
||||
|
||||
`/health` is the default location for the health endpoint - it tells
|
||||
you if the application is running and healthy. `/metrics` is the default
|
||||
location for the metrics endpoint - it gives you basic counts and
|
||||
@ -121,14 +121,14 @@ endpoint. An endpoint can be implemented as a Spring MVC
|
||||
public Map<String, String> helloWorld() {
|
||||
return Collections.singletonMap("message", "Hello World");
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
SpringApplication.run(SampleController.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
You can launch that straight away using the Spring Bootstrap CLI
|
||||
You can launch that straight away using the Spring Zero CLI
|
||||
(without the `@EnableAutoConfiguration` and even without the import
|
||||
statements that your IDE will add if you are using one), or you can
|
||||
use the main method to launch it from your project jar. Just add a
|
||||
@ -155,7 +155,7 @@ which are more convenient at development time. Here are a few:
|
||||
1. Use the Maven exec plugin, e.g.
|
||||
|
||||
$ mvn exec:java
|
||||
|
||||
|
||||
2. Run directly in your IDE, e.g. Eclipse or IDEA let you right click
|
||||
on a class and run it.
|
||||
|
||||
@ -167,7 +167,7 @@ on a class and run it.
|
||||
|
||||
## Externalizing configuration
|
||||
|
||||
Spring Bootstrap likes you to externalize your configuration so you
|
||||
Spring Zero likes you to externalize your configuration so you
|
||||
can work with the same application code in different environments. To
|
||||
get started with this you create a file in the root of your classpath
|
||||
(`src/main/resources` if using Maven) - if you like YAML you can call
|
||||
@ -187,7 +187,7 @@ or if you like Java `Properties` files, you can call it
|
||||
management.port: 9001
|
||||
logging.file: target/log.out
|
||||
|
||||
Those examples are properties that Spring Bootstrap itself binds to
|
||||
Those examples are properties that Spring Zero itself binds to
|
||||
out of the box, so if you make that change and run the app again, you
|
||||
will find the home page on port 9000 instead of 8080:
|
||||
|
||||
@ -217,7 +217,7 @@ that is to simply refer to it in an `@Value` annotation, e.g.
|
||||
@Controller
|
||||
@EnableAutoConfiguration
|
||||
public class SampleController {
|
||||
|
||||
|
||||
@Value("${service.message:Hello World}")
|
||||
private String value = "Goodbye Everypone"
|
||||
|
||||
@ -226,7 +226,7 @@ that is to simply refer to it in an `@Value` annotation, e.g.
|
||||
public Map<String, String> helloWorld() {
|
||||
return Collections.singletonMap("message", message);
|
||||
}
|
||||
|
||||
|
||||
...
|
||||
}
|
||||
|
||||
@ -251,13 +251,13 @@ automatically in a separate value object. For instance:
|
||||
private int value = 0;
|
||||
... getters and setters
|
||||
}
|
||||
|
||||
|
||||
// SampleController.java
|
||||
@Controller
|
||||
@EnableAutoConfiguration
|
||||
@EnableConfigurationProperties(ServiceProperties.class)
|
||||
public class SampleController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private ServiceProperties properties;
|
||||
|
||||
@ -266,10 +266,10 @@ automatically in a separate value object. For instance:
|
||||
public Map<String, String> helloWorld() {
|
||||
return Collections.singletonMap("message", properties.getMessage());
|
||||
}
|
||||
|
||||
|
||||
...
|
||||
}
|
||||
|
||||
|
||||
When you ask to
|
||||
`@EnableConfigurationProperties(ServiceProperties.class)` you are
|
||||
saying you want a bean of type `ServiceProperties` and that you want
|
||||
@ -341,9 +341,9 @@ Then you will be able to inject a `DataSource` into your controller:
|
||||
@EnableAutoConfiguration
|
||||
@EnableConfigurationProperties(ServiceProperties.class)
|
||||
public class SampleController {
|
||||
|
||||
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
|
||||
@Autowired
|
||||
public SampleController(DataSource dataSource) {
|
||||
this.jdbcTemplate = new JdbcTemplate(dataSource);
|
||||
@ -354,19 +354,19 @@ Then you will be able to inject a `DataSource` into your controller:
|
||||
public Map<String, String> helloWorld() {
|
||||
return jdbcTemplate.queryForMap("SELECT * FROM MESSAGES WHERE ID=?", 0);
|
||||
}
|
||||
|
||||
|
||||
...
|
||||
}
|
||||
|
||||
|
||||
The app will run (going back to the default security configuration):
|
||||
|
||||
|
||||
$ curl user:password@localhost:8080/
|
||||
{"error":"Internal Server Error", "status":500, "exception":...}
|
||||
|
||||
|
||||
but there's no data in the database yet and the `MESSAGES` table
|
||||
doesn't even exist, so there's an error. One easy way to fix it is
|
||||
to provide a `schema.sql` script in the root of the classpath, e.g.
|
||||
|
||||
|
||||
create table MESSAGES (
|
||||
ID BIGINT NOT NULL PRIMARY KEY,
|
||||
MESSAGE VARCHAR(255)
|
||||
@ -377,6 +377,6 @@ Now when you run the app you get a sensible response:
|
||||
|
||||
$ curl user:password@localhost:8080/
|
||||
{"ID":0, "MESSAGE":"Hello Phil"}
|
||||
|
||||
|
||||
Obviously, this is only the start, but hopefully you have a good grasp
|
||||
of the basics and are ready to try it out yourself.
|
@ -1,7 +1,7 @@
|
||||
# Spring Bootstrap Actuator Feature Guide
|
||||
# Spring Actuator Feature Guide
|
||||
|
||||
Here are some (most, hopefully all) the features of Spring Bootstrap
|
||||
Actuator with some commentary to help you start using them. We
|
||||
Here are some (most, hopefully all) the features of Spring Actuator
|
||||
with some commentary to help you start using them. We
|
||||
recommend you first build a project with the Actuator (e.g. the
|
||||
getting started project from the main README), and then try each
|
||||
feature in turn there.
|
||||
@ -63,7 +63,7 @@ configuration and make it only available in certain environments. Any
|
||||
`@Component` that is marked with `@Profile` will only be loaded in the
|
||||
profile specified by the latter annotation.
|
||||
|
||||
Spring Bootstrap takes it a stage further. If you include in your
|
||||
Spring Bootstap takes it a stage further. If you include in your
|
||||
`application.properties` a value for a property named
|
||||
`spring.active.profiles` then those profiles will be active by
|
||||
default. E.g.
|
||||
@ -137,7 +137,7 @@ compiler or IDE.
|
||||
|
||||
YAML is a superset of JSON, and as such is a very convenient format
|
||||
for specifying hierarchical configuration data, such as that supported
|
||||
by Spring Bootstrap Actuator. If you prefer to use
|
||||
by Spring Actuator. If you prefer to use
|
||||
[YAML](http://yaml.org) instead of Properties files you just need to
|
||||
include a file called `application.yml` in the root of your classpath
|
||||
|
||||
@ -177,7 +177,6 @@ to change the default values imperatively in Java, so get more control
|
||||
over the process. You can do this by declaring a bean of the same
|
||||
type in your application context, e.g. for the server properties:
|
||||
|
||||
@AssertMissingBean(ServerProperties.class)
|
||||
@Bean
|
||||
public ServerProperties serverProperties() {
|
||||
ServerProperties server = new ServerProperties();
|
||||
@ -185,10 +184,6 @@ type in your application context, e.g. for the server properties:
|
||||
return server;
|
||||
}
|
||||
|
||||
Note the use of `@AssertMissingBean` to guard against any mistakes
|
||||
where the bean is already defined (and therefore might already have
|
||||
been bound).
|
||||
|
||||
## Server Configuration
|
||||
|
||||
The `ServerProperties` are bound to application properties, and
|
||||
@ -217,7 +212,7 @@ properties in the application properties (see
|
||||
* To enable the Tomcat access log valve (very common in production environments)
|
||||
|
||||
More fine-grained control of the Tomcat container is available if you
|
||||
need it. Instead of letting Spring Bootstrap create the container for
|
||||
need it. Instead of letting Spring Actuator create the container for
|
||||
you, just create a bean of type
|
||||
`TomcatEmbeddedServletContainerFactory` and override one of its
|
||||
methods, or inject some customizations, e.g.
|
||||
@ -261,7 +256,7 @@ this.
|
||||
|
||||
## Customizing Logging
|
||||
|
||||
Spring Bootstrap uses SLF4J for logging, but leaves the implementation
|
||||
Spring Actuator uses SLF4J for logging, but leaves the implementation
|
||||
open. The Starter projects and the Actuator use JDK native logging by
|
||||
default, purely because it is always available. A default
|
||||
configuration file is provided for JDK logging, and also for log4j and
|
||||
@ -290,12 +285,12 @@ from the Spring `Environment` to System properties:
|
||||
|PID |PID | The current process ID is discovered if possible and not already provided |
|
||||
|
||||
All the logging systems supported can consult System properties when
|
||||
parsing their configuration files. See the defailt configurations in
|
||||
parsing their configuration files. See the default configurations in
|
||||
`spring-bootstrap.jar` for examples.
|
||||
|
||||
## Application Context Initializers
|
||||
|
||||
To add additional application context initializers to the Bootstrap
|
||||
To add additional application context initializers to the bootstrap
|
||||
startup process, add a comma-delimited list of class names to the
|
||||
`Environment` property `context.initializer.classes` (can be specified
|
||||
via `application.properties`).
|
@ -3,21 +3,29 @@
|
||||
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>
|
||||
<parent>
|
||||
<groupId>org.springframework.bootstrap</groupId>
|
||||
<artifactId>spring-bootstrap-parent</artifactId>
|
||||
<groupId>org.springframework.zero</groupId>
|
||||
<artifactId>spring-zero</artifactId>
|
||||
<version>0.5.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>spring-bootstrap-actuator</artifactId>
|
||||
<artifactId>spring-actuator</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<properties>
|
||||
<main.basedir>${basedir}/..</main.basedir>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<!-- Compile -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.bootstrap</groupId>
|
||||
<artifactId>spring-bootstrap</artifactId>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>spring-autoconfigure</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webmvc</artifactId>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-validator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
@ -25,7 +33,13 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-expression</artifactId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
</dependency>
|
||||
<!-- Optional -->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
@ -33,17 +47,9 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-validator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webmvc</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
@ -60,6 +66,14 @@
|
||||
<artifactId>tomcat-embed-core</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- Test -->
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>spring-bootstrap</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat.embed</groupId>
|
||||
<artifactId>tomcat-embed-logging-juli</artifactId>
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.audit;
|
||||
package org.springframework.actuate.audit;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
@ -93,7 +93,8 @@ public class AuditEvent implements Serializable {
|
||||
if (entry.contains("=")) {
|
||||
int index = entry.indexOf("=");
|
||||
result.put(entry.substring(0, index), entry.substring(index + 1));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
result.put(entry, null);
|
||||
}
|
||||
}
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.audit;
|
||||
package org.springframework.actuate.audit;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.audit;
|
||||
package org.springframework.actuate.audit;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
@ -14,12 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.audit.listener;
|
||||
package org.springframework.actuate.audit.listener;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.bootstrap.actuate.audit.AuditEvent;
|
||||
import org.springframework.actuate.audit.AuditEvent;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
import org.springframework.util.Assert;
|
||||
|
@ -14,12 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.audit.listener;
|
||||
package org.springframework.actuate.audit.listener;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.bootstrap.actuate.audit.AuditEvent;
|
||||
import org.springframework.bootstrap.actuate.audit.AuditEventRepository;
|
||||
import org.springframework.actuate.audit.AuditEvent;
|
||||
import org.springframework.actuate.audit.AuditEventRepository;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
|
||||
/**
|
@ -14,18 +14,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.autoconfigure;
|
||||
package org.springframework.actuate.autoconfigure;
|
||||
|
||||
import org.springframework.actuate.audit.AuditEvent;
|
||||
import org.springframework.actuate.audit.AuditEventRepository;
|
||||
import org.springframework.actuate.audit.InMemoryAuditEventRepository;
|
||||
import org.springframework.actuate.audit.listener.AuditListener;
|
||||
import org.springframework.actuate.security.AuthenticationAuditListener;
|
||||
import org.springframework.actuate.security.AuthorizationAuditListener;
|
||||
import org.springframework.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.bootstrap.actuate.audit.AuditEvent;
|
||||
import org.springframework.bootstrap.actuate.audit.AuditEventRepository;
|
||||
import org.springframework.bootstrap.actuate.audit.InMemoryAuditEventRepository;
|
||||
import org.springframework.bootstrap.actuate.audit.listener.AuditListener;
|
||||
import org.springframework.bootstrap.actuate.security.AuthenticationAuditListener;
|
||||
import org.springframework.bootstrap.actuate.security.AuthorizationAuditListener;
|
||||
import org.springframework.bootstrap.context.annotation.ConditionalOnClass;
|
||||
import org.springframework.bootstrap.context.annotation.ConditionalOnMissingBean;
|
||||
import org.springframework.bootstrap.context.annotation.EnableAutoConfiguration;
|
||||
import org.springframework.bootstrap.context.condition.ConditionalOnClass;
|
||||
import org.springframework.bootstrap.context.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -13,34 +13,35 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.bootstrap.actuate.autoconfigure;
|
||||
|
||||
package org.springframework.actuate.autoconfigure;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.springframework.actuate.endpoint.BeansEndpoint;
|
||||
import org.springframework.actuate.endpoint.DumpEndpoint;
|
||||
import org.springframework.actuate.endpoint.Endpoint;
|
||||
import org.springframework.actuate.endpoint.EnvironmentEndpoint;
|
||||
import org.springframework.actuate.endpoint.HealthEndpoint;
|
||||
import org.springframework.actuate.endpoint.InfoEndpoint;
|
||||
import org.springframework.actuate.endpoint.MetricsEndpoint;
|
||||
import org.springframework.actuate.endpoint.PublicMetrics;
|
||||
import org.springframework.actuate.endpoint.ShutdownEndpoint;
|
||||
import org.springframework.actuate.endpoint.TraceEndpoint;
|
||||
import org.springframework.actuate.endpoint.VanillaPublicMetrics;
|
||||
import org.springframework.actuate.health.HealthIndicator;
|
||||
import org.springframework.actuate.health.VanillaHealthIndicator;
|
||||
import org.springframework.actuate.metrics.InMemoryMetricRepository;
|
||||
import org.springframework.actuate.metrics.MetricRepository;
|
||||
import org.springframework.actuate.trace.InMemoryTraceRepository;
|
||||
import org.springframework.actuate.trace.TraceRepository;
|
||||
import org.springframework.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.bootstrap.actuate.endpoint.BeansEndpoint;
|
||||
import org.springframework.bootstrap.actuate.endpoint.DumpEndpoint;
|
||||
import org.springframework.bootstrap.actuate.endpoint.Endpoint;
|
||||
import org.springframework.bootstrap.actuate.endpoint.EnvironmentEndpoint;
|
||||
import org.springframework.bootstrap.actuate.endpoint.HealthEndpoint;
|
||||
import org.springframework.bootstrap.actuate.endpoint.InfoEndpoint;
|
||||
import org.springframework.bootstrap.actuate.endpoint.MetricsEndpoint;
|
||||
import org.springframework.bootstrap.actuate.endpoint.PublicMetrics;
|
||||
import org.springframework.bootstrap.actuate.endpoint.ShutdownEndpoint;
|
||||
import org.springframework.bootstrap.actuate.endpoint.TraceEndpoint;
|
||||
import org.springframework.bootstrap.actuate.endpoint.VanillaPublicMetrics;
|
||||
import org.springframework.bootstrap.actuate.health.HealthIndicator;
|
||||
import org.springframework.bootstrap.actuate.health.VanillaHealthIndicator;
|
||||
import org.springframework.bootstrap.actuate.metrics.InMemoryMetricRepository;
|
||||
import org.springframework.bootstrap.actuate.metrics.MetricRepository;
|
||||
import org.springframework.bootstrap.actuate.trace.InMemoryTraceRepository;
|
||||
import org.springframework.bootstrap.actuate.trace.TraceRepository;
|
||||
import org.springframework.bootstrap.bind.PropertiesConfigurationFactory;
|
||||
import org.springframework.bootstrap.context.annotation.ConditionalOnMissingBean;
|
||||
import org.springframework.bootstrap.context.annotation.EnableAutoConfiguration;
|
||||
import org.springframework.bootstrap.context.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
@ -14,27 +14,27 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.autoconfigure;
|
||||
package org.springframework.actuate.autoconfigure;
|
||||
|
||||
import javax.servlet.Servlet;
|
||||
|
||||
import org.springframework.actuate.endpoint.Endpoint;
|
||||
import org.springframework.actuate.endpoint.mvc.EndpointHandlerAdapter;
|
||||
import org.springframework.actuate.endpoint.mvc.EndpointHandlerMapping;
|
||||
import org.springframework.actuate.properties.ManagementServerProperties;
|
||||
import org.springframework.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.autoconfigure.web.EmbeddedServletContainerAutoConfiguration;
|
||||
import org.springframework.autoconfigure.web.WebMvcAutoConfiguration;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.bootstrap.actuate.endpoint.Endpoint;
|
||||
import org.springframework.bootstrap.actuate.endpoint.mvc.EndpointHandlerAdapter;
|
||||
import org.springframework.bootstrap.actuate.endpoint.mvc.EndpointHandlerMapping;
|
||||
import org.springframework.bootstrap.actuate.properties.ManagementServerProperties;
|
||||
import org.springframework.bootstrap.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.bootstrap.autoconfigure.web.EmbeddedServletContainerAutoConfiguration;
|
||||
import org.springframework.bootstrap.autoconfigure.web.WebMvcAutoConfiguration;
|
||||
import org.springframework.bootstrap.context.annotation.AutoConfigureAfter;
|
||||
import org.springframework.bootstrap.context.annotation.ConditionalOnClass;
|
||||
import org.springframework.bootstrap.context.annotation.ConditionalOnMissingBean;
|
||||
import org.springframework.bootstrap.context.annotation.EnableAutoConfiguration;
|
||||
import org.springframework.bootstrap.context.condition.ConditionalOnClass;
|
||||
import org.springframework.bootstrap.context.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.bootstrap.context.embedded.AnnotationConfigEmbeddedWebApplicationContext;
|
||||
import org.springframework.bootstrap.properties.ServerProperties;
|
||||
import org.springframework.bootstrap.context.embedded.properties.ServerProperties;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
@ -67,9 +67,6 @@ public class EndpointWebMvcAutoConfiguration implements ApplicationContextAware,
|
||||
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
@Autowired(required = false)
|
||||
private ServerProperties serverProperties = new ServerProperties();
|
||||
|
||||
@Autowired(required = false)
|
||||
private ManagementServerProperties managementServerProperties = new ManagementServerProperties();
|
||||
|
||||
@ -140,7 +137,8 @@ public class EndpointWebMvcAutoConfiguration implements ApplicationContextAware,
|
||||
ServerProperties serverProperties;
|
||||
try {
|
||||
serverProperties = beanFactory.getBean(ServerProperties.class);
|
||||
} catch (NoSuchBeanDefinitionException ex) {
|
||||
}
|
||||
catch (NoSuchBeanDefinitionException ex) {
|
||||
serverProperties = new ServerProperties();
|
||||
}
|
||||
|
||||
@ -148,7 +146,8 @@ public class EndpointWebMvcAutoConfiguration implements ApplicationContextAware,
|
||||
try {
|
||||
managementServerProperties = beanFactory
|
||||
.getBean(ManagementServerProperties.class);
|
||||
} catch (NoSuchBeanDefinitionException ex) {
|
||||
}
|
||||
catch (NoSuchBeanDefinitionException ex) {
|
||||
managementServerProperties = new ManagementServerProperties();
|
||||
}
|
||||
|
@ -13,18 +13,19 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.bootstrap.actuate.autoconfigure;
|
||||
|
||||
package org.springframework.actuate.autoconfigure;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
|
||||
import org.springframework.actuate.endpoint.mvc.EndpointHandlerAdapter;
|
||||
import org.springframework.actuate.endpoint.mvc.EndpointHandlerMapping;
|
||||
import org.springframework.actuate.properties.ManagementServerProperties;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.HierarchicalBeanFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.bootstrap.actuate.endpoint.mvc.EndpointHandlerAdapter;
|
||||
import org.springframework.bootstrap.actuate.endpoint.mvc.EndpointHandlerMapping;
|
||||
import org.springframework.bootstrap.actuate.properties.ManagementServerProperties;
|
||||
import org.springframework.bootstrap.context.annotation.ConditionalOnBean;
|
||||
import org.springframework.bootstrap.context.annotation.ConditionalOnClass;
|
||||
import org.springframework.bootstrap.context.condition.ConditionalOnBean;
|
||||
import org.springframework.bootstrap.context.condition.ConditionalOnClass;
|
||||
import org.springframework.bootstrap.context.embedded.ConfigurableEmbeddedServletContainerFactory;
|
||||
import org.springframework.bootstrap.context.embedded.EmbeddedServletContainer;
|
||||
import org.springframework.bootstrap.context.embedded.EmbeddedServletContainerCustomizer;
|
@ -14,16 +14,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.autoconfigure;
|
||||
package org.springframework.actuate.autoconfigure;
|
||||
|
||||
import javax.servlet.Servlet;
|
||||
|
||||
import org.springframework.actuate.web.BasicErrorController;
|
||||
import org.springframework.actuate.web.ErrorController;
|
||||
import org.springframework.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.bootstrap.actuate.web.BasicErrorController;
|
||||
import org.springframework.bootstrap.actuate.web.ErrorController;
|
||||
import org.springframework.bootstrap.context.annotation.ConditionalOnClass;
|
||||
import org.springframework.bootstrap.context.annotation.ConditionalOnMissingBean;
|
||||
import org.springframework.bootstrap.context.annotation.EnableAutoConfiguration;
|
||||
import org.springframework.bootstrap.context.condition.ConditionalOnClass;
|
||||
import org.springframework.bootstrap.context.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.bootstrap.context.embedded.ConfigurableEmbeddedServletContainerFactory;
|
||||
import org.springframework.bootstrap.context.embedded.EmbeddedServletContainerCustomizer;
|
||||
import org.springframework.bootstrap.context.embedded.ErrorPage;
|
@ -13,14 +13,15 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.bootstrap.actuate.autoconfigure;
|
||||
|
||||
import org.springframework.bootstrap.actuate.properties.ManagementServerProperties;
|
||||
import org.springframework.bootstrap.autoconfigure.web.ServerPropertiesAutoConfiguration;
|
||||
import org.springframework.bootstrap.context.annotation.AutoConfigureAfter;
|
||||
import org.springframework.bootstrap.context.annotation.ConditionalOnMissingBean;
|
||||
import org.springframework.bootstrap.context.annotation.EnableAutoConfiguration;
|
||||
import org.springframework.bootstrap.context.annotation.EnableConfigurationProperties;
|
||||
package org.springframework.actuate.autoconfigure;
|
||||
|
||||
import org.springframework.actuate.properties.ManagementServerProperties;
|
||||
import org.springframework.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.autoconfigure.web.ServerPropertiesAutoConfiguration;
|
||||
import org.springframework.bootstrap.context.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.bootstrap.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@ -35,7 +36,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
@EnableConfigurationProperties
|
||||
public class ManagementServerPropertiesAutoConfiguration {
|
||||
|
||||
@Bean(name = "org.springframework.bootstrap.actuate.properties.ManagementServerProperties")
|
||||
@Bean(name = "org.springframework.actuate.properties.ManagementServerProperties")
|
||||
@ConditionalOnMissingBean
|
||||
public ManagementServerProperties serverProperties() {
|
||||
return new ManagementServerProperties();
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.autoconfigure;
|
||||
package org.springframework.actuate.autoconfigure;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@ -27,13 +27,13 @@ import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.actuate.metrics.CounterService;
|
||||
import org.springframework.actuate.metrics.GaugeService;
|
||||
import org.springframework.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.bootstrap.actuate.metrics.CounterService;
|
||||
import org.springframework.bootstrap.actuate.metrics.GaugeService;
|
||||
import org.springframework.bootstrap.context.annotation.AutoConfigureAfter;
|
||||
import org.springframework.bootstrap.context.annotation.ConditionalOnBean;
|
||||
import org.springframework.bootstrap.context.annotation.ConditionalOnClass;
|
||||
import org.springframework.bootstrap.context.annotation.EnableAutoConfiguration;
|
||||
import org.springframework.bootstrap.context.condition.ConditionalOnBean;
|
||||
import org.springframework.bootstrap.context.condition.ConditionalOnClass;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.Ordered;
|
||||
@ -83,7 +83,8 @@ public class MetricFilterAutoConfiguration {
|
||||
&& (response instanceof HttpServletResponse)) {
|
||||
doFilter((HttpServletRequest) request, (HttpServletResponse) response,
|
||||
chain);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
chain.doFilter(request, response);
|
||||
}
|
||||
}
|
||||
@ -96,7 +97,8 @@ public class MetricFilterAutoConfiguration {
|
||||
stopWatch.start();
|
||||
try {
|
||||
chain.doFilter(request, response);
|
||||
} finally {
|
||||
}
|
||||
finally {
|
||||
stopWatch.stop();
|
||||
String gaugeKey = getKey("response" + suffix);
|
||||
MetricFilterAutoConfiguration.this.gaugeService.set(gaugeKey,
|
||||
@ -109,7 +111,8 @@ public class MetricFilterAutoConfiguration {
|
||||
private int getStatus(HttpServletResponse response) {
|
||||
try {
|
||||
return response.getStatus();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception ex) {
|
||||
return UNDEFINED_HTTP_STATUS;
|
||||
}
|
||||
}
|
@ -14,16 +14,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.autoconfigure;
|
||||
package org.springframework.actuate.autoconfigure;
|
||||
|
||||
import org.springframework.bootstrap.actuate.metrics.CounterService;
|
||||
import org.springframework.bootstrap.actuate.metrics.DefaultCounterService;
|
||||
import org.springframework.bootstrap.actuate.metrics.DefaultGaugeService;
|
||||
import org.springframework.bootstrap.actuate.metrics.GaugeService;
|
||||
import org.springframework.bootstrap.actuate.metrics.InMemoryMetricRepository;
|
||||
import org.springframework.bootstrap.actuate.metrics.MetricRepository;
|
||||
import org.springframework.bootstrap.context.annotation.ConditionalOnMissingBean;
|
||||
import org.springframework.bootstrap.context.annotation.EnableAutoConfiguration;
|
||||
import org.springframework.actuate.metrics.CounterService;
|
||||
import org.springframework.actuate.metrics.DefaultCounterService;
|
||||
import org.springframework.actuate.metrics.DefaultGaugeService;
|
||||
import org.springframework.actuate.metrics.GaugeService;
|
||||
import org.springframework.actuate.metrics.InMemoryMetricRepository;
|
||||
import org.springframework.actuate.metrics.MetricRepository;
|
||||
import org.springframework.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.bootstrap.context.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -14,21 +14,21 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.autoconfigure;
|
||||
package org.springframework.actuate.autoconfigure;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.actuate.endpoint.Endpoint;
|
||||
import org.springframework.actuate.endpoint.mvc.EndpointHandlerMapping;
|
||||
import org.springframework.actuate.properties.SecurityProperties;
|
||||
import org.springframework.actuate.web.ErrorController;
|
||||
import org.springframework.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.bootstrap.actuate.endpoint.Endpoint;
|
||||
import org.springframework.bootstrap.actuate.endpoint.mvc.EndpointHandlerMapping;
|
||||
import org.springframework.bootstrap.actuate.properties.SecurityProperties;
|
||||
import org.springframework.bootstrap.actuate.web.ErrorController;
|
||||
import org.springframework.bootstrap.context.annotation.ConditionalOnClass;
|
||||
import org.springframework.bootstrap.context.annotation.ConditionalOnMissingBean;
|
||||
import org.springframework.bootstrap.context.annotation.EnableAutoConfiguration;
|
||||
import org.springframework.bootstrap.context.annotation.EnableConfigurationProperties;
|
||||
import org.springframework.bootstrap.context.condition.ConditionalOnClass;
|
||||
import org.springframework.bootstrap.context.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.bootstrap.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.Ordered;
|
||||
@ -84,7 +84,7 @@ import org.springframework.security.web.authentication.www.BasicAuthenticationEn
|
||||
@EnableConfigurationProperties
|
||||
public class SecurityAutoConfiguration {
|
||||
|
||||
@Bean(name = "org.springframework.bootstrap.actuate.properties.SecurityProperties")
|
||||
@Bean(name = "org.springframework.actuate.properties.SecurityProperties")
|
||||
@ConditionalOnMissingBean
|
||||
public SecurityProperties securityProperties() {
|
||||
return new SecurityProperties();
|
@ -14,12 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.autoconfigure;
|
||||
package org.springframework.actuate.autoconfigure;
|
||||
|
||||
import org.springframework.bootstrap.actuate.trace.InMemoryTraceRepository;
|
||||
import org.springframework.bootstrap.actuate.trace.TraceRepository;
|
||||
import org.springframework.bootstrap.context.annotation.ConditionalOnMissingBean;
|
||||
import org.springframework.bootstrap.context.annotation.EnableAutoConfiguration;
|
||||
import org.springframework.actuate.trace.InMemoryTraceRepository;
|
||||
import org.springframework.actuate.trace.TraceRepository;
|
||||
import org.springframework.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.bootstrap.context.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -13,18 +13,19 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.bootstrap.actuate.autoconfigure;
|
||||
|
||||
package org.springframework.actuate.autoconfigure;
|
||||
|
||||
import javax.servlet.Servlet;
|
||||
|
||||
import org.springframework.actuate.trace.TraceRepository;
|
||||
import org.springframework.actuate.trace.WebRequestTraceFilter;
|
||||
import org.springframework.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.bootstrap.actuate.trace.TraceRepository;
|
||||
import org.springframework.bootstrap.actuate.trace.WebRequestTraceFilter;
|
||||
import org.springframework.bootstrap.context.annotation.AutoConfigureAfter;
|
||||
import org.springframework.bootstrap.context.annotation.ConditionalOnClass;
|
||||
import org.springframework.bootstrap.context.annotation.EnableAutoConfiguration;
|
||||
import org.springframework.bootstrap.context.condition.ConditionalOnClass;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.web.servlet.DispatcherServlet;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint;
|
||||
package org.springframework.actuate.endpoint;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint;
|
||||
package org.springframework.actuate.endpoint;
|
||||
|
||||
/**
|
||||
* Tagging interface used to indicate that {@link Endpoint} that performs some action.
|
@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint;
|
||||
package org.springframework.actuate.endpoint;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.bootstrap.context.annotation.ConfigurationProperties;
|
||||
import org.springframework.bootstrap.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.context.support.LiveBeansView;
|
@ -14,14 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint;
|
||||
package org.springframework.actuate.endpoint;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.management.ThreadInfo;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.bootstrap.context.annotation.ConfigurationProperties;
|
||||
import org.springframework.bootstrap.context.properties.ConfigurationProperties;
|
||||
|
||||
/**
|
||||
* {@link Endpoint} to expose thread info.
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint;
|
||||
package org.springframework.actuate.endpoint;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
|
@ -14,12 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint;
|
||||
package org.springframework.actuate.endpoint;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.bootstrap.context.annotation.ConfigurationProperties;
|
||||
import org.springframework.bootstrap.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.EnvironmentAware;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
import org.springframework.core.env.EnumerablePropertySource;
|
@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint;
|
||||
package org.springframework.actuate.endpoint;
|
||||
|
||||
import org.springframework.bootstrap.actuate.health.HealthIndicator;
|
||||
import org.springframework.bootstrap.context.annotation.ConfigurationProperties;
|
||||
import org.springframework.actuate.health.HealthIndicator;
|
||||
import org.springframework.bootstrap.context.properties.ConfigurationProperties;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint;
|
||||
package org.springframework.actuate.endpoint;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.bootstrap.context.annotation.ConfigurationProperties;
|
||||
import org.springframework.bootstrap.context.properties.ConfigurationProperties;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint;
|
||||
package org.springframework.actuate.endpoint;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.bootstrap.actuate.metrics.Metric;
|
||||
import org.springframework.bootstrap.context.annotation.ConfigurationProperties;
|
||||
import org.springframework.actuate.metrics.Metric;
|
||||
import org.springframework.bootstrap.context.properties.ConfigurationProperties;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
@ -14,11 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint;
|
||||
package org.springframework.actuate.endpoint;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.springframework.bootstrap.actuate.metrics.Metric;
|
||||
import org.springframework.actuate.metrics.Metric;
|
||||
|
||||
/**
|
||||
* Interface to expose specific {@link Metric}s via a {@link MetricsEndpoint}.
|
@ -14,15 +14,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint;
|
||||
package org.springframework.actuate.endpoint;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.actuate.properties.ManagementServerProperties;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.bootstrap.actuate.properties.ManagementServerProperties;
|
||||
import org.springframework.bootstrap.context.annotation.ConfigurationProperties;
|
||||
import org.springframework.bootstrap.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
@ -61,7 +61,9 @@ public class ShutdownEndpoint extends AbstractEndpoint<Map<String, Object>> impl
|
||||
public void run() {
|
||||
try {
|
||||
Thread.sleep(500L);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
catch (InterruptedException ex) {
|
||||
// Swallow exception and continue
|
||||
}
|
||||
ShutdownEndpoint.this.context.close();
|
||||
}
|
@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint;
|
||||
package org.springframework.actuate.endpoint;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.bootstrap.actuate.trace.Trace;
|
||||
import org.springframework.bootstrap.actuate.trace.TraceRepository;
|
||||
import org.springframework.bootstrap.context.annotation.ConfigurationProperties;
|
||||
import org.springframework.actuate.trace.Trace;
|
||||
import org.springframework.actuate.trace.TraceRepository;
|
||||
import org.springframework.bootstrap.context.properties.ConfigurationProperties;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint;
|
||||
package org.springframework.actuate.endpoint;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashSet;
|
||||
|
||||
import org.springframework.bootstrap.actuate.metrics.Metric;
|
||||
import org.springframework.bootstrap.actuate.metrics.MetricRepository;
|
||||
import org.springframework.actuate.metrics.Metric;
|
||||
import org.springframework.actuate.metrics.MetricRepository;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint.mvc;
|
||||
package org.springframework.actuate.endpoint.mvc;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@ -28,7 +28,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.bootstrap.actuate.endpoint.Endpoint;
|
||||
import org.springframework.actuate.endpoint.Endpoint;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||
@ -50,9 +50,9 @@ import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
* @author Phillip Webb
|
||||
* @see EndpointHandlerMapping
|
||||
*/
|
||||
public class EndpointHandlerAdapter implements HandlerAdapter {
|
||||
public final class EndpointHandlerAdapter implements HandlerAdapter {
|
||||
|
||||
private static final Log logger = LogFactory.getLog(EndpointHandlerAdapter.class);
|
||||
private final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private static final MediaType MEDIA_TYPE_APPLICATION = new MediaType("application");
|
||||
|
||||
@ -102,8 +102,8 @@ public class EndpointHandlerAdapter implements HandlerAdapter {
|
||||
if (messageConverter.canWrite(resultClass, selectedMediaType)) {
|
||||
((HttpMessageConverter<Object>) messageConverter).write(result,
|
||||
selectedMediaType, outputMessage);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Written [" + result + "] as \""
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Written [" + result + "] as \""
|
||||
+ selectedMediaType + "\" using [" + messageConverter
|
||||
+ "]");
|
||||
}
|
||||
@ -112,7 +112,8 @@ public class EndpointHandlerAdapter implements HandlerAdapter {
|
||||
}
|
||||
}
|
||||
throw new HttpMediaTypeNotAcceptableException(this.allSupportedMediaTypes);
|
||||
} finally {
|
||||
}
|
||||
finally {
|
||||
outputMessage.close();
|
||||
}
|
||||
}
|
||||
@ -179,7 +180,8 @@ public class EndpointHandlerAdapter implements HandlerAdapter {
|
||||
if (mediaType.isConcrete()) {
|
||||
selectedMediaType = mediaType;
|
||||
break;
|
||||
} else if (mediaType.equals(MediaType.ALL)
|
||||
}
|
||||
else if (mediaType.equals(MediaType.ALL)
|
||||
|| mediaType.equals(MEDIA_TYPE_APPLICATION)) {
|
||||
selectedMediaType = MediaType.APPLICATION_OCTET_STREAM;
|
||||
break;
|
@ -13,7 +13,8 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.bootstrap.actuate.endpoint.mvc;
|
||||
|
||||
package org.springframework.actuate.endpoint.mvc;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@ -22,10 +23,10 @@ import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.actuate.endpoint.ActionEndpoint;
|
||||
import org.springframework.actuate.endpoint.Endpoint;
|
||||
import org.springframework.beans.factory.BeanFactoryUtils;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.bootstrap.actuate.endpoint.ActionEndpoint;
|
||||
import org.springframework.bootstrap.actuate.endpoint.Endpoint;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.util.Assert;
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.fixme;
|
||||
package org.springframework.actuate.fixme;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@ -24,14 +24,14 @@ import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
|
||||
import org.springframework.actuate.properties.ManagementServerProperties;
|
||||
import org.springframework.actuate.web.BasicErrorController;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.HierarchicalBeanFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.bootstrap.actuate.properties.ManagementServerProperties;
|
||||
import org.springframework.bootstrap.actuate.web.BasicErrorController;
|
||||
import org.springframework.bootstrap.context.annotation.ConditionalOnBean;
|
||||
import org.springframework.bootstrap.context.annotation.ConditionalOnClass;
|
||||
import org.springframework.bootstrap.context.condition.ConditionalOnBean;
|
||||
import org.springframework.bootstrap.context.condition.ConditionalOnClass;
|
||||
import org.springframework.bootstrap.context.embedded.ConfigurableEmbeddedServletContainerFactory;
|
||||
import org.springframework.bootstrap.context.embedded.EmbeddedServletContainerCustomizer;
|
||||
import org.springframework.bootstrap.context.embedded.EmbeddedServletContainerFactory;
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.health;
|
||||
package org.springframework.actuate.health;
|
||||
|
||||
/**
|
||||
* Strategy interface used to provide an indication of application health.
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.health;
|
||||
package org.springframework.actuate.health;
|
||||
|
||||
/**
|
||||
* Default implementation of {@link HealthIndicator} that simply returns "ok".
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.metrics;
|
||||
package org.springframework.actuate.metrics;
|
||||
|
||||
/**
|
||||
* A service that can be used to increment, decrement and reset a {@link Metric}.
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.metrics;
|
||||
package org.springframework.actuate.metrics;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@ -54,7 +54,8 @@ public class DefaultCounterService implements CounterService {
|
||||
private String wrap(String metricName) {
|
||||
if (metricName.startsWith("counter")) {
|
||||
return metricName;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return "counter." + metricName;
|
||||
}
|
||||
}
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.metrics;
|
||||
package org.springframework.actuate.metrics;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@ -43,7 +43,8 @@ public class DefaultGaugeService implements GaugeService {
|
||||
private String wrap(String metricName) {
|
||||
if (metricName.startsWith("gauge")) {
|
||||
return metricName;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return "gauge." + metricName;
|
||||
}
|
||||
}
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.metrics;
|
||||
package org.springframework.actuate.metrics;
|
||||
|
||||
/**
|
||||
* A service that can be used to manage a {@link Metric} as a gauge.
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.metrics;
|
||||
package org.springframework.actuate.metrics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@ -37,7 +37,8 @@ public class InMemoryMetricRepository implements MetricRepository {
|
||||
Metric metric = current.getMetric();
|
||||
this.metrics.replace(metricName, current,
|
||||
new Measurement(timestamp, metric.increment(amount)));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
this.metrics.putIfAbsent(metricName, new Measurement(timestamp, new Metric(
|
||||
metricName, amount)));
|
||||
}
|
||||
@ -50,7 +51,8 @@ public class InMemoryMetricRepository implements MetricRepository {
|
||||
Metric metric = current.getMetric();
|
||||
this.metrics.replace(metricName, current,
|
||||
new Measurement(timestamp, metric.set(value)));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
this.metrics.putIfAbsent(metricName, new Measurement(timestamp, new Metric(
|
||||
metricName, value)));
|
||||
}
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.metrics;
|
||||
package org.springframework.actuate.metrics;
|
||||
|
||||
import java.util.Date;
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.metrics;
|
||||
package org.springframework.actuate.metrics;
|
||||
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ObjectUtils;
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.metrics;
|
||||
package org.springframework.actuate.metrics;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
@ -14,14 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.properties;
|
||||
package org.springframework.actuate.properties;
|
||||
|
||||
import java.net.InetAddress;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import org.springframework.bootstrap.context.annotation.ConfigurationProperties;
|
||||
import org.springframework.bootstrap.properties.ServerProperties;
|
||||
import org.springframework.bootstrap.context.embedded.properties.ServerProperties;
|
||||
import org.springframework.bootstrap.context.properties.ConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Properties for the management server (e.g. port and path settings).
|
@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.properties;
|
||||
package org.springframework.actuate.properties;
|
||||
|
||||
import org.springframework.bootstrap.context.annotation.ConfigurationProperties;
|
||||
import org.springframework.bootstrap.context.properties.ConfigurationProperties;
|
||||
import org.springframework.security.config.annotation.web.configurers.SessionCreationPolicy;
|
||||
|
||||
/**
|
@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.security;
|
||||
package org.springframework.actuate.security;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.bootstrap.actuate.audit.AuditEvent;
|
||||
import org.springframework.bootstrap.actuate.audit.listener.AuditApplicationEvent;
|
||||
import org.springframework.actuate.audit.AuditEvent;
|
||||
import org.springframework.actuate.audit.listener.AuditApplicationEvent;
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.context.ApplicationEventPublisherAware;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
@ -48,9 +48,11 @@ public class AuthenticationAuditListener implements
|
||||
public void onApplicationEvent(AbstractAuthenticationEvent event) {
|
||||
if (event instanceof AbstractAuthenticationFailureEvent) {
|
||||
onAuthenticationFailureEvent((AbstractAuthenticationFailureEvent) event);
|
||||
} else if (event instanceof AuthenticationSwitchUserEvent) {
|
||||
}
|
||||
else if (event instanceof AuthenticationSwitchUserEvent) {
|
||||
onAuthenticationSwitchUserEvent((AuthenticationSwitchUserEvent) event);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
onAuthenticationEvent(event);
|
||||
}
|
||||
}
|
@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.security;
|
||||
package org.springframework.actuate.security;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.bootstrap.actuate.audit.AuditEvent;
|
||||
import org.springframework.bootstrap.actuate.audit.listener.AuditApplicationEvent;
|
||||
import org.springframework.actuate.audit.AuditEvent;
|
||||
import org.springframework.actuate.audit.listener.AuditApplicationEvent;
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.context.ApplicationEventPublisherAware;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
@ -48,7 +48,8 @@ public class AuthorizationAuditListener implements
|
||||
public void onApplicationEvent(AbstractAuthorizationEvent event) {
|
||||
if (event instanceof AuthenticationCredentialsNotFoundEvent) {
|
||||
onAuthenticationCredentialsNotFoundEvent((AuthenticationCredentialsNotFoundEvent) event);
|
||||
} else if (event instanceof AuthorizationFailureEvent) {
|
||||
}
|
||||
else if (event instanceof AuthorizationFailureEvent) {
|
||||
onAuthorizationFailureEvent((AuthorizationFailureEvent) event);
|
||||
}
|
||||
}
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.trace;
|
||||
package org.springframework.actuate.trace;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.trace;
|
||||
package org.springframework.actuate.trace;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.trace;
|
||||
package org.springframework.actuate.trace;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.trace;
|
||||
package org.springframework.actuate.trace;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
@ -46,7 +46,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
*/
|
||||
public class WebRequestTraceFilter implements Filter, Ordered {
|
||||
|
||||
final Log logger = LogFactory.getLog(WebRequestTraceFilter.class);
|
||||
private final Log logger = LogFactory.getLog(WebRequestTraceFilter.class);
|
||||
|
||||
private boolean dumpRequests = false;
|
||||
|
||||
@ -83,6 +83,7 @@ public class WebRequestTraceFilter implements Filter, Ordered {
|
||||
this.dumpRequests = dumpRequests;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
|
||||
throws IOException, ServletException {
|
||||
HttpServletRequest request = (HttpServletRequest) req;
|
||||
@ -100,8 +101,9 @@ public class WebRequestTraceFilter implements Filter, Ordered {
|
||||
.get("headers");
|
||||
this.logger.trace("Headers: "
|
||||
+ this.objectMapper.writeValueAsString(headers));
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new IllegalStateException("Cannot create JSON", e);
|
||||
}
|
||||
catch (JsonProcessingException ex) {
|
||||
throw new IllegalStateException("Cannot create JSON", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -120,7 +122,8 @@ public class WebRequestTraceFilter implements Filter, Ordered {
|
||||
Object value = values;
|
||||
if (values.size() == 1) {
|
||||
value = values.get(0);
|
||||
} else if (values.isEmpty()) {
|
||||
}
|
||||
else if (values.isEmpty()) {
|
||||
value = "";
|
||||
}
|
||||
map.put(name, value);
|
||||
@ -133,9 +136,11 @@ public class WebRequestTraceFilter implements Filter, Ordered {
|
||||
return trace;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.web;
|
||||
package org.springframework.actuate.web;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
@ -47,6 +47,8 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
@Controller
|
||||
public class BasicErrorController implements ErrorController {
|
||||
|
||||
private static final String ERROR_KEY = "error";
|
||||
|
||||
private Log logger = LogFactory.getLog(BasicErrorController.class);
|
||||
|
||||
@Value("${error.path:/error}")
|
||||
@ -60,7 +62,7 @@ public class BasicErrorController implements ErrorController {
|
||||
@RequestMapping(value = "${error.path:/error}", produces = "text/html")
|
||||
public ModelAndView errorHtml(HttpServletRequest request) {
|
||||
Map<String, Object> map = error(request);
|
||||
return new ModelAndView("error", map);
|
||||
return new ModelAndView(ERROR_KEY, map);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "${error.path:/error}")
|
||||
@ -75,9 +77,10 @@ public class BasicErrorController implements ErrorController {
|
||||
int status = 999;
|
||||
if (obj != null) {
|
||||
status = (Integer) obj;
|
||||
map.put("error", HttpStatus.valueOf(status).getReasonPhrase());
|
||||
} else {
|
||||
map.put("error", "None");
|
||||
map.put(ERROR_KEY, HttpStatus.valueOf(status).getReasonPhrase());
|
||||
}
|
||||
else {
|
||||
map.put(ERROR_KEY, "None");
|
||||
}
|
||||
map.put("status", status);
|
||||
if (error != null) {
|
||||
@ -94,15 +97,17 @@ public class BasicErrorController implements ErrorController {
|
||||
map.put("trace", stackTrace.toString());
|
||||
}
|
||||
this.logger.error(error);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Object message = request.getAttribute("javax.servlet.error.message");
|
||||
map.put("message", message == null ? "No message available" : message);
|
||||
}
|
||||
return map;
|
||||
} catch (Exception e) {
|
||||
map.put("error", e.getClass().getName());
|
||||
map.put("message", e.getMessage());
|
||||
this.logger.error(e);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
map.put(ERROR_KEY, ex.getClass().getName());
|
||||
map.put("message", ex.getMessage());
|
||||
this.logger.error(ex);
|
||||
return map;
|
||||
}
|
||||
}
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.web;
|
||||
package org.springframework.actuate.web;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
11
spring-actuator/src/main/resources/META-INF/spring.factories
Normal file
11
spring-actuator/src/main/resources/META-INF/spring.factories
Normal file
@ -0,0 +1,11 @@
|
||||
org.springframework.autoconfigure.EnableAutoConfiguration=\
|
||||
org.springframework.actuate.autoconfigure.AuditAutoConfiguration,\
|
||||
org.springframework.actuate.autoconfigure.EndpointAutoConfiguration,\
|
||||
org.springframework.actuate.autoconfigure.EndpointWebMvcAutoConfiguration,\
|
||||
org.springframework.actuate.autoconfigure.ErrorMvcAutoConfiguration,\
|
||||
org.springframework.actuate.autoconfigure.ManagementServerPropertiesAutoConfiguration,\
|
||||
org.springframework.actuate.autoconfigure.MetricFilterAutoConfiguration,\
|
||||
org.springframework.actuate.autoconfigure.MetricRepositoryAutoConfiguration,\
|
||||
org.springframework.actuate.autoconfigure.SecurityAutoConfiguration,\
|
||||
org.springframework.actuate.autoconfigure.TraceRepositoryAutoConfiguration,\
|
||||
org.springframework.actuate.autoconfigure.TraceWebFilterAutoConfiguration
|
@ -14,11 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.audit;
|
||||
package org.springframework.actuate.audit;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.actuate.audit.AuditEvent;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
@ -14,11 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.audit;
|
||||
package org.springframework.actuate.audit;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.actuate.audit.AuditEvent;
|
||||
import org.springframework.actuate.audit.InMemoryAuditEventRepository;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
@ -13,13 +13,16 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.bootstrap.actuate.audit.listener;
|
||||
|
||||
package org.springframework.actuate.audit.listener;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.actuate.audit.AuditEvent;
|
||||
import org.springframework.bootstrap.actuate.audit.AuditEventRepository;
|
||||
import org.springframework.actuate.audit.AuditEvent;
|
||||
import org.springframework.actuate.audit.AuditEventRepository;
|
||||
import org.springframework.actuate.audit.listener.AuditApplicationEvent;
|
||||
import org.springframework.actuate.audit.listener.AuditListener;
|
||||
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.verify;
|
@ -14,13 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.autoconfigure;
|
||||
package org.springframework.actuate.autoconfigure;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.actuate.audit.AuditEventRepository;
|
||||
import org.springframework.bootstrap.actuate.audit.InMemoryAuditEventRepository;
|
||||
import org.springframework.bootstrap.actuate.security.AuthenticationAuditListener;
|
||||
import org.springframework.bootstrap.actuate.security.AuthorizationAuditListener;
|
||||
import org.springframework.actuate.audit.AuditEventRepository;
|
||||
import org.springframework.actuate.audit.InMemoryAuditEventRepository;
|
||||
import org.springframework.actuate.autoconfigure.AuditAutoConfiguration;
|
||||
import org.springframework.actuate.security.AuthenticationAuditListener;
|
||||
import org.springframework.actuate.security.AuthorizationAuditListener;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
@ -13,19 +13,21 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.bootstrap.actuate.autoconfigure;
|
||||
|
||||
package org.springframework.actuate.autoconfigure;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.actuate.TestUtils;
|
||||
import org.springframework.bootstrap.actuate.endpoint.BeansEndpoint;
|
||||
import org.springframework.bootstrap.actuate.endpoint.DumpEndpoint;
|
||||
import org.springframework.bootstrap.actuate.endpoint.EnvironmentEndpoint;
|
||||
import org.springframework.bootstrap.actuate.endpoint.HealthEndpoint;
|
||||
import org.springframework.bootstrap.actuate.endpoint.InfoEndpoint;
|
||||
import org.springframework.bootstrap.actuate.endpoint.MetricsEndpoint;
|
||||
import org.springframework.bootstrap.actuate.endpoint.ShutdownEndpoint;
|
||||
import org.springframework.bootstrap.actuate.endpoint.TraceEndpoint;
|
||||
import org.springframework.actuate.autoconfigure.EndpointAutoConfiguration;
|
||||
import org.springframework.actuate.endpoint.BeansEndpoint;
|
||||
import org.springframework.actuate.endpoint.DumpEndpoint;
|
||||
import org.springframework.actuate.endpoint.EnvironmentEndpoint;
|
||||
import org.springframework.actuate.endpoint.HealthEndpoint;
|
||||
import org.springframework.actuate.endpoint.InfoEndpoint;
|
||||
import org.springframework.actuate.endpoint.MetricsEndpoint;
|
||||
import org.springframework.actuate.endpoint.ShutdownEndpoint;
|
||||
import org.springframework.actuate.endpoint.TraceEndpoint;
|
||||
import org.springframework.bootstrap.TestUtils;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
@ -13,7 +13,8 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.bootstrap.actuate.autoconfigure;
|
||||
|
||||
package org.springframework.actuate.autoconfigure;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.net.SocketException;
|
||||
@ -22,14 +23,16 @@ import java.nio.charset.Charset;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.actuate.TestUtils;
|
||||
import org.springframework.bootstrap.actuate.endpoint.AbstractEndpoint;
|
||||
import org.springframework.bootstrap.actuate.endpoint.Endpoint;
|
||||
import org.springframework.bootstrap.actuate.properties.ManagementServerProperties;
|
||||
import org.springframework.bootstrap.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.bootstrap.autoconfigure.web.EmbeddedServletContainerAutoConfiguration;
|
||||
import org.springframework.bootstrap.autoconfigure.web.ServerPropertiesAutoConfiguration;
|
||||
import org.springframework.bootstrap.autoconfigure.web.WebMvcAutoConfiguration;
|
||||
import org.springframework.actuate.autoconfigure.EndpointWebMvcAutoConfiguration;
|
||||
import org.springframework.actuate.autoconfigure.ManagementServerPropertiesAutoConfiguration;
|
||||
import org.springframework.actuate.endpoint.AbstractEndpoint;
|
||||
import org.springframework.actuate.endpoint.Endpoint;
|
||||
import org.springframework.actuate.properties.ManagementServerProperties;
|
||||
import org.springframework.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.autoconfigure.web.EmbeddedServletContainerAutoConfiguration;
|
||||
import org.springframework.autoconfigure.web.ServerPropertiesAutoConfiguration;
|
||||
import org.springframework.autoconfigure.web.WebMvcAutoConfiguration;
|
||||
import org.springframework.bootstrap.TestUtils;
|
||||
import org.springframework.bootstrap.context.embedded.AnnotationConfigEmbeddedWebApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@ -59,7 +62,8 @@ public class EndpointWebMvcAutoConfigurationTests {
|
||||
public void close() {
|
||||
try {
|
||||
this.applicationContext.close();
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
catch (Exception ex) {
|
||||
}
|
||||
}
|
||||
|
||||
@ -166,10 +170,12 @@ public class EndpointWebMvcAutoConfigurationTests {
|
||||
String actual = StreamUtils.copyToString(response.getBody(),
|
||||
Charset.forName("UTF-8"));
|
||||
assertThat(actual, equalTo(expected));
|
||||
} finally {
|
||||
}
|
||||
finally {
|
||||
response.close();
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
catch (Exception ex) {
|
||||
if (expected == null) {
|
||||
if (SocketException.class.isInstance(ex)
|
||||
|| FileNotFoundException.class.isInstance(ex)) {
|
@ -13,10 +13,12 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.bootstrap.actuate.autoconfigure;
|
||||
|
||||
package org.springframework.actuate.autoconfigure;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.actuate.properties.ManagementServerProperties;
|
||||
import org.springframework.actuate.autoconfigure.ManagementServerPropertiesAutoConfiguration;
|
||||
import org.springframework.actuate.properties.ManagementServerProperties;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.autoconfigure;
|
||||
package org.springframework.actuate.autoconfigure;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
@ -22,8 +22,9 @@ import javax.servlet.FilterChain;
|
||||
import org.junit.Test;
|
||||
import org.mockito.invocation.InvocationOnMock;
|
||||
import org.mockito.stubbing.Answer;
|
||||
import org.springframework.bootstrap.actuate.metrics.CounterService;
|
||||
import org.springframework.bootstrap.actuate.metrics.GaugeService;
|
||||
import org.springframework.actuate.autoconfigure.MetricFilterAutoConfiguration;
|
||||
import org.springframework.actuate.metrics.CounterService;
|
||||
import org.springframework.actuate.metrics.GaugeService;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
@ -14,13 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.autoconfigure;
|
||||
package org.springframework.actuate.autoconfigure;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.actuate.metrics.CounterService;
|
||||
import org.springframework.bootstrap.actuate.metrics.DefaultCounterService;
|
||||
import org.springframework.bootstrap.actuate.metrics.DefaultGaugeService;
|
||||
import org.springframework.bootstrap.actuate.metrics.GaugeService;
|
||||
import org.springframework.actuate.autoconfigure.MetricRepositoryAutoConfiguration;
|
||||
import org.springframework.actuate.metrics.CounterService;
|
||||
import org.springframework.actuate.metrics.DefaultCounterService;
|
||||
import org.springframework.actuate.metrics.DefaultGaugeService;
|
||||
import org.springframework.actuate.metrics.GaugeService;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
@ -14,10 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.autoconfigure;
|
||||
package org.springframework.actuate.autoconfigure;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.actuate.autoconfigure.EndpointAutoConfiguration;
|
||||
import org.springframework.actuate.autoconfigure.SecurityAutoConfiguration;
|
||||
import org.springframework.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.mock.web.MockServletContext;
|
@ -14,11 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.autoconfigure;
|
||||
package org.springframework.actuate.autoconfigure;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.actuate.trace.InMemoryTraceRepository;
|
||||
import org.springframework.bootstrap.actuate.trace.TraceRepository;
|
||||
import org.springframework.actuate.autoconfigure.TraceRepositoryAutoConfiguration;
|
||||
import org.springframework.actuate.trace.InMemoryTraceRepository;
|
||||
import org.springframework.actuate.trace.TraceRepository;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
@ -14,11 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.autoconfigure;
|
||||
package org.springframework.actuate.autoconfigure;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.actuate.trace.WebRequestTraceFilter;
|
||||
import org.springframework.bootstrap.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.actuate.autoconfigure.TraceRepositoryAutoConfiguration;
|
||||
import org.springframework.actuate.autoconfigure.TraceWebFilterAutoConfiguration;
|
||||
import org.springframework.actuate.trace.WebRequestTraceFilter;
|
||||
import org.springframework.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
@ -14,13 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint;
|
||||
package org.springframework.actuate.endpoint;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.actuate.TestUtils;
|
||||
import org.springframework.actuate.endpoint.Endpoint;
|
||||
import org.springframework.bootstrap.TestUtils;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.core.env.MapPropertySource;
|
||||
import org.springframework.core.env.PropertySource;
|
@ -14,10 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint;
|
||||
package org.springframework.actuate.endpoint;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.context.annotation.EnableConfigurationProperties;
|
||||
import org.springframework.actuate.endpoint.BeansEndpoint;
|
||||
import org.springframework.bootstrap.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.MediaType;
|
@ -14,13 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint;
|
||||
package org.springframework.actuate.endpoint;
|
||||
|
||||
import java.lang.management.ThreadInfo;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.context.annotation.EnableConfigurationProperties;
|
||||
import org.springframework.actuate.endpoint.DumpEndpoint;
|
||||
import org.springframework.bootstrap.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -14,10 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint;
|
||||
package org.springframework.actuate.endpoint;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.context.annotation.EnableConfigurationProperties;
|
||||
import org.springframework.actuate.endpoint.EnvironmentEndpoint;
|
||||
import org.springframework.bootstrap.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -14,11 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint;
|
||||
package org.springframework.actuate.endpoint;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.actuate.health.HealthIndicator;
|
||||
import org.springframework.bootstrap.context.annotation.EnableConfigurationProperties;
|
||||
import org.springframework.actuate.endpoint.HealthEndpoint;
|
||||
import org.springframework.actuate.health.HealthIndicator;
|
||||
import org.springframework.bootstrap.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -14,12 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint;
|
||||
package org.springframework.actuate.endpoint;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.context.annotation.EnableConfigurationProperties;
|
||||
import org.springframework.actuate.endpoint.InfoEndpoint;
|
||||
import org.springframework.bootstrap.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -14,14 +14,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint;
|
||||
package org.springframework.actuate.endpoint;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.actuate.metrics.Metric;
|
||||
import org.springframework.bootstrap.context.annotation.EnableConfigurationProperties;
|
||||
import org.springframework.actuate.endpoint.MetricsEndpoint;
|
||||
import org.springframework.actuate.endpoint.PublicMetrics;
|
||||
import org.springframework.actuate.metrics.Metric;
|
||||
import org.springframework.bootstrap.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -14,11 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint;
|
||||
package org.springframework.actuate.endpoint;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.actuate.properties.ManagementServerProperties;
|
||||
import org.springframework.bootstrap.context.annotation.EnableConfigurationProperties;
|
||||
import org.springframework.actuate.endpoint.ShutdownEndpoint;
|
||||
import org.springframework.actuate.properties.ManagementServerProperties;
|
||||
import org.springframework.bootstrap.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -14,15 +14,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint;
|
||||
package org.springframework.actuate.endpoint;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.actuate.trace.InMemoryTraceRepository;
|
||||
import org.springframework.bootstrap.actuate.trace.Trace;
|
||||
import org.springframework.bootstrap.actuate.trace.TraceRepository;
|
||||
import org.springframework.bootstrap.context.annotation.EnableConfigurationProperties;
|
||||
import org.springframework.actuate.endpoint.TraceEndpoint;
|
||||
import org.springframework.actuate.trace.InMemoryTraceRepository;
|
||||
import org.springframework.actuate.trace.Trace;
|
||||
import org.springframework.actuate.trace.TraceRepository;
|
||||
import org.springframework.bootstrap.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -14,15 +14,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint;
|
||||
package org.springframework.actuate.endpoint;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.actuate.metrics.InMemoryMetricRepository;
|
||||
import org.springframework.bootstrap.actuate.metrics.Metric;
|
||||
import org.springframework.actuate.endpoint.VanillaPublicMetrics;
|
||||
import org.springframework.actuate.metrics.InMemoryMetricRepository;
|
||||
import org.springframework.actuate.metrics.Metric;
|
||||
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.junit.Assert.assertThat;
|
@ -14,10 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint.mvc;
|
||||
package org.springframework.actuate.endpoint.mvc;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.actuate.endpoint.Endpoint;
|
||||
import org.springframework.actuate.endpoint.Endpoint;
|
||||
import org.springframework.actuate.endpoint.mvc.EndpointHandlerAdapter;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
@ -14,13 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.endpoint.mvc;
|
||||
package org.springframework.actuate.endpoint.mvc;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.bootstrap.actuate.endpoint.AbstractEndpoint;
|
||||
import org.springframework.bootstrap.actuate.endpoint.ActionEndpoint;
|
||||
import org.springframework.actuate.endpoint.AbstractEndpoint;
|
||||
import org.springframework.actuate.endpoint.ActionEndpoint;
|
||||
import org.springframework.actuate.endpoint.mvc.EndpointHandlerMapping;
|
||||
import org.springframework.mock.web.MockHttpServletRequest;
|
||||
|
||||
import static org.hamcrest.Matchers.equalTo;
|
@ -14,8 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.fixme;
|
||||
|
||||
package org.springframework.actuate.fixme;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
@ -14,9 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.health;
|
||||
package org.springframework.actuate.health;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.actuate.health.VanillaHealthIndicator;
|
||||
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.junit.Assert.assertThat;
|
@ -14,10 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.metrics;
|
||||
package org.springframework.actuate.metrics;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.springframework.actuate.metrics.DefaultCounterService;
|
||||
|
||||
import static org.junit.Assert.fail;
|
||||
|
@ -14,10 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.metrics;
|
||||
package org.springframework.actuate.metrics;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.springframework.actuate.metrics.DefaultGaugeService;
|
||||
|
||||
import static org.junit.Assert.fail;
|
||||
|
@ -13,10 +13,12 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.bootstrap.actuate.metrics;
|
||||
|
||||
package org.springframework.actuate.metrics;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.springframework.actuate.metrics.InMemoryMetricRepository;
|
||||
|
||||
import static org.junit.Assert.fail;
|
||||
|
@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.properties;
|
||||
package org.springframework.actuate.properties;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.actuate.properties.SecurityProperties;
|
||||
import org.springframework.beans.MutablePropertyValues;
|
||||
import org.springframework.bootstrap.actuate.properties.SecurityProperties;
|
||||
import org.springframework.bootstrap.bind.RelaxedDataBinder;
|
||||
import org.springframework.core.convert.support.DefaultConversionService;
|
||||
|
@ -14,10 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.security;
|
||||
package org.springframework.actuate.security;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.springframework.actuate.security.AuthenticationAuditListener;
|
||||
|
||||
import static org.junit.Assert.fail;
|
||||
|
@ -14,10 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.security;
|
||||
package org.springframework.actuate.security;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.springframework.actuate.security.AuthenticationAuditListener;
|
||||
|
||||
import static org.junit.Assert.fail;
|
||||
|
@ -14,12 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.trace;
|
||||
package org.springframework.actuate.trace;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.actuate.trace.InMemoryTraceRepository;
|
||||
import org.springframework.actuate.trace.Trace;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
@ -14,11 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.actuate.trace;
|
||||
package org.springframework.actuate.trace;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.actuate.trace.InMemoryTraceRepository;
|
||||
import org.springframework.actuate.trace.WebRequestTraceFilter;
|
||||
import org.springframework.mock.web.MockHttpServletRequest;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
122
spring-autoconfigure/pom.xml
Normal file
122
spring-autoconfigure/pom.xml
Normal file
@ -0,0 +1,122 @@
|
||||
<?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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.zero</groupId>
|
||||
<artifactId>spring-zero</artifactId>
|
||||
<version>0.5.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>spring-autoconfigure</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<properties>
|
||||
<main.basedir>${basedir}/..</main.basedir>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<!-- Compile -->
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>spring-bootstrap</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<!-- Optional -->
|
||||
<dependency>
|
||||
<groupId>commons-dbcp</groupId>
|
||||
<artifactId>commons-dbcp</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>nz.net.ultraq.web.thymeleaf</groupId>
|
||||
<artifactId>thymeleaf-layout-dialect</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat.embed</groupId>
|
||||
<artifactId>tomcat-embed-core</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat</groupId>
|
||||
<artifactId>tomcat-jdbc</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-webapp</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-entitymanager</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate.javax.persistence</groupId>
|
||||
<artifactId>hibernate-jpa-2.0-api</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jdbc</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-orm</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-tx</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webmvc</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.batch</groupId>
|
||||
<artifactId>spring-batch-core</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-jpa</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.thymeleaf</groupId>
|
||||
<artifactId>thymeleaf</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.thymeleaf</groupId>
|
||||
<artifactId>thymeleaf-spring3</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- Test -->
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>spring-bootstrap</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
<artifactId>hsqldb</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -13,7 +13,8 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.bootstrap.context.annotation;
|
||||
|
||||
package org.springframework.autoconfigure;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@ -143,7 +144,8 @@ class AutoConfigurationSorter {
|
||||
if (this.after == null) {
|
||||
if (this.afterAnnotation == null) {
|
||||
this.after = Collections.emptyList();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
this.after = new ArrayList<AutoConfigurationClass>();
|
||||
for (String afterClass : (String[]) this.afterAnnotation.get("value")) {
|
||||
this.after.add(new AutoConfigurationClass(afterClass));
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.bootstrap.autoconfigure;
|
||||
package org.springframework.autoconfigure;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@ -28,19 +28,20 @@ import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
* Convenience class for storing base packages during component scan, for reference later
|
||||
* (e.g. by JPA entity scanner).
|
||||
*
|
||||
* @author Phil Webb
|
||||
* @author Phillip Webb
|
||||
* @author Dave Syer
|
||||
*/
|
||||
public abstract class AutoConfigurationUtils {
|
||||
|
||||
private static String BASE_PACKAGES_BEAN = AutoConfigurationUtils.class.getName()
|
||||
+ ".basePackages";
|
||||
private static final String BASE_PACKAGES_BEAN = AutoConfigurationUtils.class
|
||||
.getName() + ".basePackages";
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static List<String> getBasePackages(BeanFactory beanFactory) {
|
||||
try {
|
||||
return beanFactory.getBean(BASE_PACKAGES_BEAN, List.class);
|
||||
} catch (NoSuchBeanDefinitionException e) {
|
||||
}
|
||||
catch (NoSuchBeanDefinitionException ex) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
@ -50,7 +51,8 @@ public abstract class AutoConfigurationUtils {
|
||||
if (!beanFactory.containsBean(BASE_PACKAGES_BEAN)) {
|
||||
beanFactory.registerSingleton(BASE_PACKAGES_BEAN, new ArrayList<String>(
|
||||
basePackages));
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
List<String> packages = getBasePackages(beanFactory);
|
||||
for (String pkg : basePackages) {
|
||||
if (packages.contains(pkg)) {
|
@ -13,7 +13,8 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.bootstrap.context.annotation;
|
||||
|
||||
package org.springframework.autoconfigure;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user