Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
ee7c86a0
Commit
ee7c86a0
authored
Apr 27, 2015
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start building against Reactor 2.0.1 snapshots
See gh-2719
parent
681894a1
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
104 additions
and
84 deletions
+104
-84
pom.xml
spring-boot-autoconfigure/pom.xml
+5
-5
ReactorAutoConfiguration.java
.../boot/autoconfigure/reactor/ReactorAutoConfiguration.java
+6
-5
ReactorAutoConfigurationTests.java
.../autoconfigure/reactor/ReactorAutoConfigurationTests.java
+21
-11
reactor.groovy
spring-boot-cli/samples/reactor.groovy
+3
-3
ReactorCompilerAutoConfiguration.java
...piler/autoconfigure/ReactorCompilerAutoConfiguration.java
+10
-11
integration_auto_test.groovy
spring-boot-cli/test-samples/integration_auto_test.groovy
+2
-2
pom.xml
spring-boot-dependencies/pom.xml
+57
-47
No files found.
spring-boot-autoconfigure/pom.xml
View file @
ee7c86a0
...
@@ -80,6 +80,11 @@
...
@@ -80,6 +80,11 @@
<artifactId>
cache-api
</artifactId>
<artifactId>
cache-api
</artifactId>
<optional>
true
</optional>
<optional>
true
</optional>
</dependency>
</dependency>
<dependency>
<groupId>
io.projectreactor.spring
</groupId>
<artifactId>
reactor-spring-context
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<dependency>
<groupId>
org.flywaydb
</groupId>
<groupId>
org.flywaydb
</groupId>
<artifactId>
flyway-core
</artifactId>
<artifactId>
flyway-core
</artifactId>
...
@@ -415,11 +420,6 @@
...
@@ -415,11 +420,6 @@
<artifactId>
thymeleaf-extras-springsecurity4
</artifactId>
<artifactId>
thymeleaf-extras-springsecurity4
</artifactId>
<optional>
true
</optional>
<optional>
true
</optional>
</dependency>
</dependency>
<dependency>
<groupId>
org.projectreactor.spring
</groupId>
<artifactId>
reactor-spring-context
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<dependency>
<groupId>
javax.jms
</groupId>
<groupId>
javax.jms
</groupId>
<artifactId>
jms-api
</artifactId>
<artifactId>
jms-api
</artifactId>
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/reactor/ReactorAutoConfiguration.java
View file @
ee7c86a0
...
@@ -24,8 +24,8 @@ import org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration;
...
@@ -24,8 +24,8 @@ import org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
reactor.
core.
Environment
;
import
reactor.Environment
;
import
reactor.
core.Reactor
;
import
reactor.
bus.EventBus
;
import
reactor.spring.context.config.EnableReactor
;
import
reactor.spring.context.config.EnableReactor
;
/**
/**
...
@@ -39,15 +39,16 @@ import reactor.spring.context.config.EnableReactor;
...
@@ -39,15 +39,16 @@ import reactor.spring.context.config.EnableReactor;
public
class
ReactorAutoConfiguration
{
public
class
ReactorAutoConfiguration
{
@Bean
@Bean
@ConditionalOnMissingBean
(
Reactor
.
class
)
@ConditionalOnMissingBean
(
EventBus
.
class
)
public
Reactor
rootReactor
(
Environment
environment
)
{
public
EventBus
eventBus
(
Environment
environment
)
{
return
environment
.
getRootReactor
(
);
return
EventBus
.
create
(
environment
);
}
}
@Configuration
@Configuration
@ConditionalOnMissingBean
(
Environment
.
class
)
@ConditionalOnMissingBean
(
Environment
.
class
)
@EnableReactor
@EnableReactor
protected
static
class
ReactorConfiguration
{
protected
static
class
ReactorConfiguration
{
}
}
}
}
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/reactor/ReactorAutoConfigurationTests.java
View file @
ee7c86a0
/*
/*
* Copyright 2012-201
4
the original author or authors.
* Copyright 2012-201
5
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -21,43 +21,53 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext
...
@@ -21,43 +21,53 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
reactor.core.Environment
;
import
reactor.bus.EventBus
;
import
reactor.core.Reactor
;
import
reactor.core.Dispatcher
;
import
reactor.core.spec.Reactors
;
import
reactor.core.dispatch.MpscDispatcher
;
import
reactor.core.dispatch.RingBufferDispatcher
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
import
static
org
.
hamcrest
.
Matchers
.
instanceOf
;
import
static
org
.
junit
.
Assert
.
assertThat
;
/**
/**
* Tests for {@link ReactorAutoConfiguration}.
* Tests for {@link ReactorAutoConfiguration}.
*
*
* @author Dave Syer
* @author Dave Syer
* @author Andy Wilkinson
*/
*/
public
class
ReactorAutoConfigurationTests
{
public
class
ReactorAutoConfigurationTests
{
private
final
AnnotationConfigApplicationContext
context
=
new
AnnotationConfigApplicationContext
();
private
final
AnnotationConfigApplicationContext
context
=
new
AnnotationConfigApplicationContext
();
@Test
@Test
public
void
reactor
IsAvailable
()
{
public
void
eventBus
IsAvailable
()
{
this
.
context
.
register
(
ReactorAutoConfiguration
.
class
);
this
.
context
.
register
(
ReactorAutoConfiguration
.
class
);
this
.
context
.
refresh
();
this
.
context
.
refresh
();
assertNotNull
(
this
.
context
.
getBean
(
Reactor
.
class
));
EventBus
eventBus
=
this
.
context
.
getBean
(
EventBus
.
class
);
assertThat
(
eventBus
.
getDispatcher
(),
instanceOf
(
RingBufferDispatcher
.
class
));
this
.
context
.
close
();
this
.
context
.
close
();
}
}
@Test
@Test
public
void
custom
Reactor
()
{
public
void
custom
EventBus
()
{
this
.
context
.
register
(
TestConfiguration
.
class
,
ReactorAutoConfiguration
.
class
);
this
.
context
.
register
(
TestConfiguration
.
class
,
ReactorAutoConfiguration
.
class
);
this
.
context
.
refresh
();
this
.
context
.
refresh
();
assertNotNull
(
this
.
context
.
getBean
(
Reactor
.
class
));
EventBus
eventBus
=
this
.
context
.
getBean
(
EventBus
.
class
);
assertThat
(
eventBus
.
getDispatcher
(),
instanceOf
(
MpscDispatcher
.
class
));
this
.
context
.
close
();
this
.
context
.
close
();
}
}
@Configuration
@Configuration
protected
static
class
TestConfiguration
{
protected
static
class
TestConfiguration
{
@Bean
(
destroyMethod
=
"shutdown"
)
public
Dispatcher
dispatcher
()
{
return
new
MpscDispatcher
(
"test"
);
}
@Bean
@Bean
public
Reactor
reactor
(
Environment
env
)
{
public
EventBus
customEventBus
(
)
{
return
Reactors
.
reactor
().
env
(
env
).
dispatcher
(
Environment
.
RING_BUFFER
).
get
(
);
return
EventBus
.
create
(
dispatcher
()
);
}
}
}
}
...
...
spring-boot-cli/samples/reactor.groovy
View file @
ee7c86a0
...
@@ -7,7 +7,7 @@ import java.util.concurrent.CountDownLatch
...
@@ -7,7 +7,7 @@ import java.util.concurrent.CountDownLatch
class
Runner
implements
CommandLineRunner
{
class
Runner
implements
CommandLineRunner
{
@Autowired
@Autowired
Reactor
reactor
EventBus
eventBus
private
CountDownLatch
latch
=
new
CountDownLatch
(
1
)
private
CountDownLatch
latch
=
new
CountDownLatch
(
1
)
...
@@ -17,7 +17,7 @@ class Runner implements CommandLineRunner {
...
@@ -17,7 +17,7 @@ class Runner implements CommandLineRunner {
}
}
void
run
(
String
...
args
)
{
void
run
(
String
...
args
)
{
reactor
.
notify
(
"hello"
,
Event
.
wrap
(
"Phil"
))
eventBus
.
notify
(
"hello"
,
Event
.
wrap
(
"Phil"
))
log
.
info
"Notified Phil"
log
.
info
"Notified Phil"
latch
.
await
()
latch
.
await
()
}
}
...
@@ -34,7 +34,7 @@ class Runner implements CommandLineRunner {
...
@@ -34,7 +34,7 @@ class Runner implements CommandLineRunner {
class
Greeter
{
class
Greeter
{
@Autowired
@Autowired
Reactor
reactor
EventBus
eventBus
@Autowired
@Autowired
private
CountDownLatch
latch
private
CountDownLatch
latch
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/autoconfigure/ReactorCompilerAutoConfiguration.java
View file @
ee7c86a0
...
@@ -32,29 +32,28 @@ public class ReactorCompilerAutoConfiguration extends CompilerAutoConfiguration
...
@@ -32,29 +32,28 @@ public class ReactorCompilerAutoConfiguration extends CompilerAutoConfiguration
@Override
@Override
public
boolean
matches
(
ClassNode
classNode
)
{
public
boolean
matches
(
ClassNode
classNode
)
{
return
AstUtils
.
hasAtLeastOneAnnotation
(
classNode
,
"EnableReactor"
)
return
AstUtils
.
hasAtLeastOneAnnotation
(
classNode
,
"EnableReactor"
)
||
AstUtils
.
hasAtLeastOneFieldOrMethod
(
classNode
,
"
Reactor
"
);
||
AstUtils
.
hasAtLeastOneFieldOrMethod
(
classNode
,
"
EventBus
"
);
}
}
@Override
@Override
public
void
applyDependencies
(
DependencyCustomizer
dependencies
)
{
public
void
applyDependencies
(
DependencyCustomizer
dependencies
)
{
dependencies
.
ifAnyMissingClasses
(
"reactor.
core.Reactor
"
)
dependencies
.
ifAnyMissingClasses
(
"reactor.
bus.EventBus
"
)
.
add
(
"reactor-spring-context"
,
false
).
add
(
"reactor-spring-core"
,
false
)
.
add
(
"reactor-spring-context"
,
false
).
add
(
"reactor-spring-core"
,
false
)
.
add
(
"reactor-
core
"
);
.
add
(
"reactor-
bus"
).
add
(
"reactor-stream
"
);
}
}
@Override
@Override
public
void
applyImports
(
ImportCustomizer
imports
)
{
public
void
applyImports
(
ImportCustomizer
imports
)
{
imports
.
addImports
(
"reactor.
core.Reactor"
,
"reactor.core.spec.Reactors
"
,
imports
.
addImports
(
"reactor.
bus.Bus"
,
"reactor.bus.Event
"
,
"reactor.
core.Observable"
,
"reactor.event.Event
"
,
"reactor.
bus.EventBus"
,
"reactor.fn.Function"
,
"reactor.fn.Functions
"
,
"reactor.f
unction.Functions"
,
"reactor.function.Predicates
"
,
"reactor.f
n.Predicate"
,
"reactor.fn.Predicates"
,
"reactor.fn.Supplier
"
,
"reactor.f
unction.Suppliers
"
,
"reactor.f
n.Suppliers"
,
"reactor.spring.context.annotation.Consumer
"
,
"reactor.spring.context.annotation.
Consumer
"
,
"reactor.spring.context.annotation.
ReplyTo
"
,
"reactor.spring.context.annotation.Selector"
,
"reactor.spring.context.annotation.Selector"
,
"reactor.spring.context.annotation.SelectorType"
,
"reactor.spring.context.annotation.SelectorType"
,
"reactor.spring.context.annotation.ReplyTo"
,
"reactor.spring.context.config.EnableReactor"
)
"reactor.spring.context.config.EnableReactor"
)
.
addStarImports
(
"reactor.
event
.selector.Selectors"
)
.
addStarImports
(
"reactor.
bus
.selector.Selectors"
)
.
addImport
(
"ReactorEnvironment"
,
"reactor.
core.
Environment"
);
.
addImport
(
"ReactorEnvironment"
,
"reactor.Environment"
);
}
}
}
}
spring-boot-cli/test-samples/integration_auto_test.groovy
View file @
ee7c86a0
...
@@ -3,11 +3,11 @@
...
@@ -3,11 +3,11 @@
class
RestTests
{
class
RestTests
{
@Autowired
@Autowired
Reactor
reactor
EventBus
eventBus
@Test
@Test
void
test
()
{
void
test
()
{
assertNotNull
(
reactor
)
assertNotNull
(
eventBus
)
}
}
}
}
spring-boot-dependencies/pom.xml
View file @
ee7c86a0
...
@@ -110,8 +110,8 @@
...
@@ -110,8 +110,8 @@
<mysql.version>
5.1.34
</mysql.version>
<mysql.version>
5.1.34
</mysql.version>
<nekohtml.version>
1.9.21
</nekohtml.version>
<nekohtml.version>
1.9.21
</nekohtml.version>
<postgresql.version>
9.4-1201-jdbc41
</postgresql.version>
<postgresql.version>
9.4-1201-jdbc41
</postgresql.version>
<reactor.version>
1.1.6.RELEASE
</reactor.version>
<reactor.version>
2.0.1.BUILD-SNAPSHOT
</reactor.version>
<reactor-spring.version>
1.1.3.RELEASE
</reactor-spring.version>
<reactor-spring.version>
2.0.1.BUILD-SNAPSHOT
</reactor-spring.version>
<sendgrid.version>
2.1.0
</sendgrid.version>
<sendgrid.version>
2.1.0
</sendgrid.version>
<servlet-api.version>
3.1.0
</servlet-api.version>
<servlet-api.version>
3.1.0
</servlet-api.version>
<simple-json.version>
1.1.1
</simple-json.version>
<simple-json.version>
1.1.1
</simple-json.version>
...
@@ -624,6 +624,61 @@
...
@@ -624,6 +624,61 @@
<artifactId>
metrics-servlets
</artifactId>
<artifactId>
metrics-servlets
</artifactId>
<version>
${dropwizard-metrics.version}
</version>
<version>
${dropwizard-metrics.version}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
io.projectreactor
</groupId>
<artifactId>
reactor-bus
</artifactId>
<version>
${reactor.version}
</version>
</dependency>
<dependency>
<groupId>
io.projectreactor
</groupId>
<artifactId>
reactor-core
</artifactId>
<version>
${reactor.version}
</version>
</dependency>
<dependency>
<groupId>
io.projectreactor
</groupId>
<artifactId>
reactor-groovy
</artifactId>
<version>
${reactor.version}
</version>
</dependency>
<dependency>
<groupId>
io.projectreactor
</groupId>
<artifactId>
reactor-groovy-extensions
</artifactId>
<version>
${reactor.version}
</version>
</dependency>
<dependency>
<groupId>
io.projectreactor
</groupId>
<artifactId>
reactor-logback
</artifactId>
<version>
${reactor.version}
</version>
</dependency>
<dependency>
<groupId>
io.projectreactor
</groupId>
<artifactId>
reactor-net
</artifactId>
<version>
${reactor.version}
</version>
</dependency>
<dependency>
<groupId>
io.projectreactor
</groupId>
<artifactId>
reactor-stream
</artifactId>
<version>
${reactor.version}
</version>
</dependency>
<dependency>
<groupId>
io.projectreactor.spring
</groupId>
<artifactId>
reactor-spring-context
</artifactId>
<version>
${reactor-spring.version}
</version>
</dependency>
<dependency>
<groupId>
io.projectreactor.spring
</groupId>
<artifactId>
reactor-spring-core
</artifactId>
<version>
${reactor-spring.version}
</version>
</dependency>
<dependency>
<groupId>
io.projectreactor.spring
</groupId>
<artifactId>
reactor-spring-messaging
</artifactId>
<version>
${reactor-spring.version}
</version>
</dependency>
<dependency>
<groupId>
io.projectreactor.spring
</groupId>
<artifactId>
reactor-spring-webmvc
</artifactId>
<version>
${reactor-spring.version}
</version>
</dependency>
<dependency>
<dependency>
<groupId>
io.undertow
</groupId>
<groupId>
io.undertow
</groupId>
<artifactId>
undertow-core
</artifactId>
<artifactId>
undertow-core
</artifactId>
...
@@ -1250,51 +1305,6 @@
...
@@ -1250,51 +1305,6 @@
<artifactId>
postgresql
</artifactId>
<artifactId>
postgresql
</artifactId>
<version>
${postgresql.version}
</version>
<version>
${postgresql.version}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
org.projectreactor
</groupId>
<artifactId>
reactor-core
</artifactId>
<version>
${reactor.version}
</version>
</dependency>
<dependency>
<groupId>
org.projectreactor
</groupId>
<artifactId>
reactor-groovy
</artifactId>
<version>
${reactor.version}
</version>
</dependency>
<dependency>
<groupId>
org.projectreactor
</groupId>
<artifactId>
reactor-groovy-extensions
</artifactId>
<version>
${reactor.version}
</version>
</dependency>
<dependency>
<groupId>
org.projectreactor
</groupId>
<artifactId>
reactor-logback
</artifactId>
<version>
${reactor.version}
</version>
</dependency>
<dependency>
<groupId>
org.projectreactor
</groupId>
<artifactId>
reactor-net
</artifactId>
<version>
${reactor.version}
</version>
</dependency>
<dependency>
<groupId>
org.projectreactor.spring
</groupId>
<artifactId>
reactor-spring-context
</artifactId>
<version>
${reactor-spring.version}
</version>
</dependency>
<dependency>
<groupId>
org.projectreactor.spring
</groupId>
<artifactId>
reactor-spring-core
</artifactId>
<version>
${reactor-spring.version}
</version>
</dependency>
<dependency>
<groupId>
org.projectreactor.spring
</groupId>
<artifactId>
reactor-spring-messaging
</artifactId>
<version>
${reactor-spring.version}
</version>
</dependency>
<dependency>
<groupId>
org.projectreactor.spring
</groupId>
<artifactId>
reactor-spring-webmvc
</artifactId>
<version>
${reactor-spring.version}
</version>
</dependency>
<dependency>
<dependency>
<groupId>
org.slf4j
</groupId>
<groupId>
org.slf4j
</groupId>
<artifactId>
jcl-over-slf4j
</artifactId>
<artifactId>
jcl-over-slf4j
</artifactId>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment