Skip to content

Commit

Permalink
Keeping server reference within Instance
Browse files Browse the repository at this point in the history
Signed-off-by: Markus KARG <markus@headcrashing.eu>
  • Loading branch information
mkarg committed Jul 15, 2018
1 parent e6a88e0 commit e896a0f
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ public CompletionStage<JAXRS.Instance> bootstrap(final Application application,
final Class<Server> httpServerClass = (Class<Server>) configuration
.property(ServerProperties.HTTP_SERVER_CLASS);

final Server server = ServerFactory.createServer(httpServerClass, application, configuration);

return new JAXRS.Instance() {
private final Server server = ServerFactory.createServer(httpServerClass, application, configuration);

@Override
public final Configuration configuration() {
return new JAXRS.Configuration() {
Expand All @@ -125,7 +125,7 @@ public final Object property(final String name) {

@Override
public final CompletionStage<StopResult> stop() {
return server.stop().thenApply(nativeResult -> new StopResult() {
return this.server.stop().thenApply(nativeResult -> new StopResult() {

@Override
public final <T> T unwrap(final Class<T> nativeClass) {
Expand All @@ -136,8 +136,8 @@ public final <T> T unwrap(final Class<T> nativeClass) {

@Override
public final <T> T unwrap(final Class<T> nativeClass) {
return nativeClass.isInstance(server) ? nativeClass.cast(server)
: server.unwrap(nativeClass);
return nativeClass.isInstance(this.server) ? nativeClass.cast(this.server)
: this.server.unwrap(nativeClass);
}
};
});
Expand Down

0 comments on commit e896a0f

Please sign in to comment.