Start building against Reactor 2.0.1 snapshots

See gh-2719
This commit is contained in:
Andy Wilkinson
2015-04-27 13:47:42 +01:00
parent 681894a1f3
commit ee7c86a07d
7 changed files with 104 additions and 84 deletions

View File

@@ -7,7 +7,7 @@ import java.util.concurrent.CountDownLatch
class Runner implements CommandLineRunner {
@Autowired
Reactor reactor
EventBus eventBus
private CountDownLatch latch = new CountDownLatch(1)
@@ -17,7 +17,7 @@ class Runner implements CommandLineRunner {
}
void run(String... args) {
reactor.notify("hello", Event.wrap("Phil"))
eventBus.notify("hello", Event.wrap("Phil"))
log.info "Notified Phil"
latch.await()
}
@@ -34,7 +34,7 @@ class Runner implements CommandLineRunner {
class Greeter {
@Autowired
Reactor reactor
EventBus eventBus
@Autowired
private CountDownLatch latch

View File

@@ -32,29 +32,28 @@ public class ReactorCompilerAutoConfiguration extends CompilerAutoConfiguration
@Override
public boolean matches(ClassNode classNode) {
return AstUtils.hasAtLeastOneAnnotation(classNode, "EnableReactor")
|| AstUtils.hasAtLeastOneFieldOrMethod(classNode, "Reactor");
|| AstUtils.hasAtLeastOneFieldOrMethod(classNode, "EventBus");
}
@Override
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-core");
.add("reactor-bus").add("reactor-stream");
}
@Override
public void applyImports(ImportCustomizer imports) {
imports.addImports("reactor.core.Reactor", "reactor.core.spec.Reactors",
"reactor.core.Observable", "reactor.event.Event",
"reactor.function.Functions", "reactor.function.Predicates",
"reactor.function.Suppliers",
"reactor.spring.context.annotation.Consumer",
imports.addImports("reactor.bus.Bus", "reactor.bus.Event",
"reactor.bus.EventBus", "reactor.fn.Function", "reactor.fn.Functions",
"reactor.fn.Predicate", "reactor.fn.Predicates", "reactor.fn.Supplier",
"reactor.fn.Suppliers", "reactor.spring.context.annotation.Consumer",
"reactor.spring.context.annotation.ReplyTo",
"reactor.spring.context.annotation.Selector",
"reactor.spring.context.annotation.SelectorType",
"reactor.spring.context.annotation.ReplyTo",
"reactor.spring.context.config.EnableReactor")
.addStarImports("reactor.event.selector.Selectors")
.addImport("ReactorEnvironment", "reactor.core.Environment");
.addStarImports("reactor.bus.selector.Selectors")
.addImport("ReactorEnvironment", "reactor.Environment");
}
}

View File

@@ -3,11 +3,11 @@
class RestTests {
@Autowired
Reactor reactor
EventBus eventBus
@Test
void test() {
assertNotNull(reactor)
assertNotNull(eventBus)
}
}