use of org.openremote.container.json.JacksonConfig in project openremote by openremote.
the class WebTargetBuilder method initClient.
protected static void initClient() {
if (client != null) {
return;
}
ResteasyClientBuilder clientBuilder = new ResteasyClientBuilder().connectionPoolSize(CONNECTION_POOL_SIZE).connectionCheckoutTimeout(CONNECTION_CHECKOUT_TIMEOUT_MILLISECONDS, TimeUnit.MILLISECONDS).socketTimeout(CONNECTION_TIMEOUT_MILLISECONDS, TimeUnit.MILLISECONDS).establishConnectionTimeout(CONNECTION_TIMEOUT_MILLISECONDS, TimeUnit.MILLISECONDS).register(new JacksonConfig());
if (asyncExecutorService != null) {
clientBuilder.asyncExecutor(asyncExecutorService);
}
client = clientBuilder.build();
}
use of org.openremote.container.json.JacksonConfig 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;
}
use of org.openremote.container.json.JacksonConfig in project openremote by openremote.
the class AbstractHttpServerProtocol method init.
@Override
public void init(Container container) throws Exception {
super.init(container);
this.container = container;
this.devMode = container.isDevMode();
identityService = container.hasService(IdentityService.class) ? container.getService(IdentityService.class) : null;
webService = container.getService(WebService.class);
if (defaultResteasyExceptionMapper == null) {
defaultResteasyExceptionMapper = new WebServiceExceptions.DefaultResteasyExceptionMapper(devMode);
forbiddenResteasyExceptionMapper = new WebServiceExceptions.ForbiddenResteasyExceptionMapper(devMode);
undertowExceptionHandler = new WebServiceExceptions.ServletUndertowExceptionHandler(devMode);
jacksonConfig = new JacksonConfig();
modelValueMessageBodyConverter = new ModelValueMessageBodyConverter();
alreadtGzippedWriterInterceptor = new AlreadyGzippedWriterInterceptor();
clientErrorExceptionHandler = new ClientErrorExceptionHandler();
}
}
Aggregations