Improved module name <functional-area>-<Command|Query>....

Standalone services now use the Event Store Server (many tests still use the embedded server)
This commit is contained in:
Chris Richardson
2015-04-14 19:08:07 -07:00
parent d166c9b852
commit 2e31853ad2
150 changed files with 1237 additions and 109 deletions

View File

@@ -0,0 +1,11 @@
apply plugin: 'java'
dependencies {
compile project(":testutil")
compile "org.springframework.boot:spring-boot-starter-web:$springBootVersion"
testCompile "junit:junit:4.11"
testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
}

View File

@@ -0,0 +1,33 @@
package net.chrisrichardson.eventstore.javaexamples.banking.web.util;
import org.springframework.web.context.request.async.DeferredResult;
import rx.Observable;
import rx.Subscriber;
import java.util.concurrent.atomic.AtomicReference;
public class DeferredUtils {
public static <T> DeferredResult<T> toDeferredResult(Observable<T> o) {
final DeferredResult<T> d = new DeferredResult<T>();
final AtomicReference<T> r = new AtomicReference<T>();
o.single().subscribe(new Subscriber<T>() {
@Override
public void onCompleted() {
d.setResult(r.get());
}
@Override
public void onError(Throwable e) {
d.setErrorResult(e);
}
@Override
public void onNext(T t) {
r.set(t);
}
});
return d;
}
}