mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Compare commits
363 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a636420239 | |||
| e68a7ae776 | |||
| 0dedba016c | |||
| 82ee0bef93 | |||
| b8a133d2f4 | |||
| f2e5e5aa86 | |||
| b6083c7f77 | |||
| 8575533081 | |||
| 5528c8a93b | |||
| c9912f0d2d | |||
| 8e14a5d640 | |||
| 230aa07fbb | |||
| b9aa471def | |||
| 39fbfbd343 | |||
| e9d24d5336 | |||
| 4a27a98702 | |||
| 929c596b55 | |||
| 9362d0d547 | |||
| 37713ae9dd | |||
| e118086bd1 | |||
| 0c7fa9e786 | |||
| dc15070877 | |||
| 61a6bc0139 | |||
| c087e51b80 | |||
| 9cb1569e67 | |||
| ac5c361688 | |||
| 328ba7b6d4 | |||
| d97add075a | |||
| c8ff562d1f | |||
| 1d6978afd5 | |||
| 4660e61cf9 | |||
| dfc79721cb | |||
| 90ae073854 | |||
| 50c578c5a0 | |||
| c89d8ec382 | |||
| 7e07f3d083 | |||
| e039185fec | |||
| b45f1aa26f | |||
| 054464709f | |||
| 5ac868036f | |||
| 58bea23f1d | |||
| 98569045cb | |||
| c2ffbf28c5 | |||
| a5e2afc980 | |||
| 5be50c8e5e | |||
| 1214624265 | |||
| 493e8463fa | |||
| 6d3a0d5735 | |||
| 5f58cd3b79 | |||
| 8854c33bf7 | |||
| f093a5f749 | |||
| 1f45dd297d | |||
| 21b8ce5284 | |||
| 2490d1b38d | |||
| ffa4736895 | |||
| 9beae9ae42 | |||
| e42e2330b3 | |||
| b331d65019 | |||
| 1823ce1fad | |||
| 2d0a677117 | |||
| a09bc9b1c1 | |||
| 260b451d5f | |||
| acefd8381d | |||
| 7fa3e65d04 | |||
| 329ba2a913 | |||
| f691618967 | |||
| fde0713a94 | |||
| 4729483804 | |||
| d3ec48f490 | |||
| 2d874d724b | |||
| 91940f212e | |||
| de8645b30c | |||
| c8b8dc5f97 | |||
| aa82da8507 | |||
| 16a4fe70f2 | |||
| 6117311906 | |||
| 6e5711a7fb | |||
| 15c8987cc4 | |||
| 0e907764a4 | |||
| a305bf7ad1 | |||
| e16f21c281 | |||
| 7507560e75 | |||
| a1c0905a7c | |||
| 6f9d7da59e | |||
| 47ed4d634b | |||
| da2c30cd0c | |||
| a7eeedaf6a | |||
| 578c3dd853 | |||
| 9758bc7833 | |||
| c672678423 | |||
| ac4103d1b9 | |||
| d23b033f61 | |||
| c74bad6e07 | |||
| f41e0bc796 | |||
| c7b6b72e73 | |||
| 1df8133237 | |||
| 43d40187d9 | |||
| b91cab1fde | |||
| d46c3fc7bf | |||
| 3267e5aa33 | |||
| 251970a2f9 | |||
| 901346eb7d | |||
| 1ffefcb548 | |||
| 0c680d6d03 | |||
| b87329cda7 | |||
| f21c8c37fb | |||
| 50e50d0c18 | |||
| 205e681295 | |||
| 29abca5399 | |||
| 60d5ff8dd5 | |||
| d2e8b7e6ee | |||
| 7d55715213 | |||
| d07230cf6a | |||
| bf881e4544 | |||
| 36a1d6242e | |||
| 10d4888408 | |||
| f8b729aa5f | |||
| b39e66b897 | |||
| 64849a46b4 | |||
| afb0342924 | |||
| bea9f3ff76 | |||
| 31094f3ef6 | |||
| d765698ac3 | |||
| d081a4530c | |||
| 97bd0ccfec | |||
| 8543a5548e | |||
| d2ef6dcb8d | |||
| bff2bf2cdb | |||
| 72d62a7113 | |||
| e1a01d4c3c | |||
| b7726ff48c | |||
| a52ff46fea | |||
| eb3509a37c | |||
| 93ad7f8def | |||
| 54ba5c5e7b | |||
| 249c688e9b | |||
| e324c2ab4a | |||
| 39a23660fa | |||
| 25971d9927 | |||
| 379e5abd83 | |||
| 8fb7b694dd | |||
| 21d0ce5af8 | |||
| fb452fad7c | |||
| 2dd2b7175f | |||
| f418e6e981 | |||
| 5e2b9b6f07 | |||
| a95a3ae4ec | |||
| 0c0d23d0f4 | |||
| a31ebb6c1e | |||
| 42c090efa4 | |||
| 035a9b91d2 | |||
| a7492fa55b | |||
| ecf23ff6cd | |||
| 4129f00a02 | |||
| e2d71a8ccd | |||
| 1034b0dae2 | |||
| c08ded769a | |||
| d61353db51 | |||
| 96efafef97 | |||
| fbf24a927d | |||
| f2eea9d911 | |||
| cac0683dab | |||
| 9ad6618207 | |||
| 84a4433898 | |||
| 44fac40a2f | |||
| 6e95b2613e | |||
| fca72f6b65 | |||
| 0dca31c39b | |||
| d45f743248 | |||
| acbd61b87a | |||
| dcb83c2daf | |||
| 5342d92db7 | |||
| 7af1e002bd | |||
| abd5f18e85 | |||
| 940ae0c528 | |||
| 5f77dce1ee | |||
| 0ef17a2f2c | |||
| 452260316e | |||
| c0815407bb | |||
| 845528a6cb | |||
| ed88155f55 | |||
| a3a76d8c15 | |||
| 10a039000b | |||
| 7de42efaf2 | |||
| 7dcc01e69b | |||
| adb73d5f35 | |||
| 7eee7d2e30 | |||
| d72ee809b7 | |||
| 31a251e44a | |||
| ce6adfbe35 | |||
| 60d3a7f300 | |||
| 6dbb465585 | |||
| 47de943926 | |||
| 0164f8691a | |||
| 077c624b73 | |||
| dae81fd5e6 | |||
| 837f27851f | |||
| c3b992c5c4 | |||
| f8ab4f6980 | |||
| 77406eded8 | |||
| 977c5ca439 | |||
| ede2150544 | |||
| 07edf11e21 | |||
| f27b9498be | |||
| e9ecaf6f4a | |||
| 5092414842 | |||
| 6438209557 | |||
| 7396210d40 | |||
| b9935e9fe3 | |||
| 86ea3059b6 | |||
| 4384c1ae50 | |||
| 347b7313b8 | |||
| 3fb05017a1 | |||
| 48f753f368 | |||
| c16032b98a | |||
| c32d5592c7 | |||
| 5f695a47db | |||
| 74c878ee0e | |||
| 178d58cc75 | |||
| 7b38b41bf5 | |||
| 6403479902 | |||
| 5af1a691bc | |||
| 9f967b1d81 | |||
| e50507206f | |||
| c73ac075c4 | |||
| 0bf0901b8f | |||
| 7d94b5e853 | |||
| 8ddbbc2e67 | |||
| 0a34f86333 | |||
| a0c86ae455 | |||
| 0761ee99ae | |||
| 9054f4fb58 | |||
| 41e78d0f50 | |||
| 526d5ba253 | |||
| 40c203ca71 | |||
| d18fc53148 | |||
| 618771d59d | |||
| 87077d3fad | |||
| c0c3618906 | |||
| 0405bb401a | |||
| e3e71ba92a | |||
| d4e1b9eb4c | |||
| 44ee51a6c9 | |||
| ba6d187b5c | |||
| 54636b3f7c | |||
| 545c28fd4e | |||
| 95a7bfd327 | |||
| ccebbf74ec | |||
| c350080f99 | |||
| 6b9738fd68 | |||
| 1120680c65 | |||
| a2ef2c9d3e | |||
| 1bbc032071 | |||
| c70a81a805 | |||
| 3c709a763d | |||
| 7d78c65187 | |||
| 748167bfa3 | |||
| 3e70013b55 | |||
| ea9ad4ee9b | |||
| 482eff81e1 | |||
| c706cbbed4 | |||
| 7bc38acbf6 | |||
| 297e4eec36 | |||
| 235b65d103 | |||
| 8a28645dd6 | |||
| f94ded830d | |||
| ad8f17b6af | |||
| 261520cea0 | |||
| 00aa40b8da | |||
| ac9b64e528 | |||
| 1e7fade89e | |||
| 3c58be05a5 | |||
| ef290ff95c | |||
| ae45794451 | |||
| fccec210b4 | |||
| 96da77ef75 | |||
| c9417d0610 | |||
| 085e52fc31 | |||
| 8f175046c8 | |||
| c1dbd9f150 | |||
| 42a35ef3be | |||
| 21fd68150a | |||
| d20259be1d | |||
| 6ca921021c | |||
| eab9d24c31 | |||
| 15749c2a9d | |||
| 93b0f0b126 | |||
| 27b2ed1614 | |||
| 790d62bcb1 | |||
| 563476f57c | |||
| 79de45b805 | |||
| 63a868dafb | |||
| 1afdd9bd75 | |||
| d0c839f0eb | |||
| 744727b8aa | |||
| 9fbb7394e2 | |||
| 80cb0c4e5b | |||
| 5c4804f4a4 | |||
| a679f3e7a3 | |||
| bd5b3749c5 | |||
| 89398b0811 | |||
| a87c9b8c5c | |||
| d0f9853769 | |||
| bed739ce92 | |||
| cb712afa97 | |||
| c97c246940 | |||
| 4196e6c96f | |||
| 59cef3ce81 | |||
| c8ea80d7ed | |||
| 656fc52ff9 | |||
| a4d6f8473e | |||
| 443fb8e4ee | |||
| 95b1cb7173 | |||
| 51fb485181 | |||
| f16e6c4105 | |||
| 4dbc0c296c | |||
| d71d38bfaf | |||
| eb28259371 | |||
| 7ae6a60f43 | |||
| d3c9a31e9a | |||
| 5aa126600f | |||
| 2f15f72fcc | |||
| d5aacdefd9 | |||
| e379e77b96 | |||
| 9c45755890 | |||
| 5962fc2590 | |||
| 1b59b4eb26 | |||
| f6b89c2ca9 | |||
| 82c32db5a1 | |||
| 52f580149f | |||
| 271fe4f554 | |||
| 02e8198283 | |||
| 090ab4bb6d | |||
| 18ef1d4f76 | |||
| d9cb44527c | |||
| 8e44521ec4 | |||
| d28c6d8bdb | |||
| c9432ce499 | |||
| 2d8e0c8f87 | |||
| 03ae8eeb95 | |||
| 9230b38aea | |||
| d5ce30f360 | |||
| 428aee5b72 | |||
| f7a17added | |||
| 196f629a20 | |||
| 7135e729e2 | |||
| 21874627d2 | |||
| 3ab88b857b | |||
| 294545d07a | |||
| 38cd79047a | |||
| 8a779c32d5 | |||
| 7ba31dee45 | |||
| 1c45d7573c | |||
| f014bbb5cf | |||
| d1030b798d | |||
| d628025f13 | |||
| 30ea1a3475 | |||
| 7b014eaa55 | |||
| e21c47d4ce | |||
| 632ae6a4df | |||
| 989f6194b6 | |||
| 17bf5b991f | |||
| cd9d7cfe4f |
@@ -1,23 +0,0 @@
|
||||
Juergen Hoeller <jhoeller@pivotal.io> jhoeller <jhoeller@vmware.com>
|
||||
<jhoeller@pivotal.io> <jhoeller@vmware.com>
|
||||
<jhoeller@pivotal.io> <jhoeller@gopivotal.com>
|
||||
<rstoyanchev@pivotal.io> <rstoyanchev@vmware.com>
|
||||
<rstoyanchev@pivotal.io> <rstoyanchev@gopivotal.com>
|
||||
<pwebb@pivotal.io> <pwebb@vmware.com>
|
||||
<pwebb@pivotal.io> <pwebb@gopivotal.com>
|
||||
<cbeams@pivotal.io> <cbeams@vmware.com>
|
||||
<cbeams@pivotal.io> <cbeams@gopivotal.com>
|
||||
<cbeams@pivotal.io> <cbeams@gmail.com>
|
||||
<apoutsma@pivotal.io> <apoutsma@vmware.com>
|
||||
<apoutsma@pivotal.io> <apoutsma@gopivotal.com>
|
||||
<apoutsma@pivotal.io> <poutsma@mac.com>
|
||||
<ogierke@pivotal.io> <ogierke@vmware.com>
|
||||
<ogierke@pivotal.io> <ogierke@gopivotal.com>
|
||||
<dsyer@pivotal.io> <dsyer@vmware.com>
|
||||
<dsyer@pivotal.io> <dsyer@gopivotal.com>
|
||||
<dsyer@pivotal.io> <david_syer@hotmail.com>
|
||||
<aclement@pivotal.io> <aclement@vmware.com>
|
||||
<aclement@pivotal.io> <aclement@gopivotal.com>
|
||||
<aclement@pivotal.io> <andrew.clement@gmail.com>
|
||||
<dmitry.katsubo@gmail.com> <dmitry.katsubo@gmai.com>
|
||||
Nick Williams <nicholas@nicholaswilliams.net> Nicholas Williams <nicholas@nicholaswilliams.net>
|
||||
@@ -22,14 +22,6 @@ do not find something similar, please create a new JIRA issue before submitting
|
||||
a pull request unless the change is truly trivial -- for example: typo fixes,
|
||||
removing compiler warnings, etc.
|
||||
|
||||
### Discuss non-trivial contribution ideas with committers
|
||||
|
||||
If you're considering anything more than correcting a typo or fixing a minor
|
||||
bug, please discuss it on the [spring-framework-contrib][] mailing list before
|
||||
submitting a pull request. We're happy to provide guidance, but please spend an
|
||||
hour or two researching the subject on your own, including searching the mailing
|
||||
list for prior discussions.
|
||||
|
||||
### Sign the Contributor License Agreement
|
||||
|
||||
If you have not previously done so, please fill out and submit the
|
||||
|
||||
@@ -37,7 +37,7 @@ a cross-platform, self-contained bootstrap mechanism for the build.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
[Git][] and [JDK 8 update 20 or later][JDK8 build]
|
||||
[Git][] and [OpenJDK 8 early access build 100 or later][JDK8 build]
|
||||
|
||||
Be sure that your `JAVA_HOME` environment variable points to the `jdk1.8.0` folder
|
||||
extracted from the JDK download.
|
||||
@@ -89,13 +89,13 @@ The Spring Framework is released under version 2.0 of the [Apache License][].
|
||||
[Gradle]: http://gradle.org
|
||||
[`./gradlew`]: http://vimeo.com/34436402
|
||||
[Git]: http://help.github.com/set-up-git-redirect
|
||||
[JDK8 build]: http://www.oracle.com/technetwork/java/javase/downloads
|
||||
[JDK8 build]: http://jdk8.java.net/download.html
|
||||
[Gradle build and release FAQ]: https://github.com/spring-projects/spring-framework/wiki/Gradle-build-and-release-FAQ
|
||||
[Pull requests]: http://help.github.com/send-pull-requests
|
||||
[contributor guidelines]: https://github.com/spring-projects/spring-framework/blob/master/CONTRIBUTING.md
|
||||
[@SpringFramework]: https://twitter.com/springframework
|
||||
[@SpringCentral]: https://twitter.com/springcentral
|
||||
[team members]: https://twitter.com/springframework/lists/team/members
|
||||
[team members]: https://twitter.com/springframework/team/members
|
||||
[The Spring Blog]: http://spring.io/blog/
|
||||
[news feed]: http://spring.io/blog/category/news
|
||||
[Apache License]: http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
+129
-274
@@ -1,23 +1,15 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
maven { url "http://repo.springsource.org/plugins-release" }
|
||||
maven { url "https://repo.spring.io/plugins-release" }
|
||||
}
|
||||
dependencies {
|
||||
classpath("org.springframework.build.gradle:propdeps-plugin:0.0.7")
|
||||
classpath("org.asciidoctor:asciidoctor-gradle-plugin:0.7.0")
|
||||
classpath("io.spring.gradle:docbook-reference-plugin:0.3.0")
|
||||
classpath("ws.antonov.gradle.plugins:gradle-plugin-protobuf:0.9.1")
|
||||
classpath("org.springframework.build.gradle:docbook-reference-plugin:0.2.8")
|
||||
}
|
||||
}
|
||||
|
||||
ext {
|
||||
linkHomepage = 'https://projects.spring.io/spring-framework'
|
||||
linkCi = 'https://build.spring.io/browse/SPR'
|
||||
linkIssue = 'https://jira.spring.io/browse/SPR'
|
||||
linkScmUrl = 'https://github.com/spring-projects/spring-framework'
|
||||
linkScmConnection = 'scm:git:git://github.com/spring-projects/spring-framework.git'
|
||||
linkScmDevConnection = 'scm:git:ssh://git@github.com:spring-projects/spring-framework.git'
|
||||
|
||||
moduleProjects = subprojects.findAll {
|
||||
!it.name.equals('spring-build-src') && !it.name.equals('spring-framework-bom')
|
||||
}
|
||||
@@ -27,35 +19,24 @@ configure(allprojects) { project ->
|
||||
group = "org.springframework"
|
||||
version = qualifyVersionIfNecessary(version)
|
||||
|
||||
ext.aspectjVersion = "1.8.3"
|
||||
ext.aspectjVersion = "1.8.4"
|
||||
ext.eclipseLinkVersion = "2.4.2"
|
||||
ext.ehcacheVersion = "2.9.0"
|
||||
ext.ehcacheJCacheVersion = "1.0.0"
|
||||
ext.groovyVersion = "2.3.7"
|
||||
ext.gsonVersion = "2.3"
|
||||
ext.groovyVersion = "1.8.9"
|
||||
ext.hibernate3Version = "3.6.10.Final"
|
||||
ext.hibernate4Version = "4.3.7.Final"
|
||||
ext.hibernate4Version = "4.2.16.Final"
|
||||
ext.hibVal4Version = "4.3.2.Final"
|
||||
ext.hibVal5Version = "5.1.3.Final"
|
||||
ext.hsqldbVersion = "2.3.2"
|
||||
ext.jackson2Version = "2.4.3"
|
||||
ext.jasperReportsVersion = "5.6.1"
|
||||
ext.jettyVersion = "9.2.4.v20141103"
|
||||
ext.jodaVersion = "2.5"
|
||||
ext.jackson1Version = "1.9.13"
|
||||
ext.jackson2Version = "2.3.4"
|
||||
ext.jasperReportsVersion = "5.5.1"
|
||||
ext.jettyVersion = "9.1.5.v20140505"
|
||||
ext.jodaVersion = "2.3"
|
||||
ext.junitVersion = "4.11"
|
||||
ext.nettyVersion = "4.0.24.Final"
|
||||
ext.openJpaVersion = "2.2.2" // 2.3.0 not Java 8 compatible (based on ASM 4)
|
||||
ext.protobufVersion = "2.6.1"
|
||||
ext.reactorVersion = "1.1.5.RELEASE"
|
||||
ext.slf4jVersion = "1.7.7"
|
||||
ext.snakeYamlVersion = "1.14"
|
||||
ext.snifferVersion = "1.11"
|
||||
ext.openJpaVersion = "2.2.2"
|
||||
ext.slf4jVersion = "1.7.9"
|
||||
ext.tiles2Version = "2.2.2"
|
||||
ext.tiles3Version = "3.0.5"
|
||||
ext.tomcatVersion = "8.0.15"
|
||||
ext.tyrusVersion = "1.3.5"
|
||||
ext.undertowVersion = "1.0.17.Final"
|
||||
ext.woodstoxVersion = "4.4.1"
|
||||
ext.xstreamVersion = "1.4.7"
|
||||
|
||||
ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
|
||||
@@ -65,11 +46,6 @@ configure(allprojects) { project ->
|
||||
apply plugin: "test-source-set-dependencies"
|
||||
apply from: "${gradleScriptDir}/ide.gradle"
|
||||
|
||||
configurations {
|
||||
sniffer
|
||||
javaApiSignature
|
||||
}
|
||||
|
||||
compileJava.options*.compilerArgs = [
|
||||
"-Xlint:serial", "-Xlint:varargs", "-Xlint:cast", "-Xlint:classfile",
|
||||
"-Xlint:dep-ann", "-Xlint:divzero", "-Xlint:empty", "-Xlint:finally",
|
||||
@@ -91,9 +67,8 @@ configure(allprojects) { project ->
|
||||
}
|
||||
|
||||
compileTestJava {
|
||||
sourceCompatibility=1.8
|
||||
targetCompatibility=1.8
|
||||
options.compilerArgs += "-parameters"
|
||||
sourceCompatibility=1.7
|
||||
targetCompatibility=1.7
|
||||
}
|
||||
|
||||
sourceSets.test.resources.srcDirs = ["src/test/resources", "src/test/java"]
|
||||
@@ -110,7 +85,7 @@ configure(allprojects) { project ->
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven { url "http://repo.spring.io/libs-release" }
|
||||
maven { url "https://repo.spring.io/libs-release" }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -121,70 +96,30 @@ configure(allprojects) { project ->
|
||||
exclude group:'org.hamcrest', module:'hamcrest-core'
|
||||
}
|
||||
testCompile("org.hamcrest:hamcrest-all:1.3")
|
||||
|
||||
sniffer("org.codehaus.mojo:animal-sniffer-ant-tasks:${snifferVersion}")
|
||||
javaApiSignature("org.codehaus.mojo.signature:java16:1.1@signature") // as from JDK 6 update 18
|
||||
}
|
||||
|
||||
task copyJavaApiSignature(type: Copy) {
|
||||
ext.to = file("$buildDir/javaApiSignature/")
|
||||
description "Copy the resolved Animal Sniffer signature dependency artifact to a known location and name"
|
||||
from configurations.javaApiSignature
|
||||
into to
|
||||
rename '.*signature', 'javaApi.signature'
|
||||
}
|
||||
|
||||
task sniff {
|
||||
group = "Verification"
|
||||
description = "Checks the Java API signatures"
|
||||
|
||||
dependsOn compileJava
|
||||
dependsOn copyJavaApiSignature
|
||||
|
||||
inputs.dir sourceSets.main.output.classesDir
|
||||
inputs.dir copyJavaApiSignature.to
|
||||
outputs.upToDateWhen { true }
|
||||
|
||||
doLast {
|
||||
ant.taskdef(
|
||||
name: 'animalSniffer',
|
||||
classname: 'org.codehaus.mojo.animal_sniffer.ant.CheckSignatureTask',
|
||||
classpath: configurations.sniffer.asPath
|
||||
)
|
||||
|
||||
ant.animalSniffer(
|
||||
signature: "$buildDir/javaApiSignature/javaApi.signature",
|
||||
classpath: sourceSets.main.compileClasspath.asPath) {
|
||||
path(path: sourceSets.main.output.classesDir)
|
||||
annotation(className: "org.springframework.lang.UsesJava7")
|
||||
annotation(className: "org.springframework.lang.UsesJava8")
|
||||
annotation(className: "org.springframework.lang.UsesSunHttpServer")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ext.javadocLinks = [
|
||||
"http://docs.oracle.com/javase/8/docs/api/",
|
||||
"http://docs.oracle.com/javaee/7/api/",
|
||||
"http://docs.oracle.com/cd/E13222_01/wls/docs90/javadocs/", // CommonJ
|
||||
"http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/topic/com.ibm.websphere.javadoc.doc/web/apidocs/",
|
||||
"http://glassfish.java.net/nonav/docs/v3/api/",
|
||||
"http://docs.jboss.org/jbossas/javadoc/4.0.5/connector/",
|
||||
"http://docs.jboss.org/jbossas/javadoc/7.1.2.Final/",
|
||||
"http://commons.apache.org/proper/commons-lang/javadocs/api-2.5/",
|
||||
"http://commons.apache.org/proper/commons-codec/apidocs/",
|
||||
"http://commons.apache.org/proper/commons-dbcp/apidocs/",
|
||||
"http://portals.apache.org/pluto/portlet-2.0-apidocs/",
|
||||
"http://tiles.apache.org/tiles-request/apidocs/",
|
||||
"http://tiles.apache.org/framework/apidocs/",
|
||||
"https://docs.oracle.com/javase/7/docs/api/",
|
||||
"https://docs.oracle.com/javaee/7/api/",
|
||||
"https://docs.oracle.com/cd/E13222_01/wls/docs90/javadocs/", // CommonJ
|
||||
"https://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/topic/com.ibm.websphere.javadoc.doc/web/apidocs/",
|
||||
"https://glassfish.java.net/nonav/docs/v3/api/",
|
||||
"https://docs.jboss.org/jbossas/javadoc/4.0.5/connector/",
|
||||
"https://docs.jboss.org/jbossas/javadoc/7.1.2.Final/",
|
||||
"https://commons.apache.org/proper/commons-lang/javadocs/api-2.5/",
|
||||
"https://commons.apache.org/proper/commons-codec/apidocs/",
|
||||
"https://commons.apache.org/proper/commons-dbcp/apidocs/",
|
||||
"https://portals.apache.org/pluto/portlet-2.0-apidocs/",
|
||||
"https://tiles.apache.org/tiles-request/apidocs/",
|
||||
"https://tiles.apache.org/framework/apidocs/",
|
||||
"http://aopalliance.sourceforge.net/doc/",
|
||||
"http://www.eclipse.org/aspectj/doc/released/aspectj5rt-api/",
|
||||
"http://ehcache.org/apidocs/",
|
||||
"http://quartz-scheduler.org/api/2.2.0/",
|
||||
"http://fasterxml.github.com/jackson-core/javadoc/2.3.0/",
|
||||
"http://fasterxml.github.com/jackson-databind/javadoc/2.3.0/",
|
||||
"http://fasterxml.github.io/jackson-dataformat-xml/javadoc/2.3.0/",
|
||||
"http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/"
|
||||
"https://www.eclipse.org/aspectj/doc/released/aspectj5rt-api/",
|
||||
"https://www.ehcache.org/apidocs/2.6.9/",
|
||||
"https://www.quartz-scheduler.org/api/2.2.2/",
|
||||
"https://jackson.codehaus.org/1.9.4/javadoc/",
|
||||
"https://fasterxml.github.io/jackson-core/javadoc/2.3.0/",
|
||||
"https://fasterxml.github.io/jackson-databind/javadoc/2.3.0/",
|
||||
"https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs"
|
||||
] as String[]
|
||||
}
|
||||
|
||||
@@ -192,20 +127,6 @@ configure(subprojects - project(":spring-build-src")) { subproject ->
|
||||
apply plugin: "merge"
|
||||
apply from: "${gradleScriptDir}/publish-maven.gradle"
|
||||
|
||||
configurations {
|
||||
jacoco
|
||||
}
|
||||
|
||||
dependencies {
|
||||
jacoco("org.jacoco:org.jacoco.agent:0.7.1.201405082137:runtime")
|
||||
}
|
||||
|
||||
gradle.taskGraph.whenReady {taskGraph ->
|
||||
if (taskGraph.hasTask(':sonarRunner')) {
|
||||
test.jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=org.springframework.*"
|
||||
}
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest.attributes["Created-By"] =
|
||||
"${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})"
|
||||
@@ -329,13 +250,11 @@ project("spring-core") {
|
||||
|
||||
compile(files(cglibRepackJar))
|
||||
compile("commons-logging:commons-logging:1.1.3")
|
||||
optional("commons-codec:commons-codec:1.9")
|
||||
optional("org.aspectj:aspectjweaver:${aspectjVersion}")
|
||||
optional("net.sf.jopt-simple:jopt-simple:4.6")
|
||||
optional("log4j:log4j:1.2.17")
|
||||
testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
|
||||
testCompile("xmlunit:xmlunit:1.5")
|
||||
testCompile("org.codehaus.woodstox:woodstox-core-asl:${woodstoxVersion}") {
|
||||
testCompile("org.codehaus.woodstox:wstx-asl:3.2.7") {
|
||||
exclude group: "stax", module: "stax-api"
|
||||
}
|
||||
}
|
||||
@@ -352,6 +271,12 @@ project("spring-core") {
|
||||
include "org/springframework/objenesis/**"
|
||||
}
|
||||
}
|
||||
|
||||
compileTestJava {
|
||||
sourceCompatibility=1.8
|
||||
targetCompatibility=1.8
|
||||
compileTestJava.options.compilerArgs += "-parameters"
|
||||
}
|
||||
}
|
||||
|
||||
project("spring-beans") {
|
||||
@@ -362,10 +287,8 @@ project("spring-beans") {
|
||||
compile(files(project(":spring-core").cglibRepackJar))
|
||||
optional("javax.inject:javax.inject:1")
|
||||
optional("javax.el:javax.el-api:2.2.5")
|
||||
optional("org.yaml:snakeyaml:${snakeYamlVersion}")
|
||||
testCompile("log4j:log4j:1.2.17")
|
||||
testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
project("spring-beans-groovy") {
|
||||
@@ -405,7 +328,7 @@ project("spring-aop") {
|
||||
compile("aopalliance:aopalliance:1.0")
|
||||
optional("org.aspectj:aspectjweaver:${aspectjVersion}")
|
||||
optional("commons-pool:commons-pool:1.6")
|
||||
optional("com.jamonapi:jamon:2.79")
|
||||
optional("com.jamonapi:jamon:2.4")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -460,7 +383,7 @@ project("spring-context") {
|
||||
optional("org.aspectj:aspectjweaver:${aspectjVersion}")
|
||||
optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
|
||||
optional("org.beanshell:bsh:2.0b4")
|
||||
optional("org.jruby:jruby:1.7.16")
|
||||
optional("org.jruby:jruby:1.7.17")
|
||||
testCompile("javax.inject:javax.inject-tck:1")
|
||||
testCompile("commons-dbcp:commons-dbcp:1.4")
|
||||
testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
|
||||
@@ -468,6 +391,10 @@ project("spring-context") {
|
||||
|
||||
// pick up RmiInvocationWrapperRTD.xml in src/main
|
||||
sourceSets.main.resources.srcDirs += "src/main/java"
|
||||
|
||||
test {
|
||||
jvmArgs = ["-disableassertions:org.aspectj.weaver.UnresolvedType"] // SPR-7989
|
||||
}
|
||||
}
|
||||
|
||||
project("spring-messaging") {
|
||||
@@ -477,10 +404,9 @@ project("spring-messaging") {
|
||||
compile(project(":spring-beans"))
|
||||
compile(project(":spring-core"))
|
||||
compile(project(":spring-context"))
|
||||
optional("org.projectreactor:reactor-core:${reactorVersion}")
|
||||
optional("org.projectreactor:reactor-net:${reactorVersion}") {
|
||||
exclude group: "io.netty", module: "netty-all"
|
||||
}
|
||||
optional("org.projectreactor:reactor-core:1.1.5.RELEASE")
|
||||
optional("org.projectreactor:reactor-net:1.1.5.RELEASE")
|
||||
optional("org.projectreactor:reactor-tcp:1.0.1.RELEASE")
|
||||
optional("org.eclipse.jetty.websocket:websocket-server:${jettyVersion}") {
|
||||
exclude group: "javax.servlet", module: "javax.servlet-api"
|
||||
}
|
||||
@@ -502,7 +428,6 @@ project("spring-messaging") {
|
||||
testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
|
||||
testCompile("org.apache.tomcat.embed:tomcat-embed-websocket:${tomcatVersion}")
|
||||
testCompile("org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}")
|
||||
testCompile("io.netty:netty-all:${nettyVersion}")
|
||||
testCompile("commons-dbcp:commons-dbcp:1.4")
|
||||
testCompile("log4j:log4j:1.2.17")
|
||||
testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
|
||||
@@ -516,7 +441,7 @@ project("spring-tx") {
|
||||
compile(project(":spring-beans"))
|
||||
compile(project(":spring-core"))
|
||||
optional(project(":spring-aop"))
|
||||
optional(project(":spring-context")) // for JCA, @EnableTransactionManagement
|
||||
optional(project(":spring-context")) // for JCA, @EnableTransactionManagement
|
||||
optional("aopalliance:aopalliance:1.0")
|
||||
optional("javax.transaction:javax.transaction-api:1.2")
|
||||
optional("javax.resource:connector-api:1.5")
|
||||
@@ -533,7 +458,7 @@ project("spring-oxm") {
|
||||
|
||||
compileTestJava {
|
||||
// necessary to avoid java.lang.VerifyError on jibx compilation
|
||||
// see http://jira.codehaus.org/browse/JIBX-465
|
||||
// see https://jira.codehaus.org/browse/JIBX-465
|
||||
sourceCompatibility=1.6
|
||||
targetCompatibility=1.6
|
||||
}
|
||||
@@ -573,13 +498,13 @@ project("spring-jms") {
|
||||
compile(project(":spring-beans"))
|
||||
compile(project(":spring-aop"))
|
||||
compile(project(":spring-context"))
|
||||
compile(project(":spring-messaging"))
|
||||
compile(project(":spring-tx"))
|
||||
provided("javax.jms:jms-api:1.1-rev-1")
|
||||
optional(project(":spring-oxm"))
|
||||
optional("aopalliance:aopalliance:1.0")
|
||||
optional("javax.transaction:javax.transaction-api:1.2")
|
||||
optional("javax.resource:connector-api:1.5")
|
||||
optional("org.codehaus.jackson:jackson-mapper-asl:${jackson1Version}")
|
||||
optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
|
||||
}
|
||||
}
|
||||
@@ -591,13 +516,13 @@ project("spring-jdbc") {
|
||||
compile(project(":spring-beans"))
|
||||
compile(project(":spring-core"))
|
||||
compile(project(":spring-tx"))
|
||||
optional(project(":spring-context")) // for JndiDataSourceLookup
|
||||
optional(project(":spring-context")) // for JndiDataSourceLookup
|
||||
optional("javax.transaction:javax.transaction-api:1.2")
|
||||
optional("com.mchange:c3p0:0.9.2.1")
|
||||
optional("org.hsqldb:hsqldb:${hsqldbVersion}")
|
||||
optional("com.h2database:h2:1.4.181")
|
||||
optional("org.apache.derby:derby:10.11.1.1")
|
||||
optional("org.apache.derby:derbyclient:10.11.1.1")
|
||||
optional("com.h2database:h2:1.3.176")
|
||||
optional("org.apache.derby:derby:10.10.2.0")
|
||||
optional("org.apache.derby:derbyclient:10.10.2.0")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -608,79 +533,56 @@ project("spring-context-support") {
|
||||
compile(project(":spring-core"))
|
||||
compile(project(":spring-beans"))
|
||||
compile(project(":spring-context"))
|
||||
optional(project(":spring-jdbc")) // for Quartz support
|
||||
optional(project(":spring-tx")) // for Quartz support
|
||||
optional("javax.mail:javax.mail-api:1.5.2")
|
||||
optional(project(":spring-jdbc")) // for Quartz support
|
||||
optional(project(":spring-tx")) // for Quartz support
|
||||
optional("javax.mail:javax.mail-api:1.4.7")
|
||||
optional("javax.cache:cache-api:1.0.0")
|
||||
optional("com.google.guava:guava:18.0")
|
||||
optional("net.sf.ehcache:ehcache:${ehcacheVersion}")
|
||||
optional("org.quartz-scheduler:quartz:2.2.1")
|
||||
optional("com.google.guava:guava:17.0")
|
||||
optional("net.sf.ehcache:ehcache-core:2.6.7")
|
||||
optional("org.quartz-scheduler:quartz:1.8.6") {
|
||||
exclude group: "org.slf4j", module: "slf4j-log4j12"
|
||||
}
|
||||
optional("org.codehaus.fabric3.api:commonj:1.1.0")
|
||||
optional("org.apache.velocity:velocity:1.7")
|
||||
optional("org.freemarker:freemarker:2.3.21")
|
||||
optional("org.freemarker:freemarker:2.3.20")
|
||||
optional("com.lowagie:itext:2.1.7")
|
||||
optional("net.sf.jasperreports:jasperreports:$jasperReportsVersion") {
|
||||
exclude group: "com.fasterxml.jackson.core", module: "jackson-annotations"
|
||||
exclude group: "com.fasterxml.jackson.core", module: "jackson-core"
|
||||
exclude group: "com.fasterxml.jackson.core", module: "jackson-databind"
|
||||
exclude group: "org.olap4j", module: "olap4j"
|
||||
exclude group: "xml-apis", module: "xml-apis"
|
||||
}
|
||||
testCompile(project(":spring-context"))
|
||||
testCompile("org.apache.poi:poi:3.10.1")
|
||||
testCompile("commons-beanutils:commons-beanutils:1.8.0") // for Velocity/JasperReports
|
||||
testCompile("commons-digester:commons-digester:1.8.1") // for Velocity/JasperReports
|
||||
testCompile("commons-beanutils:commons-beanutils:1.8.0") // for Velocity/JasperReports
|
||||
testCompile("commons-digester:commons-digester:1.8.1") // for Velocity/JasperReports
|
||||
testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
|
||||
testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
|
||||
testCompile("org.ehcache:jcache:${ehcacheJCacheVersion}")
|
||||
testRuntime("com.sun.mail:javax.mail:1.5.2")
|
||||
testRuntime("com.sun.mail:javax.mail:1.4.7")
|
||||
}
|
||||
|
||||
// pick up **/mime.types files in src/main
|
||||
// pick up **/*.types files in src/main
|
||||
sourceSets.main.resources.srcDirs += "src/main/java"
|
||||
}
|
||||
|
||||
project("spring-web") {
|
||||
description = "Spring Web"
|
||||
apply plugin: "groovy"
|
||||
|
||||
// Re-generate Protobuf classes from *.proto files and move them in test sources
|
||||
if (project.hasProperty('genProtobuf')) {
|
||||
apply plugin: 'protobuf'
|
||||
|
||||
task updateGenProtobuf(type:Copy, dependsOn: ":spring-web:generateTestProto") {
|
||||
from "${project.buildDir}/generated-sources/test/"
|
||||
into "${projectDir}/src/test/java"
|
||||
doLast {
|
||||
project.delete "${project.buildDir}/generated-sources/test"
|
||||
}
|
||||
}
|
||||
|
||||
tasks.getByPath("compileTestJava").dependsOn "updateGenProtobuf"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile(project(":spring-aop")) // for JaxWsPortProxyFactoryBean
|
||||
compile(project(":spring-beans")) // for MultiPartFilter
|
||||
compile(project(":spring-aop")) // for JaxWsPortProxyFactoryBean
|
||||
compile(project(":spring-beans")) // for MultipartFilter
|
||||
compile(project(":spring-context"))
|
||||
compile(project(":spring-core"))
|
||||
provided("javax.servlet:javax.servlet-api:3.0.1")
|
||||
optional(project(":spring-oxm")) // for MarshallingHttpMessageConverter
|
||||
optional(project(":spring-oxm")) // for MarshallingHttpMessageConverter
|
||||
optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
|
||||
optional("javax.portlet:portlet-api:2.0")
|
||||
optional("javax.el:javax.el-api:2.2.5")
|
||||
optional("javax.faces:javax.faces-api:2.2")
|
||||
optional("aopalliance:aopalliance:1.0")
|
||||
optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
|
||||
optional("com.caucho:hessian:4.0.38")
|
||||
optional("com.caucho:hessian:4.0.7")
|
||||
optional("commons-fileupload:commons-fileupload:1.3.1")
|
||||
optional("org.apache.httpcomponents:httpclient:4.3.5")
|
||||
optional("org.apache.httpcomponents:httpclient:4.3.6")
|
||||
optional("org.apache.httpcomponents:httpasyncclient:4.0.2")
|
||||
optional("io.netty:netty-all:${nettyVersion}")
|
||||
optional("org.codehaus.jackson:jackson-mapper-asl:${jackson1Version}")
|
||||
optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
|
||||
optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson2Version}")
|
||||
optional("com.google.code.gson:gson:${gsonVersion}")
|
||||
optional("com.rometools:rome:1.5.0")
|
||||
optional("rome:rome:1.0")
|
||||
optional("org.eclipse.jetty:jetty-servlet:${jettyVersion}") {
|
||||
exclude group: "javax.servlet", module: "javax.servlet-api"
|
||||
}
|
||||
@@ -688,16 +590,12 @@ project("spring-web") {
|
||||
exclude group: "javax.servlet", module: "javax.servlet-api"
|
||||
}
|
||||
optional("log4j:log4j:1.2.17")
|
||||
optional("com.googlecode.protobuf-java-format:protobuf-java-format:1.2")
|
||||
optional("com.google.protobuf:protobuf-java:${protobufVersion}")
|
||||
optional("javax.mail:javax.mail-api:1.5.2")
|
||||
testCompile(project(":spring-context-support")) // for JafMediaTypeFactory
|
||||
testCompile("xmlunit:xmlunit:1.5")
|
||||
testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
|
||||
testCompile("org.apache.taglibs:taglibs-standard-jstlel:1.2.1") {
|
||||
exclude group: "org.apache.taglibs", module: "taglibs-standard-spec"
|
||||
}
|
||||
testRuntime("com.sun.mail:javax.mail:1.5.2")
|
||||
}
|
||||
|
||||
// pick up ContextLoader.properties in src/main
|
||||
@@ -719,10 +617,8 @@ project("spring-websocket") {
|
||||
exclude group: "org.apache.tomcat", module: "tomcat-websocket-api"
|
||||
exclude group: "org.apache.tomcat", module: "tomcat-servlet-api"
|
||||
}
|
||||
optional("org.glassfish.tyrus:tyrus-spi:${tyrusVersion}")
|
||||
optional("org.glassfish.tyrus:tyrus-core:${tyrusVersion}")
|
||||
optional("org.glassfish.tyrus:tyrus-server:${tyrusVersion}")
|
||||
optional("org.glassfish.tyrus:tyrus-container-servlet:${tyrusVersion}")
|
||||
optional("org.glassfish.tyrus:tyrus-websocket-core:1.2.1")
|
||||
optional("org.glassfish.tyrus:tyrus-container-servlet:1.2.1")
|
||||
optional("org.eclipse.jetty:jetty-webapp:${jettyVersion}") {
|
||||
exclude group: "javax.servlet", module: "javax.servlet"
|
||||
}
|
||||
@@ -730,21 +626,20 @@ project("spring-websocket") {
|
||||
exclude group: "javax.servlet", module: "javax.servlet"
|
||||
}
|
||||
optional("org.eclipse.jetty.websocket:websocket-client:${jettyVersion}")
|
||||
optional("org.eclipse.jetty:jetty-client:${jettyVersion}")
|
||||
optional("io.undertow:undertow-core:${undertowVersion}")
|
||||
optional("io.undertow:undertow-servlet:${undertowVersion}") {
|
||||
optional("io.undertow:undertow-core:1.0.1.Final")
|
||||
optional("io.undertow:undertow-servlet:1.0.1.Final") {
|
||||
exclude group: "org.jboss.spec.javax.servlet", module: "jboss-servlet-api_3.1_spec"
|
||||
exclude group: "org.jboss.spec.javax.annotation", module: "jboss-annotations-api_1.2_spec"
|
||||
}
|
||||
optional("io.undertow:undertow-websockets-jsr:${undertowVersion}") {
|
||||
optional("io.undertow:undertow-websockets-jsr:1.0.1.Final") {
|
||||
exclude group: "org.jboss.spec.javax.websocket", module: "jboss-websocket-api_1.0_spec"
|
||||
}
|
||||
optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
|
||||
testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
|
||||
testCompile("org.apache.tomcat.embed:tomcat-embed-websocket:${tomcatVersion}")
|
||||
testCompile("org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}")
|
||||
testCompile("org.projectreactor:reactor-core:${reactorVersion}")
|
||||
testCompile("org.projectreactor:reactor-net:${reactorVersion}")
|
||||
testCompile("org.projectreactor:reactor-core:1.1.4.RELEASE")
|
||||
testCompile("org.projectreactor:reactor-net:1.1.4.RELEASE")
|
||||
testCompile("log4j:log4j:1.2.17")
|
||||
testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
|
||||
}
|
||||
@@ -785,7 +680,6 @@ project("spring-orm") {
|
||||
}
|
||||
optional("javax.servlet:javax.servlet-api:3.0.1")
|
||||
testCompile("commons-dbcp:commons-dbcp:1.4")
|
||||
testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
|
||||
testCompile("org.hsqldb:hsqldb:${hsqldbVersion}")
|
||||
testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
|
||||
}
|
||||
@@ -802,11 +696,7 @@ project("spring-orm-hibernate4") {
|
||||
optional("org.hibernate:hibernate-core:${hibernate4Version}")
|
||||
optional("org.hibernate:hibernate-entitymanager:${hibernate4Version}")
|
||||
optional("javax.servlet:javax.servlet-api:3.0.1")
|
||||
optional("aopalliance:aopalliance:1.0")
|
||||
testCompile("javax.validation:validation-api:1.1.0.GA")
|
||||
testCompile("org.hibernate:hibernate-validator:${hibVal5Version}")
|
||||
testCompile("javax.el:javax.el-api:2.2.5")
|
||||
testCompile("org.glassfish.web:javax.el:2.2.6")
|
||||
optional("aopalliance:aopalliance:1.0")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -821,8 +711,8 @@ project("spring-webmvc") {
|
||||
compile(project(":spring-expression"))
|
||||
compile(project(":spring-web"))
|
||||
provided("javax.servlet:javax.servlet-api:3.0.1")
|
||||
optional(project(":spring-context-support")) // for Velocity support
|
||||
optional(project(":spring-oxm")) // for MarshallingView
|
||||
optional(project(":spring-context-support")) // for Velocity support
|
||||
optional(project(":spring-oxm")) // for MarshallingView
|
||||
optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
|
||||
optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
|
||||
optional("net.sourceforge.jexcelapi:jxl:2.6.12")
|
||||
@@ -830,34 +720,29 @@ project("spring-webmvc") {
|
||||
optional("org.apache.velocity:velocity:1.7")
|
||||
optional("velocity-tools:velocity-tools-view:1.4")
|
||||
optional("org.freemarker:freemarker:2.3.20")
|
||||
optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
|
||||
optional("com.lowagie:itext:2.1.7")
|
||||
optional("net.sf.jasperreports:jasperreports:$jasperReportsVersion") {
|
||||
exclude group: "com.fasterxml.jackson.core", module: "jackson-annotations"
|
||||
exclude group: "com.fasterxml.jackson.core", module: "jackson-core"
|
||||
exclude group: "com.fasterxml.jackson.core", module: "jackson-databind"
|
||||
exclude group: "org.olap4j", module: "olap4j"
|
||||
exclude group: "xml-apis", module: "xml-apis"
|
||||
}
|
||||
optional("org.codehaus.jackson:jackson-mapper-asl:${jackson1Version}")
|
||||
optional("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
|
||||
optional("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${jackson2Version}")
|
||||
optional("com.rometools:rome:1.5.0")
|
||||
optional("javax.el:javax.el-api:2.2.5")
|
||||
optional("org.apache.tiles:tiles-api:${tiles3Version}")
|
||||
optional("org.apache.tiles:tiles-core:${tiles3Version}") {
|
||||
optional("rome:rome:1.0")
|
||||
optional("org.apache.tiles:tiles-api:${tiles2Version}")
|
||||
optional("org.apache.tiles:tiles-core:${tiles2Version}") {
|
||||
exclude group: "org.slf4j", module: "jcl-over-slf4j"
|
||||
}
|
||||
optional("org.apache.tiles:tiles-servlet:${tiles3Version}") {
|
||||
optional("org.apache.tiles:tiles-servlet:${tiles2Version}") {
|
||||
exclude group: "org.slf4j", module: "jcl-over-slf4j"
|
||||
}
|
||||
optional("org.apache.tiles:tiles-jsp:${tiles3Version}") {
|
||||
optional("org.apache.tiles:tiles-jsp:${tiles2Version}") {
|
||||
exclude group: "org.slf4j", module: "jcl-over-slf4j"
|
||||
}
|
||||
optional("org.apache.tiles:tiles-el:${tiles3Version}") {
|
||||
optional("org.apache.tiles:tiles-el:${tiles2Version}") {
|
||||
exclude group: "org.slf4j", module: "jcl-over-slf4j"
|
||||
}
|
||||
optional("org.apache.tiles:tiles-extras:${tiles3Version}") {
|
||||
optional("org.apache.tiles:tiles-extras:${tiles2Version}") {
|
||||
exclude group: "org.slf4j", module: "jcl-over-slf4j"
|
||||
exclude group: "org.apache.velocity", module: "velocity-tools"
|
||||
exclude group: "org.springframework", module: "spring-web"
|
||||
}
|
||||
testCompile(project(":spring-aop"))
|
||||
@@ -879,7 +764,7 @@ project("spring-webmvc") {
|
||||
}
|
||||
testCompile("javax.validation:validation-api:1.0.0.GA")
|
||||
testCompile("org.hibernate:hibernate-validator:${hibVal4Version}")
|
||||
testCompile("org.apache.httpcomponents:httpclient:4.3.5")
|
||||
testCompile("org.apache.httpcomponents:httpclient:4.3.6")
|
||||
testCompile("commons-fileupload:commons-fileupload:1.3.1")
|
||||
testCompile("commons-io:commons-io:1.3")
|
||||
testCompile("joda-time:joda-time:${jodaVersion}")
|
||||
@@ -890,8 +775,8 @@ project("spring-webmvc") {
|
||||
sourceSets.main.resources.srcDirs += "src/main/java"
|
||||
}
|
||||
|
||||
project("spring-webmvc-tiles2") {
|
||||
description = "Spring Framework Tiles2 Integration"
|
||||
project("spring-webmvc-tiles3") {
|
||||
description = "Spring Framework Tiles3 Integration"
|
||||
merge.into = project(":spring-webmvc")
|
||||
|
||||
dependencies {
|
||||
@@ -900,22 +785,22 @@ project("spring-webmvc-tiles2") {
|
||||
provided("javax.servlet:javax.servlet-api:3.0.1")
|
||||
optional("javax.servlet.jsp:javax.servlet.jsp-api:2.2.1")
|
||||
optional("javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:1.2.1")
|
||||
optional("org.apache.tiles:tiles-api:${tiles2Version}")
|
||||
optional("org.apache.tiles:tiles-core:${tiles2Version}") {
|
||||
optional("javax.el:javax.el-api:2.2.5")
|
||||
optional("org.apache.tiles:tiles-api:${tiles3Version}")
|
||||
optional("org.apache.tiles:tiles-core:${tiles3Version}") {
|
||||
exclude group: "org.slf4j", module: "jcl-over-slf4j"
|
||||
}
|
||||
optional("org.apache.tiles:tiles-servlet:${tiles2Version}") {
|
||||
optional("org.apache.tiles:tiles-servlet:${tiles3Version}") {
|
||||
exclude group: "org.slf4j", module: "jcl-over-slf4j"
|
||||
}
|
||||
optional("org.apache.tiles:tiles-jsp:${tiles2Version}") {
|
||||
optional("org.apache.tiles:tiles-jsp:${tiles3Version}") {
|
||||
exclude group: "org.slf4j", module: "jcl-over-slf4j"
|
||||
}
|
||||
optional("org.apache.tiles:tiles-el:${tiles2Version}") {
|
||||
optional("org.apache.tiles:tiles-el:${tiles3Version}") {
|
||||
exclude group: "org.slf4j", module: "jcl-over-slf4j"
|
||||
}
|
||||
optional("org.apache.tiles:tiles-extras:${tiles2Version}") {
|
||||
optional("org.apache.tiles:tiles-extras:${tiles3Version}") {
|
||||
exclude group: "org.slf4j", module: "jcl-over-slf4j"
|
||||
exclude group: "org.apache.velocity", module: "velocity-tools"
|
||||
exclude group: "org.springframework", module: "spring-web"
|
||||
}
|
||||
testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
|
||||
@@ -964,22 +849,25 @@ project("spring-test") {
|
||||
}
|
||||
optional("javax.portlet:portlet-api:2.0")
|
||||
optional("javax.el:javax.el-api:2.2.5")
|
||||
optional("org.eclipse.persistence:javax.persistence:2.0.0")
|
||||
optional("org.aspectj:aspectjweaver:${aspectjVersion}")
|
||||
optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
|
||||
optional("org.hamcrest:hamcrest-core:1.3")
|
||||
optional("com.jayway.jsonpath:json-path:1.1.0")
|
||||
optional("org.skyscreamer:jsonassert:1.2.3")
|
||||
optional("com.jayway.jsonpath:json-path:0.9.1")
|
||||
optional("xmlunit:xmlunit:1.5")
|
||||
testCompile(project(":spring-context-support"))
|
||||
testCompile(project(":spring-oxm"))
|
||||
testCompile("javax.mail:javax.mail-api:1.5.2")
|
||||
testCompile(project(":spring-webmvc-tiles3"))
|
||||
testCompile("javax.mail:javax.mail-api:1.4.7")
|
||||
testCompile("javax.ejb:ejb-api:3.0")
|
||||
testCompile("org.hibernate:hibernate-core:${hibernate4Version}")
|
||||
testCompile("org.hibernate:hibernate-entitymanager:${hibernate4Version}")
|
||||
testCompile("org.hibernate:hibernate-validator:${hibVal5Version}")
|
||||
testCompile("org.hibernate:hibernate-core:${hibernate3Version}") {
|
||||
exclude group: 'org.hibernate.javax.persistence', module: 'hibernate-jpa-2.0-api'
|
||||
}
|
||||
testCompile("org.hibernate:hibernate-entitymanager:${hibernate3Version}")
|
||||
testCompile("org.hibernate:hibernate-validator:${hibVal4Version}")
|
||||
testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
|
||||
testCompile("org.codehaus.jackson:jackson-mapper-asl:${jackson1Version}")
|
||||
testCompile("com.fasterxml.jackson.core:jackson-databind:${jackson2Version}")
|
||||
testCompile("com.rometools:rome:1.5.0")
|
||||
testCompile("rome:rome:1.0")
|
||||
testCompile("org.apache.tiles:tiles-api:${tiles3Version}")
|
||||
testCompile("org.apache.tiles:tiles-core:${tiles3Version}") {
|
||||
exclude group: "org.slf4j", module: "jcl-over-slf4j"
|
||||
@@ -1027,16 +915,15 @@ project("spring-aspects") {
|
||||
rt("org.aspectj:aspectjrt:${aspectjVersion}")
|
||||
compile("org.aspectj:aspectjweaver:${aspectjVersion}")
|
||||
provided("org.eclipse.persistence:javax.persistence:2.0.0")
|
||||
optional(project(":spring-aop")) // for @Async support
|
||||
optional(project(":spring-beans")) // for @Configurable support
|
||||
optional(project(":spring-context")) // for @Enable* support
|
||||
optional(project(":spring-context-support")) // for JavaMail and JSR-107 support
|
||||
optional(project(":spring-orm")) // for JPA exception translation support
|
||||
optional(project(":spring-tx")) // for JPA, @Transactional support
|
||||
optional("javax.cache:cache-api:1.0.0")
|
||||
testCompile(project(":spring-core")) // for CodeStyleAspect
|
||||
optional(project(":spring-aop")) // for @Async support
|
||||
optional(project(":spring-beans")) // for @Configurable support
|
||||
optional(project(":spring-context")) // for @Enable* support
|
||||
optional(project(":spring-context-support")) // for JavaMail support
|
||||
optional(project(":spring-orm")) // for JPA exception translation support
|
||||
optional(project(":spring-tx")) // for JPA, @Transactional support
|
||||
testCompile(project(":spring-core")) // for CodeStyleAspect
|
||||
testCompile(project(":spring-test"))
|
||||
testCompile("javax.mail:javax.mail-api:1.5.2")
|
||||
testCompile("javax.mail:javax.mail-api:1.4.7")
|
||||
}
|
||||
|
||||
eclipse.project {
|
||||
@@ -1081,22 +968,6 @@ project("spring-framework-bom") {
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'sonar-runner'
|
||||
|
||||
sonarRunner {
|
||||
sonarProperties {
|
||||
property "sonar.projectName", "Spring Framework"
|
||||
property "sonar.profile", "Spring Framework"
|
||||
property "sonar.jacoco.reportPath", "${buildDir.name}/jacoco.exec"
|
||||
property "sonar.links.homepage", linkHomepage
|
||||
property "sonar.links.ci", linkCi
|
||||
property "sonar.links.issue", linkIssue
|
||||
property "sonar.links.scm", linkScmUrl
|
||||
property "sonar.links.scm_dev", linkScmDevConnection
|
||||
property "sonar.java.coveragePlugin", "jacoco"
|
||||
}
|
||||
}
|
||||
|
||||
configure(rootProject) {
|
||||
description = "Spring Framework"
|
||||
|
||||
@@ -1124,7 +995,6 @@ configure(rootProject) {
|
||||
reference {
|
||||
sourceDir = asciidoctor.outputDir
|
||||
pdfFilename = "spring-framework-reference.pdf"
|
||||
epubFilename = "spring-framework-reference.epub"
|
||||
expandPlaceholders = ""
|
||||
}
|
||||
|
||||
@@ -1206,7 +1076,7 @@ configure(rootProject) {
|
||||
baseName = "spring-framework"
|
||||
classifier = "docs"
|
||||
description = "Builds -${classifier} archive containing api and reference " +
|
||||
"for deployment at http://static.springframework.org/spring-framework/docs."
|
||||
"for deployment at https://docs.spring.io/spring-framework/docs."
|
||||
|
||||
from("src/dist") {
|
||||
include "changelog.txt"
|
||||
@@ -1226,7 +1096,7 @@ configure(rootProject) {
|
||||
baseName = "spring-framework"
|
||||
classifier = "schema"
|
||||
description = "Builds -${classifier} archive containing all " +
|
||||
"XSDs for deployment at http://springframework.org/schema."
|
||||
"XSDs for deployment at https://springframework.org/schema."
|
||||
duplicatesStrategy 'exclude'
|
||||
moduleProjects.each { subproject ->
|
||||
def Properties schemas = new Properties();
|
||||
@@ -1343,21 +1213,6 @@ configure(rootProject) {
|
||||
|
||||
}
|
||||
|
||||
configure([project(':spring-build-src'), project(':spring-framework-bom')]) {
|
||||
sonarRunner {
|
||||
skipProject = true
|
||||
}
|
||||
}
|
||||
|
||||
configure(project(':spring-core')) {
|
||||
sonarRunner {
|
||||
sonarProperties {
|
||||
property "sonar.exclusions",
|
||||
"src/main/java/org/springframework/cglib/**/*,src/main/java/org/springframework/asm/**/*"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Support publication of artifacts versioned by topic branch.
|
||||
* CI builds supply `-P BRANCH_NAME=<TOPIC>` to gradle at build time.
|
||||
|
||||
@@ -68,8 +68,8 @@ class MergePlugin implements Plugin<Project> {
|
||||
Configuration runtimeMerge = project.configurations.create("runtimeMerge")
|
||||
|
||||
// Ensure the IDE can reference merged projects
|
||||
project.eclipse.classpath.plusConfigurations += [ runtimeMerge ]
|
||||
project.idea.module.scopes.PROVIDED.plus += [ runtimeMerge ]
|
||||
project.eclipse.classpath.plusConfigurations += [runtimeMerge]
|
||||
project.idea.module.scopes.PROVIDED.plus += runtimeMerge
|
||||
|
||||
// Hook to perform the actual merge logic
|
||||
project.afterEvaluate{
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
version=4.1.2.RELEASE
|
||||
version=4.0.10.BUILD-SNAPSHOT
|
||||
|
||||
+5
-4
@@ -5,19 +5,19 @@ import org.gradle.plugins.ide.eclipse.model.SourceFolder
|
||||
apply plugin: "propdeps-eclipse"
|
||||
apply plugin: "propdeps-idea"
|
||||
|
||||
// Until eclipse fully supports Java 8 use 1.7 source level
|
||||
eclipse.jdt {
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
sourceCompatibility = 1.7
|
||||
targetCompatibility = 1.7
|
||||
}
|
||||
|
||||
// Replace classpath entries with project dependencies (GRADLE-1116)
|
||||
// http://issues.gradle.org/browse/GRADLE-1116
|
||||
eclipse.classpath.file.whenMerged { classpath ->
|
||||
def regexp = /.*?\/([^\/]+)\/build\/[^\/]+\/(?:main|test)/ // only match those that end in main or test (avoids removing necessary entries like build/classes/jaxb)
|
||||
def projectOutputDependencies = classpath.entries.findAll { entry -> entry.path =~ regexp }
|
||||
projectOutputDependencies.each { entry ->
|
||||
def matcher = (entry.path =~ regexp)
|
||||
if (matcher) {
|
||||
if(matcher) {
|
||||
def projectName = matcher[0][1]
|
||||
def path = "/${projectName}"
|
||||
if(!classpath.entries.find { e -> e instanceof ProjectDependency && e.path == path }) {
|
||||
@@ -61,6 +61,7 @@ eclipse.classpath.file.whenMerged { classpath ->
|
||||
// Allow projects to be used as WPT modules
|
||||
eclipse.project.natures "org.eclipse.wst.common.project.facet.core.nature"
|
||||
|
||||
|
||||
// Include project specific settings
|
||||
task eclipseSettings(type: Copy) {
|
||||
from rootProject.files(
|
||||
|
||||
@@ -25,12 +25,12 @@ def customizePom(pom, gradleProject) {
|
||||
url = "https://github.com/spring-projects/spring-framework"
|
||||
organization {
|
||||
name = "Spring IO"
|
||||
url = "http://projects.spring.io/spring-framework"
|
||||
url = "https://projects.spring.io/spring-framework"
|
||||
}
|
||||
licenses {
|
||||
license {
|
||||
name "The Apache Software License, Version 2.0"
|
||||
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
|
||||
url "https://www.apache.org/licenses/LICENSE-2.0.txt"
|
||||
distribution "repo"
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ def customizePom(pom, gradleProject) {
|
||||
developer {
|
||||
id = "jhoeller"
|
||||
name = "Juergen Hoeller"
|
||||
email = "jhoeller@pivotal.io"
|
||||
email = "jhoeller@gopivotal.com"
|
||||
}
|
||||
}
|
||||
issueManagement {
|
||||
|
||||
+1
-1
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-1.12-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-1.12-bin.zip
|
||||
|
||||
@@ -17,7 +17,7 @@ echo been tested against STS %STS_TEST_VERSION%), but at the minimum you will
|
||||
echo need Eclipse + AJDT.
|
||||
echo.
|
||||
echo If you need to download and install STS, please do that now by
|
||||
echo visiting http://spring.io/tools/sts/all
|
||||
echo visiting https://spring.io/tools/sts/all
|
||||
echo.
|
||||
echo Otherwise, press enter and we'll begin.
|
||||
|
||||
|
||||
+35
-51
@@ -1,38 +1,22 @@
|
||||
STS_TEST_VERSION='2.9.2.RELEASE'
|
||||
|
||||
cd `dirname $0`
|
||||
clear
|
||||
cat <<EOM
|
||||
|
||||
------------------------------------------------------------------------
|
||||
Spring Framework - Eclipse/STS Project Import Guide
|
||||
-----------------------------------------------------------------------
|
||||
Spring Framework Eclipse/STS project import guide
|
||||
|
||||
This script will guide you through the process of importing the Spring
|
||||
Framework projects into Eclipse or the Spring Tool Suite (STS). It is
|
||||
recommended that you have a recent version of Eclipse or STS. As a bare
|
||||
minimum you will need Eclipse with full Java 8 support, AJDT, and the
|
||||
Groovy Compiler.
|
||||
This script will guide you through the process of importing the
|
||||
Spring Framework sources into Eclipse/STS. It is recommended that you
|
||||
have a recent version of the SpringSource Tool Suite (this script has
|
||||
been tested against STS $STS_TEST_VERSION), but at the minimum you will
|
||||
need Eclipse + AJDT.
|
||||
|
||||
This script has been tested against:
|
||||
If you need to download and install STS, please do that now by
|
||||
visiting https://spring.io/tools/sts/all
|
||||
|
||||
- Eclipse: integration build I20140528-2000 (Luna 4.4)
|
||||
- STS: nightly build 3.6.0.CI-B1890632 (Luna 4.4)
|
||||
- AJDT: CI build AJDT-AE44-66 (Luna 4.4)
|
||||
|
||||
If you need to download and install Eclipse or STS, please do that now
|
||||
by visiting one of the following sites:
|
||||
|
||||
- Eclipse downloads: http://download.eclipse.org/eclipse/downloads/
|
||||
- STS downloads: http://spring.io/tools/sts/all
|
||||
- STS nightly builds: http://dist.springsource.com/snapshot/STS/nightly-distributions.html
|
||||
|
||||
If you need to install a recent CI build for AJDT (i.e., so that the
|
||||
spring-aspects module properly compiles in Eclipse/STS), click on the
|
||||
"Artifacts" tab of a successful CI build and copy the link to the
|
||||
"update site" which you can then use to install or update AJDT within
|
||||
Eclipse/STS.
|
||||
|
||||
- AJDT CI builds: https://build.spring.io/browse/AJDT-AE44
|
||||
|
||||
Once Eclipse/STS is installed, press enter, and we'll begin.
|
||||
Otherwise, press enter and we'll begin.
|
||||
EOM
|
||||
|
||||
read
|
||||
@@ -47,14 +31,14 @@ COMMAND="./gradlew cleanEclipse :spring-oxm:compileTestJava eclipse -x :eclipse"
|
||||
|
||||
cat <<EOM
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-----------------------------------------------------------------------
|
||||
STEP 1: Generate subproject Eclipse metadata
|
||||
|
||||
The first step will be to generate Eclipse project metadata for each of
|
||||
the spring-* subprojects. This happens via the built-in "Gradle wrapper"
|
||||
script (./gradlew in this directory). If this is your first time using
|
||||
the Gradle wrapper, this step may take a few minutes while a Gradle
|
||||
distribution is downloaded for you.
|
||||
The first step will be to generate Eclipse project metadata for each
|
||||
of the spring-* subprojects. This happens via the built-in
|
||||
"Gradle wrapper" script (./gradlew in this directory). If this is your
|
||||
first time using the Gradle wrapper, this step may take a few minutes
|
||||
while a Gradle distribution is downloaded for you.
|
||||
|
||||
The command run will be:
|
||||
|
||||
@@ -69,16 +53,16 @@ $COMMAND || exit
|
||||
|
||||
cat <<EOM
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-----------------------------------------------------------------------
|
||||
STEP 2: Import subprojects into Eclipse/STS
|
||||
|
||||
Within Eclipse/STS, do the following:
|
||||
|
||||
- File > Import... > Existing Projects into Workspace
|
||||
- When prompted for the 'root directory', provide $PWD.
|
||||
- Press enter. You will see the modules show up under "Projects".
|
||||
- All projects should be selected/checked. Click Finish.
|
||||
- When the project import is complete, you should have no errors.
|
||||
File > Import... > Existing Projects into Workspace
|
||||
> When prompted for the 'root directory', provide $PWD
|
||||
> Press enter. You will see the modules show up under "Projects"
|
||||
> All projects should be selected/checked. Click Finish.
|
||||
> When the project import is complete, you should have no errors.
|
||||
|
||||
When the above is complete, return here and press the enter key.
|
||||
EOM
|
||||
@@ -89,13 +73,13 @@ COMMAND="./gradlew :eclipse"
|
||||
|
||||
cat <<EOM
|
||||
|
||||
------------------------------------------------------------------------
|
||||
STEP 3: Generate root project Eclipse metadata
|
||||
-----------------------------------------------------------------------
|
||||
STEP 3: generate root project Eclipse metadata
|
||||
|
||||
Unfortunately, Eclipse does not support importing project hierarchies,
|
||||
so we had to skip root project metadata generation during step 1. In
|
||||
this step we simply generate root project metadata so that you can
|
||||
import it in the next step.
|
||||
Unfortunately, Eclipse does not allow for importing project
|
||||
hierarchies, so we had to skip root project metadata generation in the
|
||||
during step 1. In this step we simply generate root project metadata
|
||||
so you can import it in the next step.
|
||||
|
||||
The command run will be:
|
||||
|
||||
@@ -109,7 +93,7 @@ read
|
||||
$COMMAND || exit
|
||||
|
||||
cat <<EOM
|
||||
------------------------------------------------------------------------
|
||||
-----------------------------------------------------------------------
|
||||
STEP 4: Import root project into Eclipse/STS
|
||||
|
||||
Follow the project import steps listed in step 2 above to import the
|
||||
@@ -121,14 +105,14 @@ EOM
|
||||
read
|
||||
|
||||
cat <<EOM
|
||||
------------------------------------------------------------------------
|
||||
-----------------------------------------------------------------------
|
||||
STEP 5: Enable Git support for all projects
|
||||
|
||||
- In the Eclipse/STS Package Explorer, select all spring* projects.
|
||||
- Right-click to open the context menu and select Team > Share Project...
|
||||
- In the Share Project dialog that appears, select Git and press Next.
|
||||
- Check "Use or create repository in parent folder of project".
|
||||
- Click Finish.
|
||||
- In the Share Project dialog that appears, select Git and press Next
|
||||
- Check "Use or create repository in parent folder of project"
|
||||
- Click Finish
|
||||
|
||||
When complete, you'll have Git support enabled for all projects.
|
||||
|
||||
|
||||
+7
-7
@@ -1,21 +1,21 @@
|
||||
The following has been tested against Intellij IDEA 13.1
|
||||
The following has been tested against Intellij IDEA 12.0
|
||||
|
||||
## Steps
|
||||
|
||||
_Within your locally cloned spring-framework working directory:_
|
||||
|
||||
1. Pre-compile `spring-oxm` with `./gradlew cleanIdea :spring-oxm:compileTestJava`
|
||||
2. Import into IDEA (File->import project->import from external model->Gradle)
|
||||
3. Set the Project JDK as appropriate (1.8+)
|
||||
4. Exclude the `spring-aspects` module (Go to File->Project Structure->Modules)
|
||||
1. Generate IDEA metadata with `./gradlew :spring-oxm:compileTestJava cleanIdea idea`
|
||||
2. Import into IDEA as usual
|
||||
3. Set the Project JDK as appropriate
|
||||
4. Add git support
|
||||
5. Code away
|
||||
|
||||
## Known issues
|
||||
|
||||
1. `spring-oxm` should be pre-compiled since it's using repackaged dependencies (see *RepackJar tasks)
|
||||
1. Those steps don't work currently for Intellij IDEA 13+
|
||||
2. `spring-aspects` does not compile out of the box due to references to aspect types unknown to IDEA.
|
||||
See http://youtrack.jetbrains.com/issue/IDEA-64446 for details. In the meantime, the 'spring-aspects'
|
||||
should be excluded from the overall project to avoid compilation errors.
|
||||
module has been excluded from the overall project to avoid compilation errors.
|
||||
3. While all JUnit tests pass from the command line with Gradle, many will fail when run from IDEA.
|
||||
Resolving this is a work in progress. If attempting to run all JUnit tests from within IDEA, you will
|
||||
likely need to set the following VM options to avoid out of memory errors:
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ include "spring-tx"
|
||||
include "spring-web"
|
||||
include "spring-webmvc"
|
||||
include "spring-webmvc-portlet"
|
||||
include "spring-webmvc-tiles2"
|
||||
include "spring-webmvc-tiles3"
|
||||
include "spring-websocket"
|
||||
include "spring-framework-bom"
|
||||
|
||||
|
||||
-1
@@ -28,7 +28,6 @@ import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.weaver.tools.PointcutParser;
|
||||
import org.aspectj.weaver.tools.PointcutPrimitive;
|
||||
|
||||
import org.springframework.core.ParameterNameDiscoverer;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ import org.springframework.util.ReflectionUtils;
|
||||
* migrate to {@code ShadowMatch.getVariablesInvolvedInRuntimeTest()}
|
||||
* or some similar operation.
|
||||
*
|
||||
* <p>See <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=151593"/>Bug 151593</a>
|
||||
* <p>See <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=151593"/>.
|
||||
*
|
||||
* @author Adrian Colyer
|
||||
* @author Ramnivas Laddad
|
||||
|
||||
-1
@@ -37,7 +37,6 @@ import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.aspectj.lang.reflect.AjType;
|
||||
import org.aspectj.lang.reflect.AjTypeSystem;
|
||||
import org.aspectj.lang.reflect.PerClauseKind;
|
||||
|
||||
import org.springframework.aop.aspectj.AspectJExpressionPointcut;
|
||||
import org.springframework.aop.framework.AopConfigException;
|
||||
import org.springframework.core.ParameterNameDiscoverer;
|
||||
|
||||
+7
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,7 +19,8 @@ package org.springframework.aop.aspectj.annotation;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.annotation.OrderUtils;
|
||||
import org.springframework.core.annotation.AnnotationUtils;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
/**
|
||||
@@ -109,7 +110,10 @@ public class BeanFactoryAspectInstanceFactory implements MetadataAwareAspectInst
|
||||
if (Ordered.class.isAssignableFrom(type) && this.beanFactory.isSingleton(this.name)) {
|
||||
return ((Ordered) this.beanFactory.getBean(this.name)).getOrder();
|
||||
}
|
||||
return OrderUtils.getOrder(type, Ordered.LOWEST_PRECEDENCE);
|
||||
Order order = AnnotationUtils.findAnnotation(type, Order.class);
|
||||
if (order != null) {
|
||||
return order.value();
|
||||
}
|
||||
}
|
||||
return Ordered.LOWEST_PRECEDENCE;
|
||||
}
|
||||
|
||||
+15
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,7 +18,8 @@ package org.springframework.aop.aspectj.annotation;
|
||||
|
||||
import org.springframework.aop.aspectj.SimpleAspectInstanceFactory;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.annotation.OrderUtils;
|
||||
import org.springframework.core.annotation.AnnotationUtils;
|
||||
import org.springframework.core.annotation.Order;
|
||||
|
||||
/**
|
||||
* Implementation of {@link MetadataAwareAspectInstanceFactory} that
|
||||
@@ -50,9 +51,20 @@ public class SimpleMetadataAwareAspectInstanceFactory extends SimpleAspectInstan
|
||||
return this.metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine a fallback order for the case that the aspect instance
|
||||
* does not express an instance-specific order through implementing
|
||||
* the {@link org.springframework.core.Ordered} interface.
|
||||
* <p>The default implementation simply returns {@code Ordered.LOWEST_PRECEDENCE}.
|
||||
* @param aspectClass the aspect class
|
||||
*/
|
||||
@Override
|
||||
protected int getOrderForAspectClass(Class<?> aspectClass) {
|
||||
return OrderUtils.getOrder(aspectClass, Ordered.LOWEST_PRECEDENCE);
|
||||
Order order = AnnotationUtils.findAnnotation(aspectClass, Order.class);
|
||||
if (order != null) {
|
||||
return order.value();
|
||||
}
|
||||
return Ordered.LOWEST_PRECEDENCE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+14
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,7 +18,8 @@ package org.springframework.aop.aspectj.annotation;
|
||||
|
||||
import org.springframework.aop.aspectj.SingletonAspectInstanceFactory;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.annotation.OrderUtils;
|
||||
import org.springframework.core.annotation.AnnotationUtils;
|
||||
import org.springframework.core.annotation.Order;
|
||||
|
||||
/**
|
||||
* Implementation of {@link MetadataAwareAspectInstanceFactory} that is backed
|
||||
@@ -52,9 +53,19 @@ public class SingletonMetadataAwareAspectInstanceFactory extends SingletonAspect
|
||||
return this.metadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether the aspect class carries an
|
||||
* {@link org.springframework.core.annotation.Order} annotation,
|
||||
* falling back to {@code Ordered.LOWEST_PRECEDENCE}.
|
||||
* @see org.springframework.core.annotation.Order
|
||||
*/
|
||||
@Override
|
||||
protected int getOrderForAspectClass(Class<?> aspectClass) {
|
||||
return OrderUtils.getOrder(aspectClass, Ordered.LOWEST_PRECEDENCE);
|
||||
Order order = AnnotationUtils.findAnnotation(aspectClass, Order.class);
|
||||
if (order != null) {
|
||||
return order.value();
|
||||
}
|
||||
return Ordered.LOWEST_PRECEDENCE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
|
||||
/**
|
||||
*
|
||||
* Classes enabling AspectJ 5 @Annotated classes to be used in Spring AOP.
|
||||
*
|
||||
* <p>Normally to be used through an AspectJAutoProxyCreator rather than directly.
|
||||
*
|
||||
*/
|
||||
package org.springframework.aop.aspectj.annotation;
|
||||
|
||||
|
||||
+10
-11
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -29,13 +29,15 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* <p>Given two pieces of advice, {@code a} and {@code b}:
|
||||
* <ul>
|
||||
* <li>if {@code a} and {@code b} are defined in different aspects, then the advice
|
||||
* in the aspect with the lowest order value has the highest precedence</li>
|
||||
* <li>if {@code a} and {@code b} are defined in the same aspect, then if one of
|
||||
* {@code a} or {@code b} is a form of after advice, then the advice declared last
|
||||
* in the aspect has the highest precedence. If neither {@code a} nor {@code b} is
|
||||
* a form of after advice, then the advice declared first in the aspect has the
|
||||
* highest precedence.</li>
|
||||
* <li>if {@code a} and {@code b} are defined in different
|
||||
* aspects, then the advice in the aspect with the lowest order
|
||||
* value has the highest precedence</li>
|
||||
* <li>if {@code a} and {@code b} are defined in the same
|
||||
* aspect, then if one of {@code a} or {@code b} is a form of
|
||||
* after advice, then the advice declared last in the aspect has the
|
||||
* highest precedence. If neither {@code a} nor {@code b} is a
|
||||
* form of after advice, then the advice declared first in the aspect has
|
||||
* the highest precedence.</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>Important: Note that unlike a normal comparator a return of 0 means
|
||||
@@ -49,12 +51,9 @@ import org.springframework.util.Assert;
|
||||
class AspectJPrecedenceComparator implements Comparator<Advisor> {
|
||||
|
||||
private static final int HIGHER_PRECEDENCE = -1;
|
||||
|
||||
private static final int SAME_PRECEDENCE = 0;
|
||||
|
||||
private static final int LOWER_PRECEDENCE = 1;
|
||||
|
||||
|
||||
private final Comparator<? super Advisor> advisorComparator;
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
|
||||
/**
|
||||
*
|
||||
* Base classes enabling auto-proxying based on AspectJ.
|
||||
* Support for AspectJ annotation aspects resides in the "aspectj.annotation" package.
|
||||
*
|
||||
*/
|
||||
package org.springframework.aop.aspectj.autoproxy;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/**
|
||||
*
|
||||
* AspectJ integration package. Includes Spring AOP advice implementations for AspectJ 5
|
||||
* annotation-style methods, and an AspectJExpressionPointcut: a Spring AOP Pointcut
|
||||
* implementation that allows use of the AspectJ pointcut expression language with the Spring AOP
|
||||
@@ -7,5 +8,7 @@
|
||||
* <p>Note that use of this package does <i>not</i> require the use of the {@code ajc} compiler
|
||||
* or AspectJ load-time weaver. It is intended to enable the use of a valuable subset of AspectJ
|
||||
* functionality, with consistent semantics, with the proxy-based Spring AOP framework.
|
||||
*
|
||||
*/
|
||||
package org.springframework.aop.aspectj;
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
|
||||
/**
|
||||
*
|
||||
* Support package for declarative AOP configuration,
|
||||
* with XML schema being the primary configuration format.
|
||||
*
|
||||
*/
|
||||
package org.springframework.aop.config;
|
||||
|
||||
|
||||
+30
-7
@@ -21,7 +21,10 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.springframework.aop.Advisor;
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.beans.factory.BeanClassLoaderAware;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
/**
|
||||
* Base class for {@link BeanPostProcessor} implementations that apply a
|
||||
@@ -31,12 +34,21 @@ import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
* @since 3.2
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class AbstractAdvisingBeanPostProcessor extends ProxyProcessorSupport implements BeanPostProcessor {
|
||||
public abstract class AbstractAdvisingBeanPostProcessor extends ProxyConfig
|
||||
implements BeanPostProcessor, BeanClassLoaderAware, Ordered {
|
||||
|
||||
protected Advisor advisor;
|
||||
|
||||
protected boolean beforeExistingAdvisors = false;
|
||||
|
||||
private ClassLoader beanClassLoader = ClassUtils.getDefaultClassLoader();
|
||||
|
||||
/**
|
||||
* This should run after all other post-processors, so that it can just add
|
||||
* an advisor to existing proxies rather than double-proxy.
|
||||
*/
|
||||
private int order = Ordered.LOWEST_PRECEDENCE;
|
||||
|
||||
private final Map<Class<?>, Boolean> eligibleBeans = new ConcurrentHashMap<Class<?>, Boolean>(64);
|
||||
|
||||
|
||||
@@ -53,6 +65,20 @@ public abstract class AbstractAdvisingBeanPostProcessor extends ProxyProcessorSu
|
||||
this.beforeExistingAdvisors = beforeExistingAdvisors;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader beanClassLoader) {
|
||||
this.beanClassLoader = beanClassLoader;
|
||||
}
|
||||
|
||||
public void setOrder(int order) {
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return this.order;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object postProcessBeforeInitialization(Object bean, String beanName) {
|
||||
@@ -81,14 +107,11 @@ public abstract class AbstractAdvisingBeanPostProcessor extends ProxyProcessorSu
|
||||
}
|
||||
|
||||
if (isEligible(bean, beanName)) {
|
||||
ProxyFactory proxyFactory = new ProxyFactory();
|
||||
ProxyFactory proxyFactory = new ProxyFactory(bean);
|
||||
// Copy our properties (proxyTargetClass etc) inherited from ProxyConfig.
|
||||
proxyFactory.copyFrom(this);
|
||||
proxyFactory.setTarget(bean);
|
||||
if (!proxyFactory.isProxyTargetClass()) {
|
||||
evaluateProxyInterfaces(bean.getClass(), proxyFactory);
|
||||
}
|
||||
proxyFactory.addAdvisor(this.advisor);
|
||||
return proxyFactory.getProxy(getProxyClassLoader());
|
||||
return proxyFactory.getProxy(this.beanClassLoader);
|
||||
}
|
||||
|
||||
// No async proxy needed.
|
||||
|
||||
@@ -172,7 +172,7 @@ class CglibAopProxy implements AopProxy, Serializable {
|
||||
}
|
||||
|
||||
// Validate the class, writing log messages as necessary.
|
||||
validateClassIfNecessary(proxySuperClass, classLoader);
|
||||
validateClassIfNecessary(proxySuperClass);
|
||||
|
||||
// Configure CGLIB Enhancer...
|
||||
Enhancer enhancer = createEnhancer();
|
||||
@@ -239,11 +239,11 @@ class CglibAopProxy implements AopProxy, Serializable {
|
||||
* Checks to see whether the supplied {@code Class} has already been validated and
|
||||
* validates it if not.
|
||||
*/
|
||||
private void validateClassIfNecessary(Class<?> proxySuperClass, ClassLoader proxyClassLoader) {
|
||||
if (logger.isInfoEnabled()) {
|
||||
private void validateClassIfNecessary(Class<?> proxySuperClass) {
|
||||
if (logger.isWarnEnabled()) {
|
||||
synchronized (validatedClasses) {
|
||||
if (!validatedClasses.containsKey(proxySuperClass)) {
|
||||
doValidateClass(proxySuperClass, proxyClassLoader);
|
||||
doValidateClass(proxySuperClass);
|
||||
validatedClasses.put(proxySuperClass, Boolean.TRUE);
|
||||
}
|
||||
}
|
||||
@@ -251,28 +251,19 @@ class CglibAopProxy implements AopProxy, Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for final methods on the given {@code Class}, as well as package-visible
|
||||
* methods across ClassLoaders, and writes warnings to the log for each one found.
|
||||
* Checks for final methods on the {@code Class} and writes warnings to the log
|
||||
* for each one found.
|
||||
*/
|
||||
private void doValidateClass(Class<?> proxySuperClass, ClassLoader proxyClassLoader) {
|
||||
if (!Object.class.equals(proxySuperClass)) {
|
||||
Method[] methods = proxySuperClass.getDeclaredMethods();
|
||||
private void doValidateClass(Class<?> proxySuperClass) {
|
||||
if (logger.isWarnEnabled()) {
|
||||
Method[] methods = proxySuperClass.getMethods();
|
||||
for (Method method : methods) {
|
||||
int mod = method.getModifiers();
|
||||
if (!Modifier.isStatic(mod)) {
|
||||
if (Modifier.isFinal(mod)) {
|
||||
logger.info("Unable to proxy method [" + method + "] because it is final: " +
|
||||
"All calls to this method via a proxy will NOT be routed to the target instance.");
|
||||
}
|
||||
else if (!Modifier.isPublic(mod) && !Modifier.isProtected(mod) && !Modifier.isPrivate(mod) &&
|
||||
proxyClassLoader != null && proxySuperClass.getClassLoader() != proxyClassLoader) {
|
||||
logger.info("Unable to proxy method [" + method + "] because it is package-visible " +
|
||||
"across different ClassLoaders: All calls to this method via a proxy will " +
|
||||
"NOT be routed to the target instance.");
|
||||
}
|
||||
if (!Object.class.equals(method.getDeclaringClass()) && !Modifier.isStatic(method.getModifiers()) &&
|
||||
Modifier.isFinal(method.getModifiers())) {
|
||||
logger.warn("Unable to proxy method [" + method + "] because it is final: " +
|
||||
"All calls to this method via a proxy will NOT be routed to the target instance.");
|
||||
}
|
||||
}
|
||||
doValidateClass(proxySuperClass.getSuperclass(), proxyClassLoader);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-8
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -21,18 +21,21 @@ import java.io.Serializable;
|
||||
import org.springframework.aop.SpringProxy;
|
||||
|
||||
/**
|
||||
* Default {@link AopProxyFactory} implementation, creating either a CGLIB proxy
|
||||
* or a JDK dynamic proxy.
|
||||
* Default {@link AopProxyFactory} implementation,
|
||||
* creating either a CGLIB proxy or a JDK dynamic proxy.
|
||||
*
|
||||
* <p>Creates a CGLIB proxy if one the following is true for a given
|
||||
* {@link AdvisedSupport} instance:
|
||||
* <p>Creates a CGLIB proxy if one the following is true
|
||||
* for a given {@link AdvisedSupport} instance:
|
||||
* <ul>
|
||||
* <li>the {@code optimize} flag is set
|
||||
* <li>the {@code proxyTargetClass} flag is set
|
||||
* <li>the "optimize" flag is set
|
||||
* <li>the "proxyTargetClass" flag is set
|
||||
* <li>no proxy interfaces have been specified
|
||||
* </ul>
|
||||
*
|
||||
* <p>In general, specify {@code proxyTargetClass} to enforce a CGLIB proxy,
|
||||
* <p>Note that the CGLIB library classes have to be present on
|
||||
* the class path if an actual CGLIB proxy needs to be created.
|
||||
*
|
||||
* <p>In general, specify "proxyTargetClass" to enforce a CGLIB proxy,
|
||||
* or specify one or more interfaces to use a JDK dynamic proxy.
|
||||
*
|
||||
* @author Rod Johnson
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
|
||||
-145
@@ -1,145 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.aop.framework;
|
||||
|
||||
import org.springframework.beans.factory.Aware;
|
||||
import org.springframework.beans.factory.BeanClassLoaderAware;
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
* Base class with common functionality for proxy processors, in particular
|
||||
* ClassLoader management and the {@link #evaluateProxyInterfaces} algorithm.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 4.1
|
||||
* @see AbstractAdvisingBeanPostProcessor
|
||||
* @see org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ProxyProcessorSupport extends ProxyConfig implements Ordered, BeanClassLoaderAware, AopInfrastructureBean {
|
||||
|
||||
/**
|
||||
* This should run after all other processors, so that it can just add
|
||||
* an advisor to existing proxies rather than double-proxy.
|
||||
*/
|
||||
private int order = Ordered.LOWEST_PRECEDENCE;
|
||||
|
||||
private ClassLoader proxyClassLoader = ClassUtils.getDefaultClassLoader();
|
||||
|
||||
private boolean classLoaderConfigured = false;
|
||||
|
||||
|
||||
/**
|
||||
* Set the ordering which will apply to this class's implementation
|
||||
* of Ordered, used when applying multiple processors.
|
||||
* <p>Default value is {@code Integer.MAX_VALUE}, meaning that it's non-ordered.
|
||||
* @param order the ordering value
|
||||
*/
|
||||
public void setOrder(int order) {
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return this.order;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the ClassLoader to generate the proxy class in.
|
||||
* <p>Default is the bean ClassLoader, i.e. the ClassLoader used by the containing
|
||||
* {@link org.springframework.beans.factory.BeanFactory} for loading all bean classes.
|
||||
* This can be overridden here for specific proxies.
|
||||
*/
|
||||
public void setProxyClassLoader(ClassLoader classLoader) {
|
||||
this.proxyClassLoader = classLoader;
|
||||
this.classLoaderConfigured = (classLoader != null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the configured proxy ClassLoader for this processor.
|
||||
*/
|
||||
protected ClassLoader getProxyClassLoader() {
|
||||
return this.proxyClassLoader;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader classLoader) {
|
||||
if (!this.classLoaderConfigured) {
|
||||
this.proxyClassLoader = classLoader;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check the interfaces on the given bean class and apply them to the {@link ProxyFactory},
|
||||
* if appropriate.
|
||||
* <p>Calls {@link #isConfigurationCallbackInterface} and {@link #isInternalLanguageInterface}
|
||||
* to filter for reasonable proxy interfaces, falling back to a target-class proxy otherwise.
|
||||
* @param beanClass the class of the bean
|
||||
* @param proxyFactory the ProxyFactory for the bean
|
||||
*/
|
||||
protected void evaluateProxyInterfaces(Class<?> beanClass, ProxyFactory proxyFactory) {
|
||||
Class<?>[] targetInterfaces = ClassUtils.getAllInterfacesForClass(beanClass, getProxyClassLoader());
|
||||
boolean hasReasonableProxyInterface = false;
|
||||
for (Class<?> ifc : targetInterfaces) {
|
||||
if (!isConfigurationCallbackInterface(ifc) && !isInternalLanguageInterface(ifc) &&
|
||||
ifc.getMethods().length > 0) {
|
||||
hasReasonableProxyInterface = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (hasReasonableProxyInterface) {
|
||||
// Must allow for introductions; can't just set interfaces to the target's interfaces only.
|
||||
for (Class<?> ifc : targetInterfaces) {
|
||||
proxyFactory.addInterface(ifc);
|
||||
}
|
||||
}
|
||||
else {
|
||||
proxyFactory.setProxyTargetClass(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the given interface is just a container callback and
|
||||
* therefore not to be considered as a reasonable proxy interface.
|
||||
* <p>If no reasonable proxy interface is found for a given bean, it will get
|
||||
* proxied with its full target class, assuming that as the user's intention.
|
||||
* @param ifc the interface to check
|
||||
* @return whether the given interface is just a container callback
|
||||
*/
|
||||
protected boolean isConfigurationCallbackInterface(Class<?> ifc) {
|
||||
return (ifc.equals(InitializingBean.class) || ifc.equals(DisposableBean.class) ||
|
||||
ObjectUtils.containsElement(ifc.getInterfaces(), Aware.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the given interface is a well-known internal language interface
|
||||
* and therefore not to be considered as a reasonable proxy interface.
|
||||
* <p>If no reasonable proxy interface is found for a given bean, it will get
|
||||
* proxied with its full target class, assuming that as the user's intention.
|
||||
* @param ifc the interface to check
|
||||
* @return whether the given interface is an internal language interface
|
||||
*/
|
||||
protected boolean isInternalLanguageInterface(Class<?> ifc) {
|
||||
return ifc.getName().equals("groovy.lang.GroovyObject");
|
||||
}
|
||||
|
||||
}
|
||||
+12
-6
@@ -1,12 +1,18 @@
|
||||
|
||||
/**
|
||||
*
|
||||
* SPI package allowing Spring AOP framework to handle arbitrary advice types.
|
||||
*
|
||||
* <p>Users who want merely to <i>use</i> the Spring AOP framework, rather than extend
|
||||
* <br>
|
||||
* Users who want merely to <i>use</i> the Spring AOP framework, rather than extend
|
||||
* its capabilities, don't need to concern themselves with this package.
|
||||
* <br>
|
||||
* You may wish to use these adapters to wrap Spring-specific advices, such as MethodBeforeAdvice,
|
||||
* in MethodInterceptor, to allow their use in another AOP framework supporting the AOP Alliance interfaces.
|
||||
* </br>
|
||||
* <br>
|
||||
* These adapters do not depend on any other Spring framework classes to allow such usage.
|
||||
* </br>
|
||||
*
|
||||
* <p>You may wish to use these adapters to wrap Spring-specific advices, such as MethodBeforeAdvice,
|
||||
* in MethodInterceptor, to allow their use in another AOP framework supporting the AOP Alliance interfaces.
|
||||
*
|
||||
* <p>These adapters do not depend on any other Spring framework classes to allow such usage.
|
||||
*/
|
||||
package org.springframework.aop.framework.adapter;
|
||||
|
||||
|
||||
+94
-4
@@ -33,18 +33,25 @@ import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.aop.Advisor;
|
||||
import org.springframework.aop.TargetSource;
|
||||
import org.springframework.aop.framework.AopInfrastructureBean;
|
||||
import org.springframework.aop.framework.ProxyConfig;
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.aop.framework.ProxyProcessorSupport;
|
||||
import org.springframework.aop.framework.adapter.AdvisorAdapterRegistry;
|
||||
import org.springframework.aop.framework.adapter.GlobalAdvisorAdapterRegistry;
|
||||
import org.springframework.aop.target.SingletonTargetSource;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.PropertyValues;
|
||||
import org.springframework.beans.factory.Aware;
|
||||
import org.springframework.beans.factory.BeanClassLoaderAware;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.BeanFactoryAware;
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
* {@link org.springframework.beans.factory.config.BeanPostProcessor} implementation
|
||||
@@ -87,8 +94,9 @@ import org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostP
|
||||
* @see DefaultAdvisorAutoProxyCreator
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport
|
||||
implements SmartInstantiationAwareBeanPostProcessor, BeanFactoryAware {
|
||||
public abstract class AbstractAutoProxyCreator extends ProxyConfig
|
||||
implements SmartInstantiationAwareBeanPostProcessor, BeanClassLoaderAware, BeanFactoryAware,
|
||||
Ordered, AopInfrastructureBean {
|
||||
|
||||
/**
|
||||
* Convenience constant for subclasses: Return value for "do not proxy".
|
||||
@@ -107,6 +115,9 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport
|
||||
/** Logger available to subclasses */
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
/** Default value is same as non-ordered */
|
||||
private int order = Ordered.LOWEST_PRECEDENCE;
|
||||
|
||||
/** Default is global AdvisorAdapterRegistry */
|
||||
private AdvisorAdapterRegistry advisorAdapterRegistry = GlobalAdvisorAdapterRegistry.getInstance();
|
||||
|
||||
@@ -123,6 +134,10 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport
|
||||
|
||||
private TargetSourceCreator[] customTargetSourceCreators;
|
||||
|
||||
private ClassLoader proxyClassLoader = ClassUtils.getDefaultClassLoader();
|
||||
|
||||
private boolean classLoaderConfigured = false;
|
||||
|
||||
private BeanFactory beanFactory;
|
||||
|
||||
private final Map<Object, Boolean> advisedBeans = new ConcurrentHashMap<Object, Boolean>(64);
|
||||
@@ -136,6 +151,21 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport
|
||||
private final Map<Object, Class<?>> proxyTypes = new ConcurrentHashMap<Object, Class<?>>(16);
|
||||
|
||||
|
||||
/**
|
||||
* Set the ordering which will apply to this class's implementation
|
||||
* of Ordered, used when applying multiple BeanPostProcessors.
|
||||
* <p>Default value is {@code Integer.MAX_VALUE}, meaning that it's non-ordered.
|
||||
* @param order ordering value
|
||||
*/
|
||||
public final void setOrder(int order) {
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getOrder() {
|
||||
return this.order;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether or not the proxy should be frozen, preventing advice
|
||||
* from being added to it once it is created.
|
||||
@@ -198,6 +228,24 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport
|
||||
this.applyCommonInterceptorsFirst = applyCommonInterceptorsFirst;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the ClassLoader to generate the proxy class in.
|
||||
* <p>Default is the bean ClassLoader, i.e. the ClassLoader used by the
|
||||
* containing BeanFactory for loading all bean classes. This can be
|
||||
* overridden here for specific proxies.
|
||||
*/
|
||||
public void setProxyClassLoader(ClassLoader classLoader) {
|
||||
this.proxyClassLoader = classLoader;
|
||||
this.classLoaderConfigured = (classLoader != null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader classLoader) {
|
||||
if (!this.classLoaderConfigured) {
|
||||
this.proxyClassLoader = classLoader;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) {
|
||||
this.beanFactory = beanFactory;
|
||||
@@ -420,6 +468,7 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport
|
||||
Class<?> beanClass, String beanName, Object[] specificInterceptors, TargetSource targetSource) {
|
||||
|
||||
ProxyFactory proxyFactory = new ProxyFactory();
|
||||
// Copy our properties (proxyTargetClass etc) inherited from ProxyConfig.
|
||||
proxyFactory.copyFrom(this);
|
||||
|
||||
if (!proxyFactory.isProxyTargetClass()) {
|
||||
@@ -444,7 +493,7 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport
|
||||
proxyFactory.setPreFiltered(true);
|
||||
}
|
||||
|
||||
return proxyFactory.getProxy(getProxyClassLoader());
|
||||
return proxyFactory.getProxy(this.proxyClassLoader);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -461,6 +510,47 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport
|
||||
AutoProxyUtils.shouldProxyTargetClass((ConfigurableListableBeanFactory) this.beanFactory, beanName));
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the interfaces on the given bean class and apply them to the ProxyFactory,
|
||||
* if appropriate.
|
||||
* <p>Calls {@link #isConfigurationCallbackInterface} to filter for reasonable
|
||||
* proxy interfaces, falling back to a target-class proxy otherwise.
|
||||
* @param beanClass the class of the bean
|
||||
* @param proxyFactory the ProxyFactory for the bean
|
||||
*/
|
||||
private void evaluateProxyInterfaces(Class<?> beanClass, ProxyFactory proxyFactory) {
|
||||
Class<?>[] targetInterfaces = ClassUtils.getAllInterfacesForClass(beanClass, this.proxyClassLoader);
|
||||
boolean hasReasonableProxyInterface = false;
|
||||
for (Class<?> ifc : targetInterfaces) {
|
||||
if (!isConfigurationCallbackInterface(ifc) && ifc.getMethods().length > 0) {
|
||||
hasReasonableProxyInterface = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (hasReasonableProxyInterface) {
|
||||
// Must allow for introductions; can't just set interfaces to the target's interfaces only.
|
||||
for (Class<?> ifc : targetInterfaces) {
|
||||
proxyFactory.addInterface(ifc);
|
||||
}
|
||||
}
|
||||
else {
|
||||
proxyFactory.setProxyTargetClass(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the given interface is just a container callback and
|
||||
* therefore not to be considered as a reasonable proxy interface.
|
||||
* <p>If no reasonable proxy interface is found for a given bean, it will get
|
||||
* proxied with its full target class, assuming that as the user's intention.
|
||||
* @param ifc the interface to check
|
||||
* @return whether the given interface is just a container callback
|
||||
*/
|
||||
protected boolean isConfigurationCallbackInterface(Class<?> ifc) {
|
||||
return (ifc.equals(InitializingBean.class) || ifc.equals(DisposableBean.class) ||
|
||||
ObjectUtils.containsElement(ifc.getInterfaces(), Aware.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether the Advisors returned by the subclass are pre-filtered
|
||||
* to match the bean's target class already, allowing the ClassFilter check
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
|
||||
/**
|
||||
*
|
||||
* Bean post-processors for use in ApplicationContexts to simplify AOP usage
|
||||
* by automatically creating AOP proxies without the need to use a ProxyFactoryBean.
|
||||
*
|
||||
@@ -8,5 +10,7 @@
|
||||
* <p><b>NB</b>: Automatic auto-proxying is not supported for BeanFactory implementations,
|
||||
* as post-processors beans are only automatically detected in application contexts.
|
||||
* Post-processors can be explicitly registered on a ConfigurableBeanFactory instead.
|
||||
*
|
||||
*/
|
||||
package org.springframework.aop.framework.autoproxy;
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
|
||||
/**
|
||||
*
|
||||
* Package containing Spring's basic AOP infrastructure, compliant with the
|
||||
* <a href="http://aopalliance.sourceforge.net">AOP Alliance</a> interfaces.
|
||||
*
|
||||
@@ -11,5 +13,7 @@
|
||||
* <p>The ProxyFactoryBean is a convenient way to create AOP proxies in a BeanFactory
|
||||
* or ApplicationContext. However, proxies can be created programmatically using the
|
||||
* ProxyFactory class.
|
||||
*
|
||||
*/
|
||||
package org.springframework.aop.framework;
|
||||
|
||||
|
||||
+4
-62
@@ -20,24 +20,18 @@ import java.lang.reflect.Method;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.BeanFactoryAware;
|
||||
import org.springframework.beans.factory.annotation.BeanFactoryAnnotationUtils;
|
||||
import org.springframework.core.task.AsyncListenableTaskExecutor;
|
||||
import org.springframework.core.task.AsyncTaskExecutor;
|
||||
import org.springframework.core.task.support.TaskExecutorAdapter;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Base class for asynchronous method execution aspects, such as
|
||||
* {@code org.springframework.scheduling.annotation.AnnotationAsyncExecutionInterceptor}
|
||||
* {@link org.springframework.scheduling.annotation.AnnotationAsyncExecutionInterceptor}
|
||||
* or {@code org.springframework.scheduling.aspectj.AnnotationAsyncExecutionAspect}.
|
||||
*
|
||||
* <p>Provides support for <i>executor qualification</i> on a method-by-method basis.
|
||||
@@ -46,20 +40,14 @@ import org.springframework.util.StringUtils;
|
||||
* bean to be used when executing it, e.g. through an annotation attribute.
|
||||
*
|
||||
* @author Chris Beams
|
||||
* @author Juergen Hoeller
|
||||
* @author Stephane Nicoll
|
||||
* @since 3.1.2
|
||||
*/
|
||||
public abstract class AsyncExecutionAspectSupport implements BeanFactoryAware {
|
||||
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private final Map<Method, AsyncTaskExecutor> executors = new ConcurrentHashMap<Method, AsyncTaskExecutor>(16);
|
||||
|
||||
private Executor defaultExecutor;
|
||||
|
||||
private AsyncUncaughtExceptionHandler exceptionHandler;
|
||||
|
||||
private BeanFactory beanFactory;
|
||||
|
||||
|
||||
@@ -68,18 +56,9 @@ public abstract class AsyncExecutionAspectSupport implements BeanFactoryAware {
|
||||
* executor unless individual async methods indicate via qualifier that a more
|
||||
* specific executor should be used.
|
||||
* @param defaultExecutor the executor to use when executing asynchronous methods
|
||||
* @param exceptionHandler the {@link AsyncUncaughtExceptionHandler} to use
|
||||
*/
|
||||
public AsyncExecutionAspectSupport(Executor defaultExecutor, AsyncUncaughtExceptionHandler exceptionHandler) {
|
||||
this.defaultExecutor = defaultExecutor;
|
||||
this.exceptionHandler = exceptionHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new instance with a default {@link AsyncUncaughtExceptionHandler}.
|
||||
*/
|
||||
public AsyncExecutionAspectSupport(Executor defaultExecutor) {
|
||||
this(defaultExecutor, new SimpleAsyncUncaughtExceptionHandler());
|
||||
this.defaultExecutor = defaultExecutor;
|
||||
}
|
||||
|
||||
|
||||
@@ -97,14 +76,6 @@ public abstract class AsyncExecutionAspectSupport implements BeanFactoryAware {
|
||||
this.defaultExecutor = defaultExecutor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Supply the {@link AsyncUncaughtExceptionHandler} to use to handle exceptions
|
||||
* thrown by invoking asynchronous methods with a {@code void} return type.
|
||||
*/
|
||||
public void setExceptionHandler(AsyncUncaughtExceptionHandler exceptionHandler) {
|
||||
this.exceptionHandler = exceptionHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the {@link BeanFactory} to be used when looking up executors by qualifier.
|
||||
*/
|
||||
@@ -116,7 +87,6 @@ public abstract class AsyncExecutionAspectSupport implements BeanFactoryAware {
|
||||
|
||||
/**
|
||||
* Determine the specific executor to use when executing the given method.
|
||||
* Should preferably return an {@link AsyncListenableTaskExecutor} implementation.
|
||||
* @return the executor to use (or {@code null}, but just if no default executor has been set)
|
||||
*/
|
||||
protected AsyncTaskExecutor determineAsyncExecutor(Method method) {
|
||||
@@ -133,8 +103,8 @@ public abstract class AsyncExecutionAspectSupport implements BeanFactoryAware {
|
||||
else if (executorToUse == null) {
|
||||
return null;
|
||||
}
|
||||
executor = (executorToUse instanceof AsyncListenableTaskExecutor ?
|
||||
(AsyncListenableTaskExecutor) executorToUse : new TaskExecutorAdapter(executorToUse));
|
||||
executor = (executorToUse instanceof AsyncTaskExecutor ?
|
||||
(AsyncTaskExecutor) executorToUse : new TaskExecutorAdapter(executorToUse));
|
||||
this.executors.put(method, executor);
|
||||
}
|
||||
return executor;
|
||||
@@ -152,32 +122,4 @@ public abstract class AsyncExecutionAspectSupport implements BeanFactoryAware {
|
||||
*/
|
||||
protected abstract String getExecutorQualifier(Method method);
|
||||
|
||||
/**
|
||||
* Handles a fatal error thrown while asynchronously invoking the specified
|
||||
* {@link Method}.
|
||||
* <p>If the return type of the method is a {@link java.util.concurrent.Future} object, the original
|
||||
* exception can be propagated by just throwing it at the higher level. However,
|
||||
* for all other cases, the exception will not be transmitted back to the client.
|
||||
* In that later case, the current {@link AsyncUncaughtExceptionHandler} will be
|
||||
* used to manage such exception.
|
||||
* @param ex the exception to handle
|
||||
* @param method the method that was invoked
|
||||
* @param params the parameters used to invoke the method
|
||||
*/
|
||||
protected void handleError(Throwable ex, Method method, Object... params) throws Exception {
|
||||
if (method.getReturnType().isAssignableFrom(Future.class)) {
|
||||
ReflectionUtils.rethrowException(ex);
|
||||
}
|
||||
else {
|
||||
// Could not transmit the exception to the caller with default executor
|
||||
try {
|
||||
this.exceptionHandler.handleUncaughtException(ex, method, params);
|
||||
}
|
||||
catch (Throwable ex2) {
|
||||
logger.error("Exception handler for async method '" + method.toGenericString() +
|
||||
"' threw unexpected exception itself", ex2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+21
-39
@@ -27,10 +27,9 @@ import org.aopalliance.intercept.MethodInvocation;
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.core.BridgeMethodResolver;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.task.AsyncListenableTaskExecutor;
|
||||
import org.springframework.core.task.AsyncTaskExecutor;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.concurrent.ListenableFuture;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
|
||||
/**
|
||||
* AOP Alliance {@code MethodInterceptor} that processes method invocations
|
||||
@@ -47,18 +46,12 @@ import org.springframework.util.concurrent.ListenableFuture;
|
||||
* (like Spring's {@link org.springframework.scheduling.annotation.AsyncResult}
|
||||
* or EJB 3.1's {@code javax.ejb.AsyncResult}).
|
||||
*
|
||||
* <p>When the return type is {@code java.util.concurrent.Future}, any exception thrown
|
||||
* during the execution can be accessed and managed by the caller. With {@code void}
|
||||
* return type however, such exceptions cannot be transmitted back. In that case an
|
||||
* {@link AsyncUncaughtExceptionHandler} can be registered to process such exceptions.
|
||||
*
|
||||
* <p>As of Spring 3.1.2 the {@code AnnotationAsyncExecutionInterceptor} subclass is
|
||||
* preferred for use due to its support for executor qualification in conjunction with
|
||||
* Spring's {@code @Async} annotation.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @author Chris Beams
|
||||
* @author Stephane Nicoll
|
||||
* @since 3.0
|
||||
* @see org.springframework.scheduling.annotation.Async
|
||||
* @see org.springframework.scheduling.annotation.AsyncAnnotationAdvisor
|
||||
@@ -71,19 +64,12 @@ public class AsyncExecutionInterceptor extends AsyncExecutionAspectSupport
|
||||
* Create a new {@code AsyncExecutionInterceptor}.
|
||||
* @param defaultExecutor the {@link Executor} (typically a Spring {@link AsyncTaskExecutor}
|
||||
* or {@link java.util.concurrent.ExecutorService}) to delegate to
|
||||
* @param exceptionHandler the {@link AsyncUncaughtExceptionHandler} to use
|
||||
*/
|
||||
public AsyncExecutionInterceptor(Executor defaultExecutor, AsyncUncaughtExceptionHandler exceptionHandler) {
|
||||
super(defaultExecutor, exceptionHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new instance with a default {@link AsyncUncaughtExceptionHandler}.
|
||||
*/
|
||||
public AsyncExecutionInterceptor(Executor defaultExecutor) {
|
||||
super(defaultExecutor);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Intercept the given method invocation, submit the actual calling of the method to
|
||||
* the correct task executor and return immediately to the caller.
|
||||
@@ -95,39 +81,35 @@ public class AsyncExecutionInterceptor extends AsyncExecutionAspectSupport
|
||||
public Object invoke(final MethodInvocation invocation) throws Throwable {
|
||||
Class<?> targetClass = (invocation.getThis() != null ? AopUtils.getTargetClass(invocation.getThis()) : null);
|
||||
Method specificMethod = ClassUtils.getMostSpecificMethod(invocation.getMethod(), targetClass);
|
||||
final Method userDeclaredMethod = BridgeMethodResolver.findBridgedMethod(specificMethod);
|
||||
specificMethod = BridgeMethodResolver.findBridgedMethod(specificMethod);
|
||||
|
||||
AsyncTaskExecutor executor = determineAsyncExecutor(userDeclaredMethod);
|
||||
AsyncTaskExecutor executor = determineAsyncExecutor(specificMethod);
|
||||
if (executor == null) {
|
||||
throw new IllegalStateException(
|
||||
"No executor specified and no default executor set on AsyncExecutionInterceptor either");
|
||||
}
|
||||
|
||||
Callable<Object> task = new Callable<Object>() {
|
||||
@Override
|
||||
public Object call() throws Exception {
|
||||
try {
|
||||
Object result = invocation.proceed();
|
||||
if (result instanceof Future) {
|
||||
return ((Future<?>) result).get();
|
||||
Future<?> result = executor.submit(
|
||||
new Callable<Object>() {
|
||||
@Override
|
||||
public Object call() throws Exception {
|
||||
try {
|
||||
Object result = invocation.proceed();
|
||||
if (result instanceof Future) {
|
||||
return ((Future<?>) result).get();
|
||||
}
|
||||
}
|
||||
catch (Throwable ex) {
|
||||
ReflectionUtils.rethrowException(ex);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
catch (Throwable ex) {
|
||||
handleError(ex, userDeclaredMethod, invocation.getArguments());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
Class<?> returnType = invocation.getMethod().getReturnType();
|
||||
if (ListenableFuture.class.isAssignableFrom(returnType)) {
|
||||
return ((AsyncListenableTaskExecutor) executor).submitListenable(task);
|
||||
}
|
||||
else if (Future.class.isAssignableFrom(returnType)) {
|
||||
return executor.submit(task);
|
||||
if (Future.class.isAssignableFrom(invocation.getMethod().getReturnType())) {
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
executor.submit(task);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
-42
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.aop.interceptor;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* A strategy for handling uncaught exceptions thrown from asynchronous methods.
|
||||
*
|
||||
* <p>An asynchronous method usually returns a {@link java.util.concurrent.Future}
|
||||
* instance that gives access to the underlying exception. When the method does
|
||||
* not provide that return type, this handler can be used to managed such
|
||||
* uncaught exceptions.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @since 4.1
|
||||
*/
|
||||
public interface AsyncUncaughtExceptionHandler {
|
||||
|
||||
/**
|
||||
* Handle the given uncaught exception thrown from an asynchronous method.
|
||||
* @param ex the exception thrown from the asynchronous method
|
||||
* @param method the asynchronous method
|
||||
* @param params the parameters used to invoked the method
|
||||
*/
|
||||
void handleUncaughtException(Throwable ex, Method method, Object... params);
|
||||
|
||||
}
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -24,7 +24,7 @@ import org.aopalliance.intercept.MethodInvocation;
|
||||
import org.springframework.aop.Advisor;
|
||||
import org.springframework.aop.support.DefaultPointcutAdvisor;
|
||||
import org.springframework.core.NamedThreadLocal;
|
||||
import org.springframework.core.PriorityOrdered;
|
||||
import org.springframework.core.Ordered;
|
||||
|
||||
/**
|
||||
* Interceptor that exposes the current {@link org.aopalliance.intercept.MethodInvocation}
|
||||
@@ -41,7 +41,7 @@ import org.springframework.core.PriorityOrdered;
|
||||
* @author Juergen Hoeller
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ExposeInvocationInterceptor implements MethodInterceptor, PriorityOrdered, Serializable {
|
||||
public class ExposeInvocationInterceptor implements MethodInterceptor, Ordered, Serializable {
|
||||
|
||||
/** Singleton instance of this class */
|
||||
public static final ExposeInvocationInterceptor INSTANCE = new ExposeInvocationInterceptor();
|
||||
@@ -98,7 +98,7 @@ public class ExposeInvocationInterceptor implements MethodInterceptor, PriorityO
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return PriorityOrdered.HIGHEST_PRECEDENCE + 1;
|
||||
return Ordered.HIGHEST_PRECEDENCE + 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+5
-31
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,26 +16,21 @@
|
||||
|
||||
package org.springframework.aop.interceptor;
|
||||
|
||||
import com.jamonapi.MonKey;
|
||||
import com.jamonapi.MonKeyImp;
|
||||
import com.jamonapi.Monitor;
|
||||
import com.jamonapi.MonitorFactory;
|
||||
import com.jamonapi.utils.Misc;
|
||||
import org.aopalliance.intercept.MethodInvocation;
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
/**
|
||||
* Performance monitor interceptor that uses <b>JAMon</b> library to perform the
|
||||
* performance measurement on the intercepted method and output the stats.
|
||||
* In addition, it tracks/counts exceptions thrown by the intercepted method.
|
||||
* The stack traces can be viewed in the JAMon web application.
|
||||
* Performance monitor interceptor that uses <b>JAMon</b> library
|
||||
* to perform the performance measurement on the intercepted method
|
||||
* and output the stats.
|
||||
*
|
||||
* <p>This code is inspired by Thierry Templier's blog.
|
||||
*
|
||||
* @author Dmitriy Kopylenko
|
||||
* @author Juergen Hoeller
|
||||
* @author Rob Harrop
|
||||
* @author Steve Souza
|
||||
* @since 1.1.3
|
||||
* @see com.jamonapi.MonitorFactory
|
||||
* @see PerformanceMonitorInterceptor
|
||||
@@ -108,16 +103,10 @@ public class JamonPerformanceMonitorInterceptor extends AbstractMonitoringInterc
|
||||
@Override
|
||||
protected Object invokeUnderTrace(MethodInvocation invocation, Log logger) throws Throwable {
|
||||
String name = createInvocationTraceName(invocation);
|
||||
MonKey key = new MonKeyImp(name, name, "ms.");
|
||||
|
||||
Monitor monitor = MonitorFactory.start(key);
|
||||
Monitor monitor = MonitorFactory.start(name);
|
||||
try {
|
||||
return invocation.proceed();
|
||||
}
|
||||
catch (Throwable ex) {
|
||||
trackException(key, ex);
|
||||
throw ex;
|
||||
}
|
||||
finally {
|
||||
monitor.stop();
|
||||
if (!this.trackAllInvocations || isLogEnabled(logger)) {
|
||||
@@ -126,19 +115,4 @@ public class JamonPerformanceMonitorInterceptor extends AbstractMonitoringInterc
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Count the thrown exception and put the stack trace in the details portion of the key.
|
||||
* This will allow the stack trace to be viewed in the JAMon web application.
|
||||
*/
|
||||
protected void trackException(MonKey key, Throwable ex) {
|
||||
String stackTrace = "stackTrace=" + Misc.getExceptionTrace(ex);
|
||||
key.setDetails(stackTrace);
|
||||
|
||||
// Specific exception counter. Example: java.lang.RuntimeException
|
||||
MonitorFactory.add(new MonKeyImp(ex.getClass().getName(), stackTrace, "Exception"), 1);
|
||||
|
||||
// General exception counter which is a total for all exceptions thrown
|
||||
MonitorFactory.add(new MonKeyImp(MonitorFactory.EXCEPTIONS_LABEL, stackTrace, "Exception"), 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-42
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.aop.interceptor;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* A default {@link AsyncUncaughtExceptionHandler} that simply logs the exception.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @since 4.1
|
||||
*/
|
||||
public class SimpleAsyncUncaughtExceptionHandler implements AsyncUncaughtExceptionHandler {
|
||||
|
||||
private final Log logger = LogFactory.getLog(SimpleAsyncUncaughtExceptionHandler.class);
|
||||
|
||||
@Override
|
||||
public void handleUncaughtException(Throwable ex, Method method, Object... params) {
|
||||
if (logger.isErrorEnabled()) {
|
||||
logger.error(String.format("Unexpected error occurred invoking async " +
|
||||
"method '%s'.", method), ex);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
|
||||
/**
|
||||
*
|
||||
* Provides miscellaneous interceptor implementations.
|
||||
* More specific interceptors can be found in corresponding
|
||||
* functionality packages, like "transaction" and "orm".
|
||||
*
|
||||
*/
|
||||
package org.springframework.aop.interceptor;
|
||||
|
||||
|
||||
@@ -1,20 +1,25 @@
|
||||
|
||||
/**
|
||||
*
|
||||
* Core Spring AOP interfaces, built on AOP Alliance AOP interoperability interfaces.
|
||||
*
|
||||
* <p>Any AOP Alliance MethodInterceptor is usable in Spring.
|
||||
* <br>Any AOP Alliance MethodInterceptor is usable in Spring.
|
||||
*
|
||||
* <br>Spring AOP also offers:
|
||||
* <ul>
|
||||
* <li>Introduction support
|
||||
* <li>A Pointcut abstraction, supporting "static" pointcuts
|
||||
* (class and method-based) and "dynamic" pointcuts (also considering method arguments).
|
||||
* There are currently no AOP Alliance interfaces for pointcuts.
|
||||
* <li>A full range of advice types, including around, before, after returning and throws advice.
|
||||
* <li>Extensibility allowing arbitrary custom advice types to
|
||||
* be plugged in without modifying the core framework.
|
||||
* <li>Introduction support
|
||||
* <li>A Pointcut abstraction, supporting "static" pointcuts
|
||||
* (class and method-based) and "dynamic" pointcuts (also considering method arguments).
|
||||
* There are currently no AOP Alliance interfaces for pointcuts.
|
||||
* <li>A full range of advice types, including around, before, after returning and throws advice.
|
||||
* <li>Extensibility allowing arbitrary custom advice types to
|
||||
* be plugged in without modifying the core framework.
|
||||
* </ul>
|
||||
*
|
||||
* <p>Spring AOP can be used programmatically or (preferably)
|
||||
* <br>
|
||||
* Spring AOP can be used programmatically or (preferably)
|
||||
* integrated with the Spring IoC container.
|
||||
*
|
||||
*/
|
||||
package org.springframework.aop;
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
|
||||
/**
|
||||
*
|
||||
* Support for AOP-based scoping of target objects, with configurable backend.
|
||||
*
|
||||
*/
|
||||
package org.springframework.aop.scope;
|
||||
|
||||
|
||||
+1
-1
@@ -18,9 +18,9 @@ package org.springframework.aop.support;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.util.PatternMatchUtils;
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
|
||||
/**
|
||||
*
|
||||
* Annotation support for AOP pointcuts.
|
||||
*
|
||||
*/
|
||||
package org.springframework.aop.support.annotation;
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
|
||||
/**
|
||||
*
|
||||
* Convenience classes for using Spring's AOP API.
|
||||
*
|
||||
*/
|
||||
package org.springframework.aop.support;
|
||||
|
||||
|
||||
@@ -4,5 +4,4 @@ http\://www.springframework.org/schema/aop/spring-aop-3.0.xsd=org/springframewor
|
||||
http\://www.springframework.org/schema/aop/spring-aop-3.1.xsd=org/springframework/aop/config/spring-aop-3.1.xsd
|
||||
http\://www.springframework.org/schema/aop/spring-aop-3.2.xsd=org/springframework/aop/config/spring-aop-3.2.xsd
|
||||
http\://www.springframework.org/schema/aop/spring-aop-4.0.xsd=org/springframework/aop/config/spring-aop-4.0.xsd
|
||||
http\://www.springframework.org/schema/aop/spring-aop-4.1.xsd=org/springframework/aop/config/spring-aop-4.1.xsd
|
||||
http\://www.springframework.org/schema/aop/spring-aop.xsd=org/springframework/aop/config/spring-aop-4.1.xsd
|
||||
http\://www.springframework.org/schema/aop/spring-aop.xsd=org/springframework/aop/config/spring-aop-4.0.xsd
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
||||
<xsd:schema xmlns="http://www.springframework.org/schema/aop"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:tool="http://www.springframework.org/schema/tool"
|
||||
targetNamespace="http://www.springframework.org/schema/aop"
|
||||
elementFormDefault="qualified"
|
||||
attributeFormDefault="unqualified">
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
xmlns:tool="http://www.springframework.org/schema/tool"
|
||||
targetNamespace="http://www.springframework.org/schema/aop"
|
||||
elementFormDefault="qualified"
|
||||
attributeFormDefault="unqualified">
|
||||
|
||||
<xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"/>
|
||||
<xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-2.0.xsd"/>
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
||||
<xsd:schema xmlns="http://www.springframework.org/schema/aop"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:tool="http://www.springframework.org/schema/tool"
|
||||
targetNamespace="http://www.springframework.org/schema/aop"
|
||||
elementFormDefault="qualified"
|
||||
attributeFormDefault="unqualified">
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
xmlns:tool="http://www.springframework.org/schema/tool"
|
||||
targetNamespace="http://www.springframework.org/schema/aop"
|
||||
elementFormDefault="qualified"
|
||||
attributeFormDefault="unqualified">
|
||||
|
||||
<xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"/>
|
||||
<xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-2.5.xsd"/>
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
||||
<xsd:schema xmlns="http://www.springframework.org/schema/aop"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:tool="http://www.springframework.org/schema/tool"
|
||||
targetNamespace="http://www.springframework.org/schema/aop"
|
||||
elementFormDefault="qualified"
|
||||
attributeFormDefault="unqualified">
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
xmlns:tool="http://www.springframework.org/schema/tool"
|
||||
targetNamespace="http://www.springframework.org/schema/aop"
|
||||
elementFormDefault="qualified"
|
||||
attributeFormDefault="unqualified">
|
||||
|
||||
<xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"/>
|
||||
<xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-3.0.xsd"/>
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
||||
<xsd:schema xmlns="http://www.springframework.org/schema/aop"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:tool="http://www.springframework.org/schema/tool"
|
||||
targetNamespace="http://www.springframework.org/schema/aop"
|
||||
elementFormDefault="qualified"
|
||||
attributeFormDefault="unqualified">
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
xmlns:tool="http://www.springframework.org/schema/tool"
|
||||
targetNamespace="http://www.springframework.org/schema/aop"
|
||||
elementFormDefault="qualified"
|
||||
attributeFormDefault="unqualified">
|
||||
|
||||
<xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"/>
|
||||
<xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-3.1.xsd"/>
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
||||
<xsd:schema xmlns="http://www.springframework.org/schema/aop"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:tool="http://www.springframework.org/schema/tool"
|
||||
targetNamespace="http://www.springframework.org/schema/aop"
|
||||
elementFormDefault="qualified"
|
||||
attributeFormDefault="unqualified">
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
xmlns:tool="http://www.springframework.org/schema/tool"
|
||||
targetNamespace="http://www.springframework.org/schema/aop"
|
||||
elementFormDefault="qualified"
|
||||
attributeFormDefault="unqualified">
|
||||
|
||||
<xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.2.xsd"/>
|
||||
<xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-3.2.xsd"/>
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
||||
<xsd:schema xmlns="http://www.springframework.org/schema/aop"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:tool="http://www.springframework.org/schema/tool"
|
||||
targetNamespace="http://www.springframework.org/schema/aop"
|
||||
elementFormDefault="qualified"
|
||||
attributeFormDefault="unqualified">
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
xmlns:tool="http://www.springframework.org/schema/tool"
|
||||
targetNamespace="http://www.springframework.org/schema/aop"
|
||||
elementFormDefault="qualified"
|
||||
attributeFormDefault="unqualified">
|
||||
|
||||
<xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-4.0.xsd"/>
|
||||
<xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-4.0.xsd"/>
|
||||
|
||||
@@ -1,409 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
||||
<xsd:schema xmlns="http://www.springframework.org/schema/aop"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:tool="http://www.springframework.org/schema/tool"
|
||||
targetNamespace="http://www.springframework.org/schema/aop"
|
||||
elementFormDefault="qualified"
|
||||
attributeFormDefault="unqualified">
|
||||
|
||||
<xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-4.1.xsd"/>
|
||||
<xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="http://www.springframework.org/schema/tool/spring-tool-4.1.xsd"/>
|
||||
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Defines the configuration elements for the Spring Framework's AOP support.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
|
||||
<xsd:element name="config">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
A section (compartmentalization) of AOP-specific configuration (including
|
||||
aspects, pointcuts, etc).
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="pointcut" type="pointcutType" minOccurs="0" maxOccurs="unbounded">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
A named pointcut definition.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="advisor" type="advisorType" minOccurs="0" maxOccurs="unbounded">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation source="java:org.springframework.aop.Advisor"><![CDATA[
|
||||
A named advisor definition.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="aspect" type="aspectType" minOccurs="0" maxOccurs="unbounded">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
A named aspect definition.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="proxy-target-class" type="xsd:boolean" default="false">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Are class-based (CGLIB) proxies to be created? By default, standard
|
||||
Java interface-based proxies are created.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="expose-proxy" type="xsd:boolean" default="false">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Indicate that the proxy should be exposed by the AOP framework as a
|
||||
ThreadLocal for retrieval via the AopContext class. Off by default,
|
||||
i.e. no guarantees that AopContext access will work.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="aspectj-autoproxy">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation source="java:org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator"><![CDATA[
|
||||
Enables the use of the @AspectJ style of Spring AOP.
|
||||
|
||||
See org.springframework.context.annotation.EnableAspectJAutoProxy Javadoc
|
||||
for information on code-based alternatives to this XML element.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="include" type="includeType" minOccurs="0" maxOccurs="unbounded">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Indicates that only @AspectJ beans with names matched by the (regex)
|
||||
pattern will be considered as defining aspects to use for Spring autoproxying.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="proxy-target-class" type="xsd:boolean" default="false">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Are class-based (CGLIB) proxies to be created? By default, standard
|
||||
Java interface-based proxies are created.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="expose-proxy" type="xsd:boolean" default="false">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Indicate that the proxy should be exposed by the AOP framework as a
|
||||
ThreadLocal for retrieval via the AopContext class. Off by default,
|
||||
i.e. no guarantees that AopContext access will work.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:element name="scoped-proxy">
|
||||
<xsd:complexType>
|
||||
<xsd:annotation>
|
||||
<xsd:documentation source="java:org.springframework.aop.scope.ScopedProxyFactoryBean"><![CDATA[
|
||||
Marks a bean definition as being a scoped proxy.
|
||||
|
||||
A bean marked as such will be exposed via a proxy, with the 'real'
|
||||
bean instance being retrieved from some other source (such as a
|
||||
HttpSession) as and when required.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:attribute name="proxy-target-class" type="xsd:boolean" default="true">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Are class-based (CGLIB) proxies to be created? This is the default; in order to
|
||||
switch to standard Java interface-based proxies, turn this flag to "false".
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:complexType name="aspectType">
|
||||
<xsd:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xsd:element name="pointcut" type="pointcutType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
A named pointcut definition.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="declare-parents" type="declareParentsType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
Allows this aspect to introduce additional interfaces that the advised
|
||||
object will transparently implement.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="before" type="basicAdviceType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
A before advice definition.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="after" type="basicAdviceType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
An after advice definition.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="after-returning" type="afterReturningAdviceType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
An after-returning advice definition.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="after-throwing" type="afterThrowingAdviceType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
An after-throwing advice definition.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
<xsd:element name="around" type="basicAdviceType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
An around advice definition.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
<xsd:attribute name="id" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
The unique identifier for an aspect.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="ref" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
The name of the (backing) bean that encapsulates the aspect.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="order" type="xsd:token">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation source="java:org.springframework.core.Ordered"><![CDATA[
|
||||
Controls the ordering of the execution of this aspect when multiple
|
||||
advice executes at a specific joinpoint.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="includeType">
|
||||
<xsd:attribute name="name" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation source="java:java.util.regex.Pattern"><![CDATA[
|
||||
The regular expression defining which beans are to be included in the
|
||||
list of @AspectJ beans; beans with names matched by the pattern will
|
||||
be included.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="pointcutType">
|
||||
<xsd:annotation>
|
||||
<xsd:appinfo>
|
||||
<tool:annotation>
|
||||
<tool:exports type="org.springframework.aop.Pointcut"/>
|
||||
</tool:annotation>
|
||||
</xsd:appinfo>
|
||||
</xsd:annotation>
|
||||
<xsd:attribute name="id" type="xsd:string" use="required">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
The unique identifier for a pointcut.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="expression" use="required" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
The pointcut expression.
|
||||
|
||||
For example : 'execution(* com.xyz.myapp.service.*.*(..))'
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="declareParentsType">
|
||||
<xsd:attribute name="types-matching" type="xsd:string" use="required">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation source="java:org.springframework.aop.aspectj.TypePatternClassFilter"><![CDATA[
|
||||
The AspectJ type expression that defines what types (classes) the
|
||||
introduction is restricted to.
|
||||
|
||||
An example would be 'org.springframework.beans.ITestBean+'.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="implement-interface" type="xsd:string" use="required">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation source="java:java.lang.Class"><![CDATA[
|
||||
The fully qualified name of the interface that will be introduced.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="default-impl" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation source="java:java.lang.Class"><![CDATA[
|
||||
The fully qualified name of the class that will be instantiated to serve
|
||||
as the default implementation of the introduced interface.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="delegate-ref" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
A reference to the bean that will serve
|
||||
as the default implementation of the introduced interface.
|
||||
]]></xsd:documentation>
|
||||
<xsd:appinfo>
|
||||
<tool:annotation kind="ref"/>
|
||||
</xsd:appinfo>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="basicAdviceType">
|
||||
<xsd:attribute name="pointcut" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
The associated pointcut expression.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="pointcut-ref" type="pointcutRefType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
The name of an associated pointcut definition.
|
||||
]]></xsd:documentation>
|
||||
<xsd:appinfo>
|
||||
<tool:annotation kind="ref">
|
||||
<tool:expected-type type="org.springframework.aop.Pointcut"/>
|
||||
</tool:annotation>
|
||||
</xsd:appinfo>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="method" type="xsd:string" use="required">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
The name of the method that defines the logic of the advice.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="arg-names" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
The comma-delimited list of advice method argument (parameter) names
|
||||
that will be matched from pointcut parameters.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="afterReturningAdviceType">
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="basicAdviceType">
|
||||
<xsd:attribute name="returning" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
The name of the method parameter to which the return value must
|
||||
be passed.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:extension>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="afterThrowingAdviceType">
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="basicAdviceType">
|
||||
<xsd:attribute name="throwing" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
The name of the method parameter to which the thrown exception must
|
||||
be passed.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:extension>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="advisorType">
|
||||
<xsd:annotation>
|
||||
<xsd:appinfo>
|
||||
<tool:annotation>
|
||||
<tool:exports type="org.springframework.aop.Advisor"/>
|
||||
</tool:annotation>
|
||||
</xsd:appinfo>
|
||||
</xsd:annotation>
|
||||
<xsd:attribute name="id" type="xsd:string"/>
|
||||
<xsd:attribute name="advice-ref" type="xsd:string" use="required">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
A reference to an advice bean.
|
||||
]]></xsd:documentation>
|
||||
<xsd:appinfo>
|
||||
<tool:annotation kind="ref">
|
||||
<tool:expected-type type="org.aopalliance.aop.Advice"/>
|
||||
</tool:annotation>
|
||||
</xsd:appinfo>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="pointcut" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
A pointcut expression.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="pointcut-ref" type="pointcutRefType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[
|
||||
A reference to a pointcut definition.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="order" type="xsd:token">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation source="java:org.springframework.core.Ordered"><![CDATA[
|
||||
Controls the ordering of the execution of this advice when multiple
|
||||
advice executes at a specific joinpoint.
|
||||
]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:simpleType name="pointcutRefType">
|
||||
<xsd:annotation>
|
||||
<xsd:appinfo>
|
||||
<tool:annotation kind="ref">
|
||||
<tool:expected-type type="org.springframework.aop.Pointcut"/>
|
||||
</tool:annotation>
|
||||
</xsd:appinfo>
|
||||
</xsd:annotation>
|
||||
<xsd:union memberTypes="xsd:string"/>
|
||||
</xsd:simpleType>
|
||||
|
||||
</xsd:schema>
|
||||
+2
-3
@@ -15,14 +15,13 @@
|
||||
*/
|
||||
package org.springframework.aop.aspectj;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.aop.aspectj.AspectJAdviceParameterNameDiscoverer.AmbiguousBindingException;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* Unit tests for the {@link AspectJAdviceParameterNameDiscoverer} class.
|
||||
|
||||
+3
-3
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.aop.aspectj;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.aopalliance.intercept.MethodInterceptor;
|
||||
@@ -25,19 +27,17 @@ import org.aspectj.weaver.tools.PointcutPrimitive;
|
||||
import org.aspectj.weaver.tools.UnsupportedPointcutPrimitiveException;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.aop.ClassFilter;
|
||||
import org.springframework.aop.MethodMatcher;
|
||||
import org.springframework.aop.Pointcut;
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.aop.support.DefaultPointcutAdvisor;
|
||||
|
||||
import org.springframework.tests.sample.beans.IOther;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.tests.sample.beans.subpkg.DeepBean;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Rob Harrop
|
||||
* @author Rod Johnson
|
||||
|
||||
+2
-2
@@ -16,12 +16,12 @@
|
||||
|
||||
package org.springframework.aop.aspectj;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Tests for matching of bean() pointcut designator.
|
||||
*
|
||||
|
||||
+3
-4
@@ -26,17 +26,16 @@ import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.reflect.MethodSignature;
|
||||
import org.aspectj.lang.reflect.SourceLocation;
|
||||
import org.aspectj.runtime.reflect.Factory;
|
||||
import static org.junit.Assert.*;
|
||||
import org.junit.Test;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
|
||||
import org.springframework.aop.MethodBeforeAdvice;
|
||||
import org.springframework.aop.framework.AopContext;
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.aop.interceptor.ExposeInvocationInterceptor;
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Rod Johnson
|
||||
|
||||
-1
@@ -17,7 +17,6 @@
|
||||
package org.springframework.aop.aspectj;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.aop.aspectj.AspectJAdviceParameterNameDiscoverer.AmbiguousBindingException;
|
||||
|
||||
/**
|
||||
|
||||
+4
-3
@@ -16,6 +16,9 @@
|
||||
|
||||
package org.springframework.aop.aspectj;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -23,13 +26,11 @@ import java.util.Map;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import test.annotation.EmptySpringAnnotation;
|
||||
import test.annotation.transaction.Tx;
|
||||
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Java5-specific {@link AspectJExpressionPointcutTests}.
|
||||
*
|
||||
|
||||
+3
-3
@@ -1,5 +1,8 @@
|
||||
package org.springframework.aop.aspectj;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
@@ -9,7 +12,6 @@ import java.lang.annotation.Target;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.aop.Advisor;
|
||||
import org.springframework.aop.MethodBeforeAdvice;
|
||||
import org.springframework.aop.ThrowsAdvice;
|
||||
@@ -17,8 +19,6 @@ import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.aop.support.DefaultPointcutAdvisor;
|
||||
import org.springframework.core.OverridingClassLoader;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Dave Syer
|
||||
*/
|
||||
|
||||
+3
-3
@@ -16,18 +16,18 @@
|
||||
|
||||
package org.springframework.aop.aspectj;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
|
||||
import org.springframework.tests.sample.beans.CountingTestBean;
|
||||
import org.springframework.tests.sample.beans.IOther;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.tests.sample.beans.subpkg.DeepBean;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Unit tests for the {@link TypePatternClassFilter} class.
|
||||
*
|
||||
|
||||
+9
-10
@@ -37,12 +37,8 @@ import org.aspectj.lang.annotation.DeclareParents;
|
||||
import org.aspectj.lang.annotation.DeclarePrecedence;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.aspectj.lang.reflect.MethodSignature;
|
||||
import org.junit.Ignore;
|
||||
|
||||
import org.junit.Test;
|
||||
import test.aop.DefaultLockable;
|
||||
import test.aop.Lockable;
|
||||
import test.aop.PerTargetAspect;
|
||||
import test.aop.TwoAdviceAspect;
|
||||
|
||||
import org.springframework.aop.Advisor;
|
||||
import org.springframework.aop.aspectj.annotation.ReflectiveAspectJAdvisorFactory.SyntheticInstantiationAdvisor;
|
||||
@@ -58,6 +54,11 @@ import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import test.aop.DefaultLockable;
|
||||
import test.aop.Lockable;
|
||||
import test.aop.PerTargetAspect;
|
||||
import test.aop.TwoAdviceAspect;
|
||||
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
@@ -401,8 +402,8 @@ public abstract class AbstractAspectJAdvisorFactoryTests {
|
||||
|
||||
@Test
|
||||
public void testIntroductionOnTargetExcludedByTypePattern() {
|
||||
LinkedList<Object> target = new LinkedList<Object>();
|
||||
List<?> proxy = (List<?>) createProxy(target,
|
||||
LinkedList target = new LinkedList();
|
||||
List proxy = (List) createProxy(target,
|
||||
AopUtils.findAdvisorsThatCanApply(
|
||||
getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(new MakeLockable(), "someBean")),
|
||||
List.class
|
||||
@@ -430,9 +431,7 @@ public abstract class AbstractAspectJAdvisorFactoryTests {
|
||||
|
||||
// TODO: Why does this test fail? It hasn't been run before, so it maybe never actually passed...
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void testIntroductionWithArgumentBinding() {
|
||||
public void XtestIntroductionWithArgumentBinding() {
|
||||
TestBean target = new TestBean();
|
||||
|
||||
List<Advisor> advisors = getFixture().getAdvisors(
|
||||
|
||||
+3
-3
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.aop.aspectj.annotation;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.reflect.Method;
|
||||
@@ -25,13 +27,11 @@ import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.aop.aspectj.AspectJAdviceParameterNameDiscoverer;
|
||||
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Adrian Colyer
|
||||
* @author Juergen Hoeller
|
||||
|
||||
+4
-4
@@ -16,16 +16,16 @@
|
||||
|
||||
package org.springframework.aop.aspectj.annotation;
|
||||
|
||||
import org.junit.Test;
|
||||
import test.aop.PerTargetAspect;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.aop.Pointcut;
|
||||
import org.springframework.aop.aspectj.AspectJExpressionPointcut;
|
||||
import org.springframework.aop.aspectj.AspectJExpressionPointcutTests;
|
||||
import org.springframework.aop.framework.AopConfigException;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import test.aop.PerTargetAspect;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
|
||||
/**
|
||||
* @author Rod Johnson
|
||||
|
||||
+2
-2
@@ -16,14 +16,14 @@
|
||||
|
||||
package org.springframework.aop.aspectj.annotation;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import org.aspectj.lang.reflect.PerClauseKind;
|
||||
import org.junit.Test;
|
||||
import test.aop.PerTargetAspect;
|
||||
|
||||
import org.springframework.aop.Pointcut;
|
||||
import org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactoryTests.ExceptionAspect;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import test.aop.PerTargetAspect;
|
||||
|
||||
/**
|
||||
* @since 2.0
|
||||
|
||||
+3
-3
@@ -16,16 +16,16 @@
|
||||
|
||||
package org.springframework.aop.aspectj.annotation;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import test.aop.PerThisAspect;
|
||||
|
||||
import org.springframework.util.SerializationTestUtils;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import test.aop.PerThisAspect;
|
||||
|
||||
/**
|
||||
* @author Rob Harrop
|
||||
|
||||
+2
-3
@@ -16,9 +16,10 @@
|
||||
|
||||
package org.springframework.aop.aspectj.autoproxy;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.aop.config.AopConfigUtils;
|
||||
import org.springframework.aop.config.AopNamespaceUtils;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
@@ -31,8 +32,6 @@ import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.beans.factory.xml.XmlReaderContext;
|
||||
import org.springframework.tests.beans.CollectingReaderEventListener;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Rob Harrop
|
||||
* @author Chris Beams
|
||||
|
||||
+5
-4
@@ -16,12 +16,16 @@
|
||||
|
||||
package org.springframework.aop.config;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.config.BeanReference;
|
||||
import org.springframework.beans.factory.parsing.BeanComponentDefinition;
|
||||
@@ -32,9 +36,6 @@ import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.tests.beans.CollectingReaderEventListener;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.springframework.tests.TestResourceUtils.*;
|
||||
|
||||
/**
|
||||
* @author Rob Harrop
|
||||
* @author Juergen Hoeller
|
||||
|
||||
+4
-4
@@ -16,16 +16,16 @@
|
||||
|
||||
package org.springframework.aop.config;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.BeanDefinitionStoreException;
|
||||
import org.springframework.beans.factory.parsing.BeanDefinitionParsingException;
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.springframework.tests.TestResourceUtils.*;
|
||||
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
* @author Chris Beams
|
||||
|
||||
@@ -16,15 +16,14 @@
|
||||
|
||||
package org.springframework.aop.config;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.core.io.Resource;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.springframework.tests.TestResourceUtils.*;
|
||||
|
||||
/**
|
||||
* Tests that the <aop:config/> element can be used as a top level element.
|
||||
*
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.aop.framework;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.lang.reflect.InvocationHandler;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Proxy;
|
||||
@@ -23,13 +25,11 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.aop.SpringProxy;
|
||||
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Rod Johnson
|
||||
* @author Chris Beams
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
|
||||
+2
-2
@@ -17,11 +17,11 @@
|
||||
package org.springframework.aop.framework;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.aop.support.DelegatingIntroductionInterceptor;
|
||||
import org.springframework.util.StopWatch;
|
||||
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.util.StopWatch;
|
||||
|
||||
/**
|
||||
* Benchmarks for introductions.
|
||||
|
||||
+2
-2
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.aop.framework;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@@ -26,8 +28,6 @@ import org.junit.Test;
|
||||
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Rod Johnson
|
||||
* @author Chris Beams
|
||||
|
||||
@@ -16,16 +16,15 @@
|
||||
|
||||
package org.springframework.aop.framework;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.aopalliance.intercept.MethodInterceptor;
|
||||
import org.aopalliance.intercept.MethodInvocation;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
import org.springframework.aop.AopInvocationException;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Test for SPR-4675. A null value returned from around advice is very hard to debug if
|
||||
* the caller expects a primitive.
|
||||
|
||||
+3
-4
@@ -16,17 +16,16 @@
|
||||
|
||||
package org.springframework.aop.framework;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
|
||||
|
||||
import org.aopalliance.intercept.MethodInterceptor;
|
||||
import org.aopalliance.intercept.MethodInvocation;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.core.io.Resource;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.springframework.tests.TestResourceUtils.*;
|
||||
|
||||
/**
|
||||
* @author Juergen Hoeller
|
||||
* @author Chris Beams
|
||||
|
||||
@@ -16,6 +16,13 @@
|
||||
|
||||
package org.springframework.aop.framework;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.instanceOf;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import javax.accessibility.Accessible;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.RootPaneContainer;
|
||||
@@ -24,7 +31,6 @@ import org.aopalliance.intercept.MethodInterceptor;
|
||||
import org.aopalliance.intercept.MethodInvocation;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.aop.Advisor;
|
||||
import org.springframework.aop.interceptor.DebugInterceptor;
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
@@ -38,9 +44,6 @@ import org.springframework.tests.sample.beans.IOther;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Also tests AdvisedSupport and ProxyCreatorSupport superclasses.
|
||||
*
|
||||
|
||||
+1
-1
@@ -20,11 +20,11 @@ import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.rmi.RemoteException;
|
||||
|
||||
import javax.transaction.TransactionRolledbackException;
|
||||
|
||||
import org.aopalliance.intercept.MethodInvocation;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.aop.ThrowsAdvice;
|
||||
import org.springframework.tests.aop.advice.MethodCounter;
|
||||
|
||||
|
||||
+2
-3
@@ -16,10 +16,11 @@
|
||||
|
||||
package org.springframework.aop.interceptor;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.aop.framework.Advised;
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.tests.sample.beans.DerivedTestBean;
|
||||
@@ -27,8 +28,6 @@ import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.util.SerializationTestUtils;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Juergen Hoeller
|
||||
* @author Chris Beams
|
||||
|
||||
+3
-3
@@ -16,15 +16,15 @@
|
||||
|
||||
package org.springframework.aop.interceptor;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.beans.factory.NamedBean;
|
||||
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Rod Johnson
|
||||
* @author Chris Beams
|
||||
|
||||
+4
-4
@@ -16,18 +16,18 @@
|
||||
|
||||
package org.springframework.aop.interceptor;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
|
||||
|
||||
import org.aopalliance.intercept.MethodInvocation;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.springframework.tests.TestResourceUtils.*;
|
||||
|
||||
/**
|
||||
* Non-XML tests are in AbstractAopProxyTests
|
||||
*
|
||||
|
||||
-81
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.aop.interceptor;
|
||||
|
||||
import com.jamonapi.MonitorFactory;
|
||||
import org.aopalliance.intercept.MethodInvocation;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.mockito.BDDMockito.*;
|
||||
|
||||
/**
|
||||
* @author Steve Souza
|
||||
* @since 4.1
|
||||
*/
|
||||
public class JamonPerformanceMonitorInterceptorTests {
|
||||
|
||||
private JamonPerformanceMonitorInterceptor interceptor = new JamonPerformanceMonitorInterceptor();
|
||||
|
||||
private MethodInvocation mi = mock(MethodInvocation.class);
|
||||
|
||||
private Log log = mock(Log.class);
|
||||
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
MonitorFactory.reset();
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
MonitorFactory.reset();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testInvokeUnderTraceWithNormalProcessing() throws Throwable {
|
||||
given(mi.getMethod()).willReturn(String.class.getMethod("toString"));
|
||||
|
||||
interceptor.invokeUnderTrace(mi, log);
|
||||
|
||||
assertEquals("jamon must track the method being invoked", 1, MonitorFactory.getNumRows());
|
||||
assertTrue("The jamon report must contain the toString method that was invoked", MonitorFactory.getReport().contains("toString"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvokeUnderTraceWithExceptionTracking() throws Throwable {
|
||||
given(mi.getMethod()).willReturn(String.class.getMethod("toString"));
|
||||
given(mi.proceed()).willThrow(new IllegalArgumentException());
|
||||
|
||||
try {
|
||||
interceptor.invokeUnderTrace(mi, log);
|
||||
fail("Must have propagated the IllegalArgumentException");
|
||||
}
|
||||
catch (IllegalArgumentException expected) {
|
||||
}
|
||||
|
||||
assertEquals("Monitors must exist for the method invocation and 2 exceptions", 3, MonitorFactory.getNumRows());
|
||||
assertTrue("The jamon report must contain the toString method that was invoked", MonitorFactory.getReport().contains("toString"));
|
||||
assertTrue("The jamon report must contain the generic exception: " + MonitorFactory.EXCEPTIONS_LABEL, MonitorFactory.getReport().contains(MonitorFactory.EXCEPTIONS_LABEL));
|
||||
assertTrue("The jamon report must contain the specific exception: IllegalArgumentException'", MonitorFactory.getReport().contains("IllegalArgumentException"));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,7 +17,6 @@
|
||||
package org.springframework.aop.scope;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
|
||||
import static org.mockito.BDDMockito.*;
|
||||
|
||||
+3
-4
@@ -16,15 +16,14 @@
|
||||
|
||||
package org.springframework.aop.scope;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.core.io.Resource;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.springframework.tests.TestResourceUtils.*;
|
||||
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
* @author Chris Beams
|
||||
|
||||
-1
@@ -20,7 +20,6 @@ import java.io.IOException;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.util.SerializationTestUtils;
|
||||
|
||||
|
||||
@@ -16,10 +16,13 @@
|
||||
|
||||
package org.springframework.aop.support;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.aop.ClassFilter;
|
||||
import org.springframework.aop.MethodMatcher;
|
||||
import org.springframework.aop.Pointcut;
|
||||
@@ -29,8 +32,6 @@ import org.springframework.tests.aop.interceptor.NopInterceptor;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.util.SerializationTestUtils;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Rod Johnson
|
||||
* @author Chris Beams
|
||||
|
||||
@@ -16,15 +16,15 @@
|
||||
|
||||
package org.springframework.aop.support;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.aop.ClassFilter;
|
||||
import org.springframework.core.NestedRuntimeException;
|
||||
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Rod Johnson
|
||||
* @author Chris Beams
|
||||
|
||||
+3
-3
@@ -16,17 +16,17 @@
|
||||
|
||||
package org.springframework.aop.support;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.aop.ClassFilter;
|
||||
import org.springframework.aop.MethodMatcher;
|
||||
import org.springframework.aop.Pointcut;
|
||||
import org.springframework.core.NestedRuntimeException;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
|
||||
/**
|
||||
* @author Rod Johnson
|
||||
|
||||
+3
-3
@@ -16,16 +16,16 @@
|
||||
|
||||
package org.springframework.aop.support;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.aop.Pointcut;
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.tests.aop.interceptor.NopInterceptor;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Rod Johnson
|
||||
* @author Chris Beams
|
||||
|
||||
-1
@@ -20,7 +20,6 @@ import java.io.Serializable;
|
||||
|
||||
import org.aopalliance.intercept.MethodInterceptor;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.aop.IntroductionAdvisor;
|
||||
import org.springframework.aop.IntroductionInterceptor;
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
|
||||
@@ -16,18 +16,19 @@
|
||||
|
||||
package org.springframework.aop.support;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.aop.MethodMatcher;
|
||||
import org.springframework.tests.sample.beans.IOther;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.util.SerializationTestUtils;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Juergen Hoeller
|
||||
* @author Chris Beams
|
||||
|
||||
+4
-3
@@ -16,9 +16,12 @@
|
||||
|
||||
package org.springframework.aop.support;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.aop.framework.Advised;
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.tests.aop.interceptor.NopInterceptor;
|
||||
@@ -27,8 +30,6 @@ import org.springframework.tests.sample.beans.Person;
|
||||
import org.springframework.tests.sample.beans.SerializablePerson;
|
||||
import org.springframework.util.SerializationTestUtils;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Rod Johnson
|
||||
* @author Chris Beams
|
||||
|
||||
@@ -16,15 +16,15 @@
|
||||
|
||||
package org.springframework.aop.support;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.aop.ClassFilter;
|
||||
import org.springframework.aop.Pointcut;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
|
||||
/**
|
||||
* @author Rod Johnson
|
||||
|
||||
+3
-4
@@ -16,8 +16,10 @@
|
||||
|
||||
package org.springframework.aop.support;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.aop.framework.Advised;
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
@@ -29,9 +31,6 @@ import org.springframework.tests.sample.beans.Person;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.util.SerializationTestUtils;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.springframework.tests.TestResourceUtils.*;
|
||||
|
||||
/**
|
||||
* @author Rod Johnson
|
||||
* @author Chris Beams
|
||||
|
||||
+3
-4
@@ -16,17 +16,16 @@
|
||||
|
||||
package org.springframework.aop.target;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.springframework.tests.TestResourceUtils.*;
|
||||
|
||||
/**
|
||||
* @author Rob Harrop
|
||||
* @author Chris Beams
|
||||
|
||||
+5
-4
@@ -16,10 +16,14 @@
|
||||
|
||||
package org.springframework.aop.target;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.aop.framework.Advised;
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.aop.support.DefaultPointcutAdvisor;
|
||||
@@ -32,9 +36,6 @@ import org.springframework.tests.sample.beans.SerializablePerson;
|
||||
import org.springframework.tests.sample.beans.SideEffectBean;
|
||||
import org.springframework.util.SerializationTestUtils;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.springframework.tests.TestResourceUtils.*;
|
||||
|
||||
/**
|
||||
* @author Rod Johnson
|
||||
* @author Chris Beams
|
||||
|
||||
+2
-3
@@ -16,13 +16,12 @@
|
||||
|
||||
package org.springframework.aop.target;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.aop.TargetSource;
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* @author Rob Harrop
|
||||
* @author Juergen Hoeller
|
||||
|
||||
+5
-4
@@ -16,18 +16,19 @@
|
||||
|
||||
package org.springframework.aop.target;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.tests.sample.beans.ITestBean;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.springframework.tests.TestResourceUtils.*;
|
||||
|
||||
/**
|
||||
* @author Juergen Hoeller
|
||||
* @author Rob Harrop
|
||||
|
||||
+3
-3
@@ -16,8 +16,10 @@
|
||||
|
||||
package org.springframework.aop.target;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.aop.TargetSource;
|
||||
import org.springframework.beans.MutablePropertyValues;
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
@@ -26,8 +28,6 @@ import org.springframework.tests.sample.beans.SerializablePerson;
|
||||
import org.springframework.tests.sample.beans.TestBean;
|
||||
import org.springframework.util.SerializationTestUtils;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Unit tests relating to the abstract {@link AbstractPrototypeBasedTargetSource}
|
||||
* and not subclasses.
|
||||
|
||||
+3
-4
@@ -16,9 +16,11 @@
|
||||
|
||||
package org.springframework.aop.target;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.springframework.tests.TestResourceUtils.qualifiedResource;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
@@ -26,9 +28,6 @@ import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.tests.sample.beans.SideEffectBean;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.springframework.tests.TestResourceUtils.*;
|
||||
|
||||
/**
|
||||
* @author Rod Johnson
|
||||
* @author Chris Beams
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user