Tabnine Logo
ApplicationContext.registerService
Code IndexAdd Tabnine to your IDE (free)

How to use
registerService
method
in
com.b2international.snowowl.core.ApplicationContext

Best Java code snippets using com.b2international.snowowl.core.ApplicationContext.registerService (Showing top 12 results out of 315)

origin: com.b2international.snowowl/com.b2international.snowowl.core

@Override
public void init(SnowOwlConfiguration configuration, Environment env) {
  final PreferencesService preferences = env.preferences(); 
  
  final ClientPreferences cdoClientConfiguration = new ClientPreferences(preferences);
  env.services().registerService(ClientPreferences.class, cdoClientConfiguration);
  final LoginConfiguration loginConfiguration = new LoginConfiguration(preferences);
  env.services().registerService(LoginConfiguration.class, loginConfiguration);
  
  env.services().registerService(CoreTerminologyBroker.class, CoreTerminologyBroker.getInstance());
  
  if (configuration.getModuleConfig(MetricsConfiguration.class).isEnabled()) {
    env.services().registerService(MetricsProvider.class, new DefaultMetricsProvider());
  } else {
    env.services().registerService(MetricsProvider.class, MetricsProvider.NOOP);
  }
  env.services().registerService(Metrics.class, Metrics.NOOP);
  
  // TODO support initial values for feature toggles
  env.services().registerService(FeatureToggles.class, new FeatureToggles());
}
origin: com.b2international.snowowl/com.b2international.snowowl.core

public Environment(final Bootstrap bootstrap, final SnowOwlConfiguration configuration) throws Exception {
  initializeEnvironmentDirectories(bootstrap.getInstallationDirectory(), configuration);
  services().registerService(PreferencesService.class,
      PlatformUtil.getPreferencesService(bootstrap.getBundleContext()));
  services().registerService(FileBasedPreferencesService.class,
      new FileBasedPreferencesService(getConfigDirectory()));
  services().registerService(SnowOwlConfiguration.class, configuration);
}

origin: com.b2international.snowowl/com.b2international.snowowl.datastore.server

@Override
protected boolean initService() throws SnowowlServiceException {
  if (!isRunningInEmbeddedMode()) {
    return false;
  }
  final HistoryServiceImpl service = new HistoryServiceImpl();
  ApplicationContext.getInstance().registerService(HistoryService.class, service);
  final ClassLoader classLoader = service.getClass().getClassLoader();
  getInitialServerSession(INSTANCE).registerClassLoader(HistoryService.class, classLoader);
  return true;
}
origin: com.b2international.snowowl/com.b2international.snowowl.snomed.api.rest

@Bean
public ISnomedBrowserAxiomService axiomService() {
  SnomedBrowserAxiomService axiomService = new SnomedBrowserAxiomService();
  if (!ApplicationContext.getInstance().exists(ISnomedBrowserAxiomService.class)) {
    ApplicationContext.getInstance().registerService(ISnomedBrowserAxiomService.class, axiomService);
  }
  return axiomService; 
}

origin: com.b2international.snowowl/com.b2international.snowowl.datastore.server

@Override
protected boolean initService() throws SnowowlServiceException {
  
  if (!isRunningInEmbeddedMode()) {
    return false;
  }
  
  final VersionCompareExporterServiceImpl service = new VersionCompareExporterServiceImpl();
  ApplicationContext.getInstance().registerService(VersionCompareExporterService.class, service);
  
  RpcUtil.getInitialServerSession(IPluginContainer.INSTANCE).registerClassLoader(VersionCompareExporterService.class, service.getClass().getClassLoader());
  
  return true;
}
origin: com.b2international.snowowl/com.b2international.snowowl.datastore.server

@Override
protected boolean initService() throws SnowowlServiceException {
  
  if (!isRunningInEmbeddedMode()) {
    return false;
  }
  
  final VersionCompareServiceImpl service = new VersionCompareServiceImpl();
  ApplicationContext.getInstance().registerService(VersionCompareService.class, service);
  
  RpcUtil.getInitialServerSession(IPluginContainer.INSTANCE).registerClassLoader(VersionCompareService.class, service.getClass().getClassLoader());
  
  return true;
}
origin: com.b2international.snowowl/com.b2international.snowowl.datastore.server

@Override
protected boolean initService() throws SnowowlServiceException {
  
  if (!isRunningInEmbeddedMode()) {
    return false;
  }
  
  final CodeSystemServiceImpl service = new CodeSystemServiceImpl();
  ApplicationContext.getInstance().registerService(CodeSystemService.class, service);
  
  RpcUtil.getInitialServerSession(IPluginContainer.INSTANCE).registerClassLoader(CodeSystemService.class, service.getClass().getClassLoader());
  
  return true;
}
origin: com.b2international.snowowl/com.b2international.snowowl.datastore.server

@Override
protected boolean initService() throws SnowowlServiceException {
  
  if (!isRunningInEmbeddedMode()) {
    return false;
  }
  final TagService service = new TagService();
  ApplicationContext.getInstance().registerService(ITagService.class, service);
  
  RpcUtil.getInitialServerSession(IPluginContainer.INSTANCE).registerClassLoader(ITagService.class, service.getClass().getClassLoader());
  
  return true;
}
origin: com.b2international.snowowl/com.b2international.snowowl.datastore.server

@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);
  EventBusNet4jUtil.prepareContainer(container, gzip);
  env.services().registerService(IEventBus.class, EventBusNet4jUtil.getBus(container));
  LOG.debug("Preparing JSON support");
  final ObjectMapper mapper = JsonSupport.getDefaultObjectMapper();
  mapper.registerModule(new PrimitiveCollectionModule());
  env.services().registerService(ObjectMapper.class, mapper);
}
origin: com.b2international.snowowl/com.b2international.snowowl.datastore.server

private void initializeRequestSupport(Environment env, int numberOfWorkers) {
  final IEventBus events = env.service(IEventBus.class);
  final Handlers handlers = new Handlers(numberOfWorkers);
  final ClassLoader classLoader = env.service(RepositoryClassLoaderProviderRegistry.class).getClassLoader();
  for (int i = 0; i < numberOfWorkers; i++) {
    handlers.registerHandler(Request.ADDRESS, new ApiRequestHandler(env, classLoader));
  }
  // register number of cores event bridge/pipe between events and handlers
  for (int i = 0; i < Runtime.getRuntime().availableProcessors(); i++) {
    events.registerHandler(Request.ADDRESS, new Pipe(handlers, Request.ADDRESS));
  }
  env.services().registerService(Handlers.class, handlers);
  env.services().registerService(RepositoryContextProvider.class, new DefaultRepositoryContextProvider(env.service(RepositoryManager.class)));
}
origin: com.b2international.snowowl/com.b2international.snowowl.datastore.server

private void initializeJobSupport(Environment env, SnowOwlConfiguration configuration) {
  final Index index = Indexes.createIndex("jobs", env.service(ObjectMapper.class), new Mappings(RemoteJobEntry.class), env.service(IndexSettings.class));
  // TODO make this configurable
  final long defaultJobCleanUpInterval = TimeUnit.MINUTES.toMillis(1);
  env.services()
    .registerService(RemoteJobTracker.class, 
      new RemoteJobTracker(
        index, 
        env.service(IEventBus.class), 
        env.service(ObjectMapper.class), 
        defaultJobCleanUpInterval)
    );
}

origin: com.b2international.snowowl/com.b2international.snowowl.datastore.server

  manager.addListener(new VersionProcessor());
  env.services().registerService(IApplicationSessionManager.class, manager);
  env.services().registerService(InternalApplicationSessionManager.class, manager);
  env.services().registerService(ICDORepositoryManager.class, cdoRepositoryManager);
  env.services().registerService(SingleDirectoryIndexManager.class, new SingleDirectoryIndexManagerImpl());
  env.services().registerService(RepositoryManager.class, new DefaultRepositoryManager());
  env.services().registerService(EditingContextFactoryProvider.class, new ExtensionBasedEditingContextFactoryProvider());
env.services().registerService(RepositoryClassLoaderProviderRegistry.class, new ExtensionBasedRepositoryClassLoaderProviderRegistry());
final ClassLoader classLoader = env.service(RepositoryClassLoaderProviderRegistry.class).getClassLoader();
env.services().registerService(Notifications.class, new Notifications(env.service(IEventBus.class), classLoader));
com.b2international.snowowl.coreApplicationContextregisterService

Popular methods of ApplicationContext

  • getInstance
    Factory method.
  • getServiceForClass
    Returns with the service registered for the class argument key from the shared application context.
  • getService
  • getServiceChecked
    Returns with the service instance associated with the passed in service interface. May throw runtime
  • isServerMode
    Returns true if the application for the current application context is running in server mode. Other
  • <init>
  • addServiceListener
  • checkStrictServices
    Checks the availability of the registered services strictly, which means that null implementations
  • dispose
  • exists
    Returns true if a the service given with it interface is registered to the application context with
  • getServiceEntry
  • getServiceInfo
    Initializes the project specific MultiStatus object for generic serviceablility support for the plug
  • getServiceEntry,
  • getServiceInfo

Popular in Java

  • Reading from database using SQL prepared statement
  • runOnUiThread (Activity)
  • onCreateOptionsMenu (Activity)
  • setRequestProperty (URLConnection)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now