use of org.glassfish.jersey.jettison.JettisonFeature in project jersey by jersey.
the class CharsetTest method configureClient.
@Override
protected void configureClient(ClientConfig config) {
super.configureClient(config);
config.register(new JettisonFeature());
config.register(MyJaxbContextResolver.class);
}
use of org.glassfish.jersey.jettison.JettisonFeature in project batfish by batfish.
the class Main method initPoolManager.
private static void initPoolManager() {
ResourceConfig rcPool = new ResourceConfig(PoolMgrService.class).register(new JettisonFeature()).register(MultiPartFeature.class).register(CrossDomainFilter.class);
if (_settings.getSslPoolDisable()) {
URI poolMgrUri = UriBuilder.fromUri("http://" + _settings.getPoolBindHost()).port(_settings.getServicePoolPort()).build();
_logger.infof("Starting pool manager at %s\n", poolMgrUri);
GrizzlyHttpServerFactory.createHttpServer(poolMgrUri, rcPool);
} else {
URI poolMgrUri = UriBuilder.fromUri("https://" + _settings.getPoolBindHost()).port(_settings.getServicePoolPort()).build();
_logger.infof("Starting pool manager at %s\n", poolMgrUri);
CommonUtil.startSslServer(rcPool, poolMgrUri, _settings.getSslPoolKeystoreFile(), _settings.getSslPoolKeystorePassword(), _settings.getSslPoolTrustAllCerts(), _settings.getSslPoolTruststoreFile(), _settings.getSslPoolTruststorePassword(), ConfigurationLocator.class, Main.class);
}
_poolManager = new PoolMgr(_settings, _logger);
_poolManager.startPoolManager();
}
use of org.glassfish.jersey.jettison.JettisonFeature in project jersey by jersey.
the class EntityTypesTest method configureClient.
@Override
protected void configureClient(final ClientConfig config) {
super.configureClient(config);
config.register(new JettisonFeature());
}
use of org.glassfish.jersey.jettison.JettisonFeature in project batfish by batfish.
the class Driver method mainRunWorkService.
private static void mainRunWorkService() {
if (_mainSettings.getTracingEnable() && !GlobalTracer.isRegistered()) {
initTracer();
}
String protocol = _mainSettings.getSslDisable() ? "http" : "https";
String baseUrl = String.format("%s://%s", protocol, _mainSettings.getServiceBindHost());
URI baseUri = UriBuilder.fromUri(baseUrl).port(_mainSettings.getServicePort()).build();
_mainLogger.debug(String.format("Starting server at %s\n", baseUri));
ResourceConfig rc = new ResourceConfig(Service.class).register(new JettisonFeature());
if (_mainSettings.getTracingEnable()) {
rc.register(ServerTracingDynamicFeature.class);
}
try {
if (_mainSettings.getSslDisable()) {
GrizzlyHttpServerFactory.createHttpServer(baseUri, rc);
} else {
CommonUtil.startSslServer(rc, baseUri, _mainSettings.getSslKeystoreFile(), _mainSettings.getSslKeystorePassword(), _mainSettings.getSslTrustAllCerts(), _mainSettings.getSslTruststoreFile(), _mainSettings.getSslTruststorePassword(), ConfigurationLocator.class, Driver.class);
}
if (_mainSettings.getCoordinatorRegister()) {
// this function does not return until registration succeeds
registerWithCoordinatorPersistent();
}
if (_mainSettings.getParentPid() > 0) {
if (SystemUtils.IS_OS_WINDOWS) {
_mainLogger.errorf("Parent process monitoring is not supported on Windows. We'll live without it.");
} else {
Executors.newScheduledThreadPool(1).scheduleAtFixedRate(new CheckParentProcessTask(_mainSettings.getParentPid()), 0, PARENT_CHECK_INTERVAL_MS, TimeUnit.MILLISECONDS);
SignalHandler handler = signal -> _mainLogger.infof("BFS: Ignoring signal %s\n", signal);
Signal.handle(new Signal("INT"), handler);
}
}
// sleep indefinitely, check for parent pid and coordinator each time
while (true) {
Thread.sleep(COORDINATOR_CHECK_INTERVAL_MS);
/*
* every time we wake up, we check if the coordinator has polled us recently
* if not, re-register the service. the coordinator might have died and come back.
*/
if (_mainSettings.getCoordinatorRegister() && new Date().getTime() - _lastPollFromCoordinator.getTime() > COORDINATOR_POLL_TIMEOUT_MS) {
// this function does not return until registration succeeds
registerWithCoordinatorPersistent();
}
}
} catch (ProcessingException e) {
String msg = "FATAL ERROR: " + e.getMessage() + "\n";
_mainLogger.error(msg);
System.exit(1);
} catch (Exception ex) {
String stackTrace = ExceptionUtils.getStackTrace(ex);
_mainLogger.error(stackTrace);
System.exit(1);
}
}
Aggregations