use of org.openremote.container.security.CORSFilter in project openremote by openremote.
the class WebService method createResteasyDeployment.
protected ResteasyDeployment createResteasyDeployment(Container container) {
if (getApiClasses() == null && getApiSingletons() == null)
return null;
WebApplication webApplication = new WebApplication(container, getApiClasses(), getApiSingletons());
ResteasyDeployment resteasyDeployment = new ResteasyDeployment();
resteasyDeployment.setApplication(webApplication);
// Custom providers (these only apply to server applications, not client calls)
resteasyDeployment.getProviders().add(new WebServiceExceptions.DefaultResteasyExceptionMapper(devMode));
resteasyDeployment.getProviders().add(new WebServiceExceptions.ForbiddenResteasyExceptionMapper(devMode));
resteasyDeployment.getProviders().add(new JacksonConfig());
resteasyDeployment.getProviders().add(new CORSFilter());
resteasyDeployment.getProviders().add(new GZIPEncodingInterceptor(!container.isDevMode()));
resteasyDeployment.getActualProviderClasses().add(ModelValueMessageBodyConverter.class);
resteasyDeployment.getActualProviderClasses().add(AlreadyGzippedWriterInterceptor.class);
resteasyDeployment.getActualProviderClasses().add(ClientErrorExceptionHandler.class);
return resteasyDeployment;
}
Aggregations