Package nl.vpro.rs

Class ResteasyApplication

java.lang.Object
javax.ws.rs.core.Application
nl.vpro.rs.ResteasyApplication

@ApplicationPath("") public class ResteasyApplication extends javax.ws.rs.core.Application
Static helper to expose a dummy JAX-RS Application. Swagger needs such an application to expose the API docs for the given endpoints.

Note, this used to be SwaggerApplication in vpro-shared-swagger. But it's not related to swagger. It has to do with RestEasy.

Since:
2.0
Author:
Roelof Jan Koekoek
  • Constructor Details

    • ResteasyApplication

      public ResteasyApplication()
  • Method Details

    • getInstance

      public static ResteasyApplication getInstance()
    • getClasses

      public Set<Class<?>> getClasses()
      Overrides:
      getClasses in class javax.ws.rs.core.Application
    • getSingletons

      public Set<Object> getSingletons()
      Overrides:
      getSingletons in class javax.ws.rs.core.Application
    • inject

      public static void inject(Object... services)
      Inject Swagger annotated JAX-RS ap's you want to publish. Swagger only calls #getSingletons on the first API documentation request, so you must take care that your services get injected before an application accepts web requests. (Using @PostConstruct on your services is a viable solution)
      Parameters:
      services -
    • classes

      public static void classes(Class<?>... classes)