Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easier setup of JerseyServer #58

Open
jogardi opened this issue Jun 12, 2017 · 1 comment
Open

Easier setup of JerseyServer #58

jogardi opened this issue Jun 12, 2017 · 1 comment

Comments

@jogardi
Copy link

jogardi commented Jun 12, 2017

The maven-simplest example used something like the following code to setup the Jersey Server.

    val locator = ServiceLocatorUtilities.bind(HK2JerseyBinder(), HK2VertxBinder(vertx),
                                                AutowiredBinder(appCtx))
    val server = locator.getService(JerseyServer::class.java)`

Since HK2VertxBinder is not in the vert-jersey artifact I had to add a bunch of dependencies and do some debugging in order to get it. I was thinking setup would be easier if there was a static factory method for DefaultJerseyServer. That way a JerseyServer could be instantiated with one line. I really like the flexibility of dependency injection so I think the method should have Binder... as a parameter.

I also think that there should be documentation of how we can directly access the ResourceConfig.

@jogardi
Copy link
Author

jogardi commented Jun 12, 2017

Here is one way we could do it:
https://gist.github.com/jgleoj23/8ad11e77a0aac1c80ac98f3a3d4f7081

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant