INT-4458: Do not expose recursive generics API (#2432)

* INT-4458: Do not expose recursive generics API

JIRA: https://jira.spring.io/browse/INT-4458

According Kotlin generics system restrictions we can't expose API
based on the recursive generics, like we have with Java DSL for JMS

* Replace explicit recursive generics on factory method with the wildcard (`?`).
This way both Kotlin and Java are able to instantiate target object and perform
the proper chain API auto-completion
* Fix `JmsInboundChannelAdapterSpec` to deal with provided `S` type for the
`configureListenerContainer()` - the way we can configure a `JmsDefaultListenerContainerSpec`
* Add `kotlin-spring` Gradle plugin to avoid extra `open` modificator on `@Bean` methods
* Add `JmsDslKotlinTests.kt`

**Cherry-pick to 5.0.x excluding Kotlin support**

* Fix `Amqp` DSL factory for recursive generics

* Polishing for Kotlin tests
This commit is contained in:
Artem Bilan
2018-05-01 08:47:07 -04:00
committed by Gary Russell
parent f970bf0332
commit a62832c707
7 changed files with 185 additions and 82 deletions

View File

@@ -68,10 +68,10 @@ class RouterDslTests {
@Configuration
@EnableIntegration
open class Config {
class Config {
@Bean
open fun routerTwoSubFlows() =
fun routerTwoSubFlows() =
IntegrationFlow { f ->
f.split()
.route<Int, Boolean>({ p -> p % 2 == 0 },