private ConfigurationHandler getConfigurationHandler() { return (ConfigurationHandler) getSpringContext().getBean("configurationHandler"); }
private ConfigurationHandler getConfigurationHandler() { return (ConfigurationHandler) getSpringContext().getBean("configurationHandler"); }
public static CvUpdater createInstance(IntactContext intactContext) { return (CvUpdater) intactContext.getSpringContext().getBean("cvUpdater"); }
/** * @since 2.4.0 */ public CoreDeleter getCoreDeleter() { return (CoreDeleter) IntactContext.getCurrentInstance().getSpringContext().getBean("coreDeleter"); }
public void destroy() throws Exception { getSpringContext().close(); if (log.isDebugEnabled()) log.debug("Releasing LogFactory"); LogFactory.release(Thread.currentThread().getContextClassLoader()); if (log.isInfoEnabled()) log.debug("Destroying IntactContext"); instance = null; } }
/** * @since 2.4.0 */ public CoreDeleter getCoreDeleter() { return (CoreDeleter) IntactContext.getCurrentInstance().getSpringContext().getBean("coreDeleter"); }
public void destroy() throws Exception { getSpringContext().close(); if (log.isDebugEnabled()) log.debug("Releasing LogFactory"); LogFactory.release(Thread.currentThread().getContextClassLoader()); if (log.isInfoEnabled()) log.debug("Destroying IntactContext"); instance = null; } }
public static String nextUnassignedId(IntactContext intactContext) { SequenceManager sequenceManager = (SequenceManager) intactContext.getSpringContext().getBean("sequenceManager"); return "unassigned" + sequenceManager.getNextValueForSequence("unassigned_seq"); }
public static String nextUnassignedId(IntactContext intactContext) { SequenceManager sequenceManager = (SequenceManager) intactContext.getSpringContext().getBean("sequenceManager"); return "unassigned" + sequenceManager.getNextValueForSequence("unassigned_seq"); }
public static PsiEnricher createPsiEnricher(IntactContext intactContext) { return createPsiEnricher(intactContext.getSpringContext()); }
public CorePersister getCorePersister() { return (CorePersister) IntactContext.getCurrentInstance().getSpringContext().getBean("corePersister"); }
public static PsiExchange createPsiExchange(IntactContext intactContext) { return createPsiExchange(intactContext.getSpringContext()); }
public CorePersister getCorePersister() { return (CorePersister) IntactContext.getCurrentInstance().getSpringContext().getBean("corePersister"); }
public CorePersisterImpl() { this(IntactContext.getCurrentInstance(), (Finder) IntactContext.getCurrentInstance().getSpringContext().getBean("finder")); }
public CorePersisterImpl() { this(IntactContext.getCurrentInstance(), (Finder) IntactContext.getCurrentInstance().getSpringContext().getBean("finder")); }
/** * Creates a schema * @param initializeDatabase If false, do not initialize the database (e.g. don't create Institution) */ public static void createSchema(boolean initializeDatabase) { if (log.isDebugEnabled()) log.debug("Creating schema"); SchemaExport se = newSchemaExport(); se.create(false, true); if (initializeDatabase) { if (log.isDebugEnabled()) log.debug("Initializing database"); IntactInitializer initializer = (IntactInitializer) IntactContext.getCurrentInstance() .getSpringContext().getBean("intactInitializer"); try { initializer.init(); } catch (Exception e) { throw new IntactException("Problem re-initializing core", e); } } }
protected static SchemaExport newSchemaExport() { LocalEntityManagerFactoryBean factoryBean = (LocalEntityManagerFactoryBean) IntactContext.getCurrentInstance().getSpringContext() .getBean("&entityFactoryManager"); PersistenceUnitInfo persistenceUnitInfo = factoryBean.getPersistenceUnitInfo(); Configuration config = new Ejb3Configuration().configure(persistenceUnitInfo, null).getHibernateConfiguration(); SchemaExport se = new SchemaExport(config); return se; }
protected static SchemaExport newSchemaExport() { LocalEntityManagerFactoryBean factoryBean = (LocalEntityManagerFactoryBean) IntactContext.getCurrentInstance().getSpringContext() .getBean("&entityFactoryManager"); PersistenceUnitInfo persistenceUnitInfo = factoryBean.getPersistenceUnitInfo(); Configuration config = new Ejb3Configuration().configure(persistenceUnitInfo, null).getHibernateConfiguration(); SchemaExport se = new SchemaExport(config); return se; }
/** * The local identity is created using a sequence. If the sequence does not exist, a new one is created * with initial value calculated using the maximum integer for the existing local CV identifiers. * @return The next value available * @throws SequenceCreationException thrown if the sequence cannot be created. */ protected String nextLocalIdentifier() throws SequenceCreationException { final IntactContext context = IntactContext.getCurrentInstance(); String prefix = context.getConfig().getLocalCvPrefix(); Integer max = context.getDataContext().getDaoFactory() .getCvObjectDao().getLastCvIdentifierWithPrefix(prefix); if (max == null) max = 0; SequenceManager seqManager = (SequenceManager) context.getSpringContext().getBean("sequenceManager"); seqManager.createSequenceIfNotExists(IntactAuxiliaryConfigurator.CV_LOCAL_SEQ, max+1); String nextIntegerAsString = String.valueOf(seqManager.getNextValueForSequence(IntactAuxiliaryConfigurator.CV_LOCAL_SEQ)); return prefix+":" + StringUtils.leftPad(nextIntegerAsString, 4, "0"); }
/** * The local identity is created using a sequence. If the sequence does not exist, a new one is created * with initial value calculated using the maximum integer for the existing local CV identifiers. * @return The next value available * @throws SequenceCreationException thrown if the sequence cannot be created. */ protected String nextLocalIdentifier() throws SequenceCreationException { final IntactContext context = IntactContext.getCurrentInstance(); String prefix = context.getConfig().getLocalCvPrefix(); Integer max = context.getDataContext().getDaoFactory() .getCvObjectDao().getLastCvIdentifierWithPrefix(prefix); if (max == null) max = 0; SequenceManager seqManager = (SequenceManager) context.getSpringContext().getBean("sequenceManager"); seqManager.createSequenceIfNotExists(IntactAuxiliaryConfigurator.CV_LOCAL_SEQ, max+1); String nextIntegerAsString = String.valueOf(seqManager.getNextValueForSequence(IntactAuxiliaryConfigurator.CV_LOCAL_SEQ)); return prefix+":" + StringUtils.leftPad(nextIntegerAsString, 4, "0"); }