Skip to content

Commit

Permalink
RESTEasy Spring Boot starter integration
Browse files Browse the repository at this point in the history
Allowing ResteasyDeployment to use previously set dispatcher
Also adding an extra constructor to SynchronousDispatcher with pre-set ResourceMethodRegistry object
This is necessary for RESTEasy Spring Boot starter
See https://issues.jboss.org/browse/RESTEASY-1305
See https://github.com/paypal/resteasy-spring-boot
  • Loading branch information
fabiocarvalho777 committed Feb 23, 2016
1 parent 53e39f1 commit 18f5a2c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Expand Up @@ -66,6 +66,12 @@ public SynchronousDispatcher(ResteasyProviderFactory providerFactory)
defaultContextObjects.put(InternalDispatcher.class, InternalDispatcher.getInstance());
}

public SynchronousDispatcher(ResteasyProviderFactory providerFactory, ResourceMethodRegistry registry) {
this(providerFactory);
this.registry = registry;
defaultContextObjects.put(Registry.class, registry);
}

public ResteasyProviderFactory getProviderFactory()
{
return providerFactory;
Expand Down
Expand Up @@ -118,9 +118,11 @@ public void start()
}
else
{
SynchronousDispatcher dis = new SynchronousDispatcher(providerFactory);
dis.getUnwrappedExceptions().addAll(unwrappedExceptions);
dispatcher = dis;
if(dispatcher == null) {
SynchronousDispatcher dis = new SynchronousDispatcher(providerFactory);
dis.getUnwrappedExceptions().addAll(unwrappedExceptions);
dispatcher = dis;
}
}
registry = dispatcher.getRegistry();
if (widerRequestMatching)
Expand Down

0 comments on commit 18f5a2c

Please sign in to comment.