Search in sources :

Example 1 with PrimitiveCollectionModule

use of com.b2international.collections.PrimitiveCollectionModule in project snow-owl by b2ihealthcare.

the class RepositoryPlugin method init.

@Override
public void init(SnowOwlConfiguration configuration, Environment env) throws Exception {
    final IManagedContainer container = env.container();
    final boolean gzip = configuration.isGzip();
    final RpcConfiguration rpcConfig = configuration.getModuleConfig(RpcConfiguration.class);
    LOG.debug("Preparing RPC communication (config={},gzip={})", rpcConfig, gzip);
    RpcUtil.prepareContainer(container, rpcConfig, gzip);
    LOG.debug("Preparing EventBus communication (gzip={})", gzip);
    RepositoryConfiguration repositoryConfiguration = configuration.getModuleConfig(RepositoryConfiguration.class);
    env.services().registerService(RepositoryConfiguration.class, repositoryConfiguration);
    int maxThreads = repositoryConfiguration.getMaxThreads();
    EventBusNet4jUtil.prepareContainer(container, gzip, maxThreads);
    env.services().registerService(IEventBus.class, EventBusNet4jUtil.getBus(container, maxThreads));
    LOG.debug("Preparing JSON support");
    final ObjectMapper mapper = JsonSupport.getDefaultObjectMapper();
    mapper.registerModule(new PrimitiveCollectionModule());
    env.services().registerService(ObjectMapper.class, mapper);
    // initialize Notification support
    env.services().registerService(Notifications.class, new Notifications(env.service(IEventBus.class), env.plugins().getCompositeClassLoader()));
    env.services().registerService(RepositoryCommitNotificationSender.class, new RepositoryCommitNotificationSender());
    // initialize Index Settings
    final IndexSettings indexSettings = new IndexSettings();
    indexSettings.putAll(initIndexSettings(env));
    env.services().registerService(IndexSettings.class, indexSettings);
}
Also used : PrimitiveCollectionModule(com.b2international.collections.PrimitiveCollectionModule) IManagedContainer(org.eclipse.net4j.util.container.IManagedContainer) IndexSettings(com.b2international.snowowl.core.config.IndexSettings) RepositoryConfiguration(com.b2international.snowowl.core.config.RepositoryConfiguration) Notifications(com.b2international.snowowl.core.events.Notifications) RpcConfiguration(com.b2international.snowowl.rpc.RpcConfiguration) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Example 2 with PrimitiveCollectionModule

use of com.b2international.collections.PrimitiveCollectionModule in project snow-owl by b2ihealthcare.

the class SnomedValidationIssueDetailTest method configureMapper.

@Override
protected void configureMapper(ObjectMapper mapper) {
    super.configureMapper(mapper);
    mapper.setSerializationInclusion(Include.NON_NULL);
    mapper.registerModule(new PrimitiveCollectionModule());
}
Also used : PrimitiveCollectionModule(com.b2international.collections.PrimitiveCollectionModule)

Example 3 with PrimitiveCollectionModule

use of com.b2international.collections.PrimitiveCollectionModule in project snow-owl by b2ihealthcare.

the class SnomedEclShortcutTest method configureMapper.

@Override
protected void configureMapper(ObjectMapper mapper) {
    super.configureMapper(mapper);
    mapper.setSerializationInclusion(Include.NON_NULL);
    mapper.registerModule(new PrimitiveCollectionModule());
}
Also used : PrimitiveCollectionModule(com.b2international.collections.PrimitiveCollectionModule)

Example 4 with PrimitiveCollectionModule

use of com.b2international.collections.PrimitiveCollectionModule in project snow-owl by b2ihealthcare.

the class SnomedStatedEclEvaluationTest method configureMapper.

@Override
protected void configureMapper(ObjectMapper mapper) {
    super.configureMapper(mapper);
    mapper.setSerializationInclusion(Include.NON_NULL);
    mapper.registerModule(new PrimitiveCollectionModule());
}
Also used : PrimitiveCollectionModule(com.b2international.collections.PrimitiveCollectionModule)

Example 5 with PrimitiveCollectionModule

use of com.b2international.collections.PrimitiveCollectionModule in project snow-owl by b2ihealthcare.

the class BaseSnomedEclEvaluationRequestTest method configureMapper.

@Override
protected void configureMapper(ObjectMapper mapper) {
    super.configureMapper(mapper);
    mapper.setSerializationInclusion(Include.NON_NULL);
    mapper.registerModule(new PrimitiveCollectionModule());
}
Also used : PrimitiveCollectionModule(com.b2international.collections.PrimitiveCollectionModule)

Aggregations

PrimitiveCollectionModule (com.b2international.collections.PrimitiveCollectionModule)8 IndexSettings (com.b2international.snowowl.core.config.IndexSettings)1 RepositoryConfiguration (com.b2international.snowowl.core.config.RepositoryConfiguration)1 Notifications (com.b2international.snowowl.core.events.Notifications)1 RpcConfiguration (com.b2international.snowowl.rpc.RpcConfiguration)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 OverridingMethodsMustInvokeSuper (javax.annotation.OverridingMethodsMustInvokeSuper)1 IManagedContainer (org.eclipse.net4j.util.container.IManagedContainer)1