congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
ApplicationContext
Code IndexAdd Tabnine to your IDE (free)

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

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

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.scg

  @Override
  public IEventBus get() {
    return ApplicationContext.getServiceForClass(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.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 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.scg

com.b2international.snowowl.snomed.Concept concept = editingContext.buildDraftConceptFromNormalForm(normalForm);
concept.eAdapters().add(new ConceptParentAdapter(extractor.getFocusConceptIdList()));
IWidgetModelProvider widgetModelProvider = ApplicationContext.getInstance().getService(IWidgetModelProvider.class);
ConceptWidgetModel conceptWidgetModel = widgetModelProvider.createConceptWidgetModel(branchPath, extractor.getFocusConceptIdList(), null);
IWidgetBeanProvider widgetBeanProvider = ApplicationContext.getServiceForClass(IWidgetBeanProvider.class);
ConceptWidgetBean conceptWidgetBean = widgetBeanProvider.createConceptWidgetBean(branchPath, concept.getId(), conceptWidgetModel, null, true, false, new NullProgressMonitor());
IDiagnostic diagnostic = new MrcmConceptWidgetBeanValidator().validate(conceptWidgetBean);
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.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.datastore.server

  private ApplicationContext getContext() {
    return ApplicationContext.getInstance();
  }
}
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.datastore.server

  @Override
  protected IDatastoreOperationLockManager createServiceImplementation() throws SnowowlServiceException {
    
    final DatastoreOperationLockManager service = new DatastoreOperationLockManager();
    final RemoteLockTargetListener remoteLockTargetListener = new RemoteLockTargetListener();
    service.addLockTargetListener(new Slf4jOperationLockTargetListener());
    service.addLockTargetListener(remoteLockTargetListener);
    
    ApplicationContext.getInstance().addServiceListener(IApplicationSessionManager.class, new IServiceChangeListener<IApplicationSessionManager>() {
      
      @Override
      public void serviceChanged(final IApplicationSessionManager oldService, final IApplicationSessionManager newService) {
        if (oldService != null) {
          ((ApplicationSessionManager) oldService).removeListener(remoteLockTargetListener);
        }
        
        if (newService != null) {
          ((ApplicationSessionManager) newService).addListener(remoteLockTargetListener);
        }
      }
    });
    
    return service;
  }
}
origin: com.b2international.snowowl/com.b2international.snowowl.core

/**
 * 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 {@code null}.  
 * @param serviceInterface the interface of the required service. Should not be {@code null}.
 * @return the available registered service instance.
 * @param <T> type of the service.
 */
public <T> T getServiceChecked(final Class<T> serviceInterface) {
  Preconditions.checkNotNull(serviceInterface, "Service interface argument cannot be null.");
  final T service = getService(serviceInterface);
  Preconditions.checkNotNull(service, "Service for " + serviceInterface.getSimpleName() + " service cannot be null.");
  return service;
}

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

/**
 * Returns <code>true</code> if Snow Owl is running on a server environment.
 * 
 * @return
 */
public boolean isServer() {
  return services().isServerMode();
}
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.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.core

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

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

getContext().getService(RepositoryManager.class)
  .get(repositoryUuid)
  .sendNotification(toCommitNotification(mergedChangeSet));
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.impl

private ISnomedBrowserAxiomService getAxiomService() {
  if (axiomService == null) {
    axiomService = ApplicationContext.getServiceForClass(ISnomedBrowserAxiomService.class);
  }
  return axiomService;
}
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);
}
com.b2international.snowowl.coreApplicationContext

Most used methods

  • 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
  • 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
  • exists,
  • getServiceEntry,
  • getServiceInfo

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (Timer)
  • onRequestPermissionsResult (Fragment)
  • getApplicationContext (Context)
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Join (org.hibernate.mapping)
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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