use of com.adeptj.modules.jaxrs.resteasy.internal.JaxRSProviderTracker in project adeptj-modules by AdeptJ.
the class JaxRSWhiteboardManager method start.
/**
* Bootstrap the RESTEasy Framework, open ServiceTracker for JAX-RS providers and resources.
*
* @param servletConfig the {@link ServletConfig} provided by OSGi HttpService.
* @param vf the Java Bean Validation's {@link ValidatorFactory}
*/
public void start(ServletConfig servletConfig, ValidatorFactory vf) {
try {
final long startTime = System.nanoTime();
LOGGER.info("Bootstrapping JAX-RS Runtime!!");
this.resteasyDispatcher = new HttpServlet30Dispatcher();
this.resteasyDispatcher.init(servletConfig);
Dispatcher dispatcher = this.resteasyDispatcher.getDispatcher();
ResteasyProviderFactory providerFactory = dispatcher.getProviderFactory();
ResteasyUtil.removeInternalValidators(providerFactory);
ResteasyUtil.registerInternalProviders(providerFactory, this.config, vf);
this.serviceTrackers.add(new JaxRSProviderTracker(this.context, providerFactory));
this.serviceTrackers.add(new JaxRSResourceTracker(this.context, dispatcher.getRegistry()));
LOGGER.info(JAXRS_RT_BOOTSTRAP_MSG, NANOSECONDS.toMillis(System.nanoTime() - startTime));
} catch (Exception ex) {
// NOSONAR
LOGGER.error("Exception while bootstrapping JAX-RS Runtime!!", ex);
throw new JaxRSBootstrapException(ex.getMessage(), ex);
}
}
Aggregations