private PatientAccessHelper getHelper() { try { return this.componentManager.get().getInstance(PatientAccessHelper.class); } catch (ComponentLookupException ex) { this.logger.error("Mandatory component [PatientAccessHelper] missing: {}", ex.getMessage(), ex); } return null; }
@Override public List<RecordConfigurationModule> get() { try { List<RecordConfigurationModule> modules = new LinkedList<>(); modules.addAll(this.cm.<RecordConfigurationModule>getInstanceList(RecordConfigurationModule.class)); Collections.sort(modules, ModulePriorityComparator.INSTANCE); return modules; } catch (ComponentLookupException ex) { throw new RuntimeException("Failed to look up record configuration modules: " + ex.getMessage(), ex); } }
private EntityAccessHelper getHelper() { try { return this.componentManager.get().getInstance(EntityAccessHelper.class); } catch (ComponentLookupException ex) { this.logger.error("Mandatory component [EntityAccessHelper] missing: {}", ex.getMessage(), ex); } return null; }
public DataToCellConverter() { try { this.translationManager = ComponentManagerRegistry.getContextComponentManager().getInstance( TranslationManager.class); } catch (ComponentLookupException ex) { LoggerFactory.getLogger(getClass()).warn("Failed to lookup TranslationManager component: [{}]", ex.getMessage()); } }
public DataToCellConverter() { try { this.translationManager = ComponentManagerRegistry.getContextComponentManager().getInstance( TranslationManager.class); } catch (ComponentLookupException ex) { LoggerFactory.getLogger(getClass()).warn("Failed to lookup TranslationManager component: [{}]", ex.getMessage()); } }
/** * Gets all the available {@link PrimaryEntityManager}s. * * @return all available {@link PrimaryEntityManager}s */ @Nonnull private List<PrimaryEntityManager> getAvailableManagers() { try { // Returns a list of all primary entity managers. final List<PrimaryEntityManager> mgrs = this.cmProvider.get().getInstanceList(PrimaryEntityManager.class); // Filter out the managers with the wrong name. return mgrs.stream() .filter(this::isValidManager) .collect(Collectors.toList()); } catch (ComponentLookupException e) { this.logger.debug("Unable to retrieve primary entity managers: [{}].", e.getMessage()); return Collections.emptyList(); } }
protected QueryManager getQueryManager() { try { return ComponentManagerRegistry.getContextComponentManager().getInstance(QueryManager.class); } catch (ComponentLookupException ex) { this.logger.error("Failed to access the query manager: {}", ex.getMessage(), ex); } return null; }
private Vocabulary getHGNCVocabulary() { try { VocabularyManager vm = ComponentManagerRegistry.getContextComponentManager().getInstance(VocabularyManager.class); return vm.getVocabulary(HGNC); } catch (ComponentLookupException ex) { this.logger.error("Error loading component [{}]", ex.getMessage(), ex); } return null; }
/** * {@inheritDoc} */ public void initializeApplicationContext(ApplicationContext applicationContext) { try { List<ApplicationContextListener> initializers = this.componentManager.lookupList(ApplicationContextListener.class); for (ApplicationContextListener initializer : initializers) { initializer.initializeApplicationContext(applicationContext); } } catch (ComponentLookupException ex) { getLogger().error(ex.getMessage(), ex); } }
/** * {@inheritDoc} */ public void destroyApplicationContext(ApplicationContext applicationContext) { try { List<ApplicationContextListener> initializers = this.componentManager.lookupList(ApplicationContextListener.class); for (ApplicationContextListener initializer : initializers) { initializer.destroyApplicationContext(applicationContext); } } catch (ComponentLookupException ex) { getLogger().error(ex.getMessage(), ex); } } }