Class DetachedContentRuntimeRepository
- java.lang.Object
-
- org.faktorips.runtime.internal.AbstractRuntimeRepository
-
- org.faktorips.runtime.internal.AbstractCachingRuntimeRepository
-
- org.faktorips.runtime.internal.AbstractTocBasedRuntimeRepository
-
- org.faktorips.runtime.internal.AbstractClassLoadingRuntimeRepository
-
- org.faktorips.runtime.productdataprovider.DetachedContentRuntimeRepository
-
- All Implemented Interfaces:
IRuntimeRepository,IDetachedContentRuntimeRepository
public class DetachedContentRuntimeRepository extends AbstractClassLoadingRuntimeRepository implements IDetachedContentRuntimeRepository
/** TheDetachedContentRuntimeRepositoryis a runtime repository that is able to parse the product data provided from aIProductDataProviderand instantiates the necessary objects.Because the data from an
IProductDataProvidercould change over time theDetachedContentRuntimeRepositoryhave to look for modifications and reinstantiates the classes if necessary. Once product data has changed, this repository only provides the already cached data. If the user requests new data it gets aDataModifiedRuntimeException.This implements a optimistic locking mechanism. That means that nothing happens until the requested data is invalid. Once the product data has changed, this repository could still get cached data. That means every request that only calls data from the cache would continue without errors. To guarantee that a client does not work on out-dated data it has to get the actual
DetachedContentRuntimeRepositoryfromDetachedContentRuntimeRepositoryManagerfor every new request.- Author:
- dirmeier
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T> org.w3c.dom.ElementgetDocumentElement(CustomTocEntryObject<T> tocEntry)This method returns the xml element of the product component identified by the tocEntryprotected org.w3c.dom.ElementgetDocumentElement(GenerationTocEntry tocEntry)This method returns the xml element of the product component generation identified by the tocEntryprotected org.w3c.dom.ElementgetDocumentElement(ProductCmptTocEntry tocEntry)This method returns the xml element of the product component identified by the tocEntryprotected org.w3c.dom.ElementgetDocumentElement(TestCaseTocEntry tocEntry)This method returns the xml element of the test case identified by the tocEntryIFormulaEvaluatorFactorygetFormulaEvaluatorFactory()Getting theIFormulaEvaluatorFactoryset in the constructor.protected java.lang.StringgetProductComponentGenerationImplClass(GenerationTocEntry tocEntry)This method returns the name of the product component generation implementation class identified by the tocEntry.java.lang.StringgetProductDataVersion()Returning the actual version set in the product data provider.protected java.io.InputStreamgetXmlAsStream(EnumContentTocEntry tocEntry)Returns the XML data for the specified tocEntry asInputStreamprotected java.io.InputStreamgetXmlAsStream(TableContentTocEntry tocEntry)Returns the XML data for the specified tocEntry asInputStreambooleanisModifiable()Returnstrueif the repository's content is modifiable.protected IReadonlyTableOfContentsloadTableOfContents()-
Methods inherited from class org.faktorips.runtime.internal.AbstractClassLoadingRuntimeRepository
createCustomObject, createEnumValues, createProductCmpt, createProductCmptGeneration, createProductComponentGenerationInstance, createProductComponentInstance, createTable, createTestCase, getAllProductComponentsInternal, getClassLoader, getProductVariantHelper, initClRepositoryObject
-
Methods inherited from class org.faktorips.runtime.internal.AbstractTocBasedRuntimeRepository
createEnumXmlAdapter, getAllEnumClasses, getAllIpsTestCases, getAllModelTypeImplementationClasses, getAllProductComponentIds, getAllProductComponents, getAllProductComponents, getAllTables, getClass, getIpsTestCaseInternal, getIpsTestCasesStartingWith, getLatestProductComponentGenerationInternal, getNextProductComponentGenerationInternal, getNotCachedCustomObject, getNotCachedEnumValues, getNotCachedEnumXmlAdapter, getNotCachedProductComponent, getNotCachedProductComponentGeneration, getNotCachedTable, getNumberOfProductComponentGenerationsInternal, getPreviousProductComponentGenerationInternal, getProductComponentGenerationInternal, getProductComponentGenerations, getProductComponentInternal, getTableInternal, getTableOfContents, initialize
-
Methods inherited from class org.faktorips.runtime.internal.AbstractCachingRuntimeRepository
getAllInternalEnumXmlAdapters, getCustomRuntimeObjectInternal, getEnumValuesInternal, getProductComponentGenerationInternal, getProductComponentInternal, getTableInternal, initCaches
-
Methods inherited from class org.faktorips.runtime.internal.AbstractRuntimeRepository
addDirectlyReferencedRepository, addEnumValueLookupService, getAllEnumClasses, getAllIpsTestCases, getAllModelTypeImplementationClasses, getAllProductComponentIds, getAllProductComponents, getAllProductComponents, getAllProductComponents, getAllReferencedRepositories, getAllTables, getCustomRuntimeObject, getDirectlyReferencedRepositories, getEnumValue, getEnumValue, getEnumValueLookupService, getEnumValues, getEnumValuesDefinedInType, getExistingEnumValue, getExistingProductComponent, getExistingProductComponentGeneration, getIpsTest, getIpsTest, getIpsTestCase, getIpsTestCase, getIpsTestCasesStartingWith, getIpsTestSuite, getIpsTestSuite, getLatestProductComponentGeneration, getModelType, getModelType, getModelType, getName, getNextProductComponentGeneration, getNumberOfProductComponentGenerations, getPreviousProductComponentGeneration, getProductComponent, getProductComponent, getProductComponentGeneration, getProductComponentGenerations, getRuntimeRepositoryLookup, getTable, getTable, newJAXBContext, newJAXBContext, removeEnumValueLookupService, setFormulaEvaluatorFactory, setRuntimeRepositoryLookup, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.faktorips.runtime.IRuntimeRepository
addDirectlyReferencedRepository, addEnumValueLookupService, getAllEnumClasses, getAllIpsTestCases, getAllModelTypeImplementationClasses, getAllProductComponentIds, getAllProductComponents, getAllProductComponents, getAllProductComponents, getAllReferencedRepositories, getAllTables, getClassLoader, getCustomRuntimeObject, getDirectlyReferencedRepositories, getEnumValue, getEnumValue, getEnumValueLookupService, getEnumValues, getExistingEnumValue, getExistingProductComponent, getExistingProductComponentGeneration, getIpsTest, getIpsTest, getIpsTestCase, getIpsTestCase, getIpsTestCasesStartingWith, getIpsTestSuite, getIpsTestSuite, getLatestProductComponentGeneration, getModelType, getModelType, getModelType, getName, getNextProductComponentGeneration, getNumberOfProductComponentGenerations, getPreviousProductComponentGeneration, getProductComponent, getProductComponent, getProductComponentGeneration, getProductComponentGenerations, getRuntimeRepositoryLookup, getTable, getTable, newJAXBContext, removeEnumValueLookupService, setRuntimeRepositoryLookup
-
-
-
-
Method Detail
-
loadTableOfContents
protected IReadonlyTableOfContents loadTableOfContents()
- Specified by:
loadTableOfContentsin classAbstractTocBasedRuntimeRepository
-
getFormulaEvaluatorFactory
public IFormulaEvaluatorFactory getFormulaEvaluatorFactory()
Getting theIFormulaEvaluatorFactoryset in the constructor. This could be null if formula should not be evaluated on the fly. The repository would load the classes containing the compiled formula.- Specified by:
getFormulaEvaluatorFactoryin interfaceIRuntimeRepository- Overrides:
getFormulaEvaluatorFactoryin classAbstractRuntimeRepository- Returns:
- the
IFormulaEvaluatorFactoryof this repository or null if formula should not be evaluated
-
getDocumentElement
protected org.w3c.dom.Element getDocumentElement(ProductCmptTocEntry tocEntry)
Description copied from class:AbstractClassLoadingRuntimeRepositoryThis method returns the xml element of the product component identified by the tocEntry- Specified by:
getDocumentElementin classAbstractClassLoadingRuntimeRepository
-
getDocumentElement
protected org.w3c.dom.Element getDocumentElement(GenerationTocEntry tocEntry)
Description copied from class:AbstractClassLoadingRuntimeRepositoryThis method returns the xml element of the product component generation identified by the tocEntry- Specified by:
getDocumentElementin classAbstractClassLoadingRuntimeRepository
-
getDocumentElement
protected org.w3c.dom.Element getDocumentElement(TestCaseTocEntry tocEntry)
Description copied from class:AbstractClassLoadingRuntimeRepositoryThis method returns the xml element of the test case identified by the tocEntry- Specified by:
getDocumentElementin classAbstractClassLoadingRuntimeRepository
-
getProductComponentGenerationImplClass
protected java.lang.String getProductComponentGenerationImplClass(GenerationTocEntry tocEntry)
Description copied from class:AbstractClassLoadingRuntimeRepositoryThis method returns the name of the product component generation implementation class identified by the tocEntry. This could either be an implementation class using the formula evaluation or an implementation class containing the compiled formulas.- Specified by:
getProductComponentGenerationImplClassin classAbstractClassLoadingRuntimeRepository
-
getXmlAsStream
protected java.io.InputStream getXmlAsStream(EnumContentTocEntry tocEntry)
Description copied from class:AbstractClassLoadingRuntimeRepositoryReturns the XML data for the specified tocEntry asInputStream- Specified by:
getXmlAsStreamin classAbstractClassLoadingRuntimeRepository- Parameters:
tocEntry- Specifying the requested EnumContent- Returns:
- An InputStream containing the XML data - should not return null!
-
getXmlAsStream
protected java.io.InputStream getXmlAsStream(TableContentTocEntry tocEntry)
Description copied from class:AbstractClassLoadingRuntimeRepositoryReturns the XML data for the specified tocEntry asInputStream- Specified by:
getXmlAsStreamin classAbstractClassLoadingRuntimeRepository- Parameters:
tocEntry- Specifying the requested TableContent- Returns:
- An InputStream containing the XML data - should not return null!
-
getProductDataVersion
public java.lang.String getProductDataVersion()
Returning the actual version set in the product data provider.- Specified by:
getProductDataVersionin interfaceIDetachedContentRuntimeRepository- Returns:
- version of the product data provider
- See Also:
IProductDataProvider.getVersion()
-
isModifiable
public boolean isModifiable()
Description copied from interface:IRuntimeRepositoryReturnstrueif the repository's content is modifiable. This feature is mainly targeted for writing test cases that need to setup a repository with a test specific content programmatically. Returnsfalseotherwise.- Specified by:
isModifiablein interfaceIRuntimeRepository
-
getDocumentElement
protected <T> org.w3c.dom.Element getDocumentElement(CustomTocEntryObject<T> tocEntry)
Description copied from class:AbstractClassLoadingRuntimeRepositoryThis method returns the xml element of the product component identified by the tocEntry- Specified by:
getDocumentElementin classAbstractClassLoadingRuntimeRepository
-
-