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

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

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

origin: com.b2international.snowowl/com.b2international.snowowl.snomed.api.impl

private SnomedBrowserService getBrowserService() {
  if (browserService == null) {
    browserService = (SnomedBrowserService) ApplicationContext.getInstance().getServiceChecked(ISnomedBrowserService.class);
  }
  return Preconditions.checkNotNull(browserService, "browserService cannot be null!");
}
origin: com.b2international.snowowl/com.b2international.snowowl.snomed.api.impl

private IEventBus getBus() {
  if (bus == null) {
    bus = ApplicationContext.getInstance().getServiceChecked(IEventBus.class);
  }
  return Preconditions.checkNotNull(bus, "bus cannot be null!");
}
origin: com.b2international.snowowl/com.b2international.snowowl.core

/**
 * Returns the {@link PreferencesService} from the
 * {@link ApplicationContext}.
 * 
 * @return
 */
public PreferencesService preferences() {
  return services().getServiceChecked(PreferencesService.class);
}
origin: com.b2international.snowowl/com.b2international.snowowl.snomed.api.rest

@Bean
public FileRegistry fileRegistry() {
  return com.b2international.snowowl.core.ApplicationContext.getInstance().getServiceChecked(FileRegistry.class);
}

origin: com.b2international.snowowl/com.b2international.snowowl.snomed.api.rest

@Bean
@Scope(value=ConfigurableBeanFactory.SCOPE_PROTOTYPE, proxyMode=ScopedProxyMode.TARGET_CLASS)
public IEventBus eventBus() {
  return com.b2international.snowowl.core.ApplicationContext.getInstance().getServiceChecked(IEventBus.class);
}

origin: com.b2international.snowowl/com.b2international.snowowl.snomed.api.impl

private IEventBus getBus() {
  return ApplicationContext.getInstance().getServiceChecked(IEventBus.class);
}
origin: com.b2international.snowowl/com.b2international.snowowl.core

@Override
public <T> T service(final Class<T> type) {
  return services().getServiceChecked(type);
}

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

public FetchUsersIndication(SignalProtocol<?> protocol) {
  super(protocol, Net4jProtocolConstants.FETCH_USERS_SIGNAL);
  manager = ApplicationContext.getInstance().getServiceChecked(IUserManager.class);
}
origin: com.b2international.snowowl/com.b2international.snowowl.datastore.server

private IDatastoreOperationLockManager getLockManager() {
  return getContext().getServiceChecked(IDatastoreOperationLockManager.class);
}

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

private SnowOwlConfiguration getSnowOwlConfiguration() {
  return ApplicationContext.getInstance().getServiceChecked(SnowOwlConfiguration.class);
}

origin: com.b2international.snowowl/com.b2international.snowowl.snomed.api.impl

@PreDestroy
protected void shutdown() {
  if (null != remoteJobSubscription) {
    remoteJobSubscription.dispose();
    remoteJobSubscription = null;
  }
  if (null != executorService) {
    executorService.shutdown();
    executorService = null;
  }
  
  if (null != indexService) {
    ApplicationContext.getInstance().getServiceChecked(SingleDirectoryIndexManager.class).unregisterIndex(indexService);
    try {
      Closeables.close(indexService, true);
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    indexService = null;
  }
  
  LOG.info("Classification service shut down.");
}
origin: com.b2international.snowowl/com.b2international.snowowl.datastore.server

final IDatastoreOperationLockManager lockManager = ApplicationContext.getInstance().getServiceChecked(IDatastoreOperationLockManager.class);
origin: com.b2international.snowowl/com.b2international.snowowl.snomed.api.impl

private Integer getMaxReasonerRuns() {
  if (maxReasonerRuns == null) {
    maxReasonerRuns = ApplicationContext.getInstance().getServiceChecked(SnowOwlConfiguration.class)
        .getModuleConfig(SnomedCoreConfiguration.class).getClassificationConfig().getMaxReasonerRuns();
  }
  return Preconditions.checkNotNull(maxReasonerRuns, "maximum number of reasoner runs must be configured");
}
origin: com.b2international.snowowl/com.b2international.snowowl.snomed.api.rest

@Bean
public Integer maxReasonerRuns() {
  return com.b2international.snowowl.core.ApplicationContext.getInstance()
      .getServiceChecked(SnowOwlConfiguration.class)
      .getModuleConfig(SnomedCoreConfiguration.class)
      .getClassificationConfig()
      .getMaxReasonerRuns();
}

origin: com.b2international.snowowl/com.b2international.snowowl.snomed.api.impl

@PostConstruct
protected void init() {
  
  LOG.info("Initializing classification service; keeping indexed data for {} recent run(s).", getMaxReasonerRuns()); 
  
  final File dir = new File(new File(SnowOwlApplication.INSTANCE.getEnviroment().getDataDirectory(), "indexes"), "classification_runs");
  indexService = new ClassificationRunIndex(dir);
  ApplicationContext.getInstance().getServiceChecked(SingleDirectoryIndexManager.class).registerIndex(indexService);
  try {
    indexService.trimIndex(getMaxReasonerRuns());
    indexService.invalidateClassificationRuns();
  } catch (final IOException e) {
    LOG.error("Failed to run housekeeping tasks for the classification index.", e);
  }
  // TODO: common ExecutorService for asynchronous work?
  executorService = Executors.newCachedThreadPool();
  remoteJobSubscription = getNotifications()
      .ofType(RemoteJobNotification.class)
      .subscribe(this::onRemoteJobNotification);
  
  initialized = true;
}

com.b2international.snowowl.coreApplicationContextgetServiceChecked

Javadoc

Returns with the service instance associated with the passed in service interface. May throw runtime exception if the service associated with the passed in interface is not registered or null.

Popular methods of ApplicationContext

  • getInstance
    Factory method.
  • getServiceForClass
    Returns with the service registered for the class argument key from the shared application context.
  • getService
  • registerService
  • 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

  • Creating JSON documents from java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • runOnUiThread (Activity)
  • addToBackStack (FragmentTransaction)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Github Copilot alternatives
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