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

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

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

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

  private ApplicationContext getContext() {
    return ApplicationContext.getInstance();
  }
}
origin: com.b2international.snowowl/com.b2international.snowowl.datastore.server

  @Override
  public <T> T getServiceImplementation(final Class<T> serviceInterface) {
    return ApplicationContext.getInstance().getService(serviceInterface);
  }
}
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.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.datastore.server

  private ICDORepositoryManager getRepositoryManager() {
    return ApplicationContext.getInstance().getService(ICDORepositoryManager.class);
  }
}
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

private static ICDORepository getRepository(final String nsUri) {
  Preconditions.checkNotNull(nsUri, "Namespace URI argument cannot be null.");
  final ICDORepositoryManager repositoryManager = ApplicationContext.getInstance().getService(ICDORepositoryManager.class);
  return repositoryManager.get(nsUri);
  
}        

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

private Collection<Role> collectRoles(final IAuthorizationService authorizationService, final String userId) {
  if (!ApplicationContext.getInstance().isServerMode()) {
    return Sets.newHashSet(SpecialRole.ADMINISTRATOR);
  } else {
    return authorizationService.getRoles(userId);
  }
}
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 Integer maxReasonerRuns() {
  return com.b2international.snowowl.core.ApplicationContext.getInstance()
      .getServiceChecked(SnowOwlConfiguration.class)
      .getModuleConfig(SnomedCoreConfiguration.class)
      .getClassificationConfig()
      .getMaxReasonerRuns();
}

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

public DelegateCDOServerChangeManager(final ICDOCommitChangeSet commitChangeSet, final Collection<CDOChangeProcessorFactory> factories, final boolean copySession, boolean isCommitNotificationEnabled) {
  this.isCommitNotificationEnabled = isCommitNotificationEnabled;
  this.commitChangeSet = Preconditions.checkNotNull(commitChangeSet, "Commit change set data argument cannot be null.");
  final CDOView view = commitChangeSet.getView();
  this.repositoryUuid = ApplicationContext.getInstance().getService(ICDOConnectionManager.class).get(view).getUuid();
  this.branchPath = BranchPathUtils.createPath(view);
  this.factories = Preconditions.checkNotNull(factories, "CDO change processor factories argument cannot be null.");
}

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.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.datastore.server

public static Connection createConnection(final EPackage ePackage, final RepositoryConfiguration configuration) {
  
  Preconditions.checkNotNull(ePackage, "EClass argument cannot be null.");
  
  final String driverName = configuration.getDatabaseConfiguration().getDriverClass();
  final JdbcUrl jdbcUrl = configuration.getDatabaseUrl();
  final String username = configuration.getDatabaseConfiguration().getUsername();
  final String password = configuration.getDatabaseConfiguration().getPassword();
  
  final ICDORepositoryManager repositoryManager = ApplicationContext.getInstance().getService(ICDORepositoryManager.class);
  final String repositoryUuid = repositoryManager.get(ePackage).getUuid();
  
  final String localDbUrl = jdbcUrl.build(repositoryUuid);
  
  return JdbcUtils.createConnection(driverName, localDbUrl, username, password);
}

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

public static long getClassMetaID(final EClass eClass) {
  
  final ICDORepositoryManager repositoryManager = ApplicationContext.getInstance().getService(ICDORepositoryManager.class);
  final ICDORepository cdoRepository = repositoryManager.get(eClass);
  final IDBStore dbStore = cdoRepository.getDbStore();		
  final IRepository repository = cdoRepository.getRepository();
  
  final ISession session = repository.getSessionManager().getSessions()[0];
  StoreThreadLocal.setSession((InternalSession) session);
  final long lastCommitTime = dbStore.getLastCommitTime();
  return CDOIDUtil.getLong(dbStore.getMetaDataManager().getMetaID(eClass, lastCommitTime));
}

com.b2international.snowowl.coreApplicationContextgetInstance

Javadoc

Factory method.

Popular methods of ApplicationContext

  • 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
  • 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

  • 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.
  • Best plugins for Eclipse
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