Package org.faktorips.runtime.internal
Class AbstractClassLoadingRuntimeRepository
- java.lang.Object
-
- org.faktorips.runtime.internal.AbstractRuntimeRepository
-
- org.faktorips.runtime.internal.AbstractCachingRuntimeRepository
-
- org.faktorips.runtime.internal.AbstractTocBasedRuntimeRepository
-
- org.faktorips.runtime.internal.AbstractClassLoadingRuntimeRepository
-
- All Implemented Interfaces:
IRuntimeRepository
- Direct Known Subclasses:
ClassloaderRuntimeRepository,DetachedContentRuntimeRepository
public abstract class AbstractClassLoadingRuntimeRepository extends AbstractTocBasedRuntimeRepository
An abstract repository that handles the common stuff between theAbstractTocBasedRuntimeRepositoryand the concrete runtime repositories. This abstract layer is responsible for loading the classes and instantiates the objects. The content of the objects - the concrete data - is provided by the concrete implementation.- Author:
- dirmeier
-
-
Constructor Summary
Constructors Constructor Description AbstractClassLoadingRuntimeRepository(java.lang.String name, ICacheFactory cacheFactory, java.lang.ClassLoader cl)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected <T> TcreateCustomObject(CustomTocEntryObject<T> tocEntry)protected <T> java.util.List<T>createEnumValues(EnumContentTocEntry tocEntry, java.lang.Class<T> enumClass)protected IProductComponentcreateProductCmpt(ProductCmptTocEntry tocEntry)protected IProductComponentGenerationcreateProductCmptGeneration(GenerationTocEntry tocEntry)protected ProductComponentGenerationcreateProductComponentGenerationInstance(GenerationTocEntry tocEntry, ProductComponent productCmpt)protected ProductComponentcreateProductComponentInstance(java.lang.String implementationClassName, java.lang.String ipsObjectId, java.lang.String kindId, java.lang.String versionId)protected ITable<?>createTable(TableContentTocEntry tocEntry)Creates the table object for the given toc entry.protected IpsTestCaseBasecreateTestCase(TestCaseTocEntry tocEntry, IRuntimeRepository runtimeRepository)Creates the test case object for the given toc entry.protected <T extends IProductComponent>
voidgetAllProductComponentsInternal(java.lang.Class<T> productCmptClass, java.util.List<T> result)Override the default implementation for better performance.java.lang.ClassLoadergetClassLoader()Returns the class loader that is used to load Java classes by this repository.protected abstract <T> org.w3c.dom.ElementgetDocumentElement(CustomTocEntryObject<T> tocEntry)This method returns the xml element of the product component identified by the tocEntryprotected abstract org.w3c.dom.ElementgetDocumentElement(GenerationTocEntry tocEntry)This method returns the xml element of the product component generation identified by the tocEntryprotected abstract org.w3c.dom.ElementgetDocumentElement(ProductCmptTocEntry tocEntry)This method returns the xml element of the product component identified by the tocEntryprotected abstract org.w3c.dom.ElementgetDocumentElement(TestCaseTocEntry tocEntry)This method returns the xml element of the test case identified by the tocEntryprotected abstract java.lang.StringgetProductComponentGenerationImplClass(GenerationTocEntry tocEntry)This method returns the name of the product component generation implementation class identified by the tocEntry.protected ProductVariantRuntimeHelpergetProductVariantHelper()protected abstract java.io.InputStreamgetXmlAsStream(EnumContentTocEntry tocEntry)Returns the XML data for the specified tocEntry asInputStreamprotected abstract java.io.InputStreamgetXmlAsStream(TableContentTocEntry tocEntry)Returns the XML data for the specified tocEntry asInputStreamprotected <T> voidinitClRepositoryObject(CustomTocEntryObject<T> tocEntry, IClRepositoryObject runtimeObject)-
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, loadTableOfContents
-
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, getFormulaEvaluatorFactory, 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
isModifiable
-
-
-
-
Constructor Detail
-
AbstractClassLoadingRuntimeRepository
public AbstractClassLoadingRuntimeRepository(java.lang.String name, ICacheFactory cacheFactory, java.lang.ClassLoader cl)- Parameters:
name- The name of the runtime repositorycacheFactory- the cache factory used by this runtime repositorycl- theClassLoaderused to load the classes
-
-
Method Detail
-
createProductCmpt
protected IProductComponent createProductCmpt(ProductCmptTocEntry tocEntry)
- Specified by:
createProductCmptin classAbstractTocBasedRuntimeRepository
-
createProductComponentInstance
protected ProductComponent createProductComponentInstance(java.lang.String implementationClassName, java.lang.String ipsObjectId, java.lang.String kindId, java.lang.String versionId)
-
createEnumValues
protected <T> java.util.List<T> createEnumValues(EnumContentTocEntry tocEntry, java.lang.Class<T> enumClass)
- Specified by:
createEnumValuesin classAbstractTocBasedRuntimeRepository
-
createProductCmptGeneration
protected IProductComponentGeneration createProductCmptGeneration(GenerationTocEntry tocEntry)
- Specified by:
createProductCmptGenerationin classAbstractTocBasedRuntimeRepository
-
getProductVariantHelper
protected ProductVariantRuntimeHelper getProductVariantHelper()
-
createProductComponentGenerationInstance
protected ProductComponentGeneration createProductComponentGenerationInstance(GenerationTocEntry tocEntry, ProductComponent productCmpt)
-
getAllProductComponentsInternal
protected <T extends IProductComponent> void getAllProductComponentsInternal(java.lang.Class<T> productCmptClass, java.util.List<T> result)
Override the default implementation for better performance. The default implementation instantiates all product component before using the class filter. In this implementation we use the information in the toc to filter the list of product components before instantiation.- Overrides:
getAllProductComponentsInternalin classAbstractRuntimeRepository- Parameters:
productCmptClass- The class you want to search product components forresult- adding the found product components to result list
-
createTable
protected ITable<?> createTable(TableContentTocEntry tocEntry)
Description copied from class:AbstractTocBasedRuntimeRepositoryCreates the table object for the given toc entry.- Specified by:
createTablein classAbstractTocBasedRuntimeRepository
-
createTestCase
protected IpsTestCaseBase createTestCase(TestCaseTocEntry tocEntry, IRuntimeRepository runtimeRepository)
Description copied from class:AbstractTocBasedRuntimeRepositoryCreates the test case object for the given toc entry.- Specified by:
createTestCasein classAbstractTocBasedRuntimeRepository
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
Description copied from class:AbstractRuntimeRepositoryReturns the class loader that is used to load Java classes by this repository.This default implementation returns the class loader with which this repository class has been loaded.
- Specified by:
getClassLoaderin interfaceIRuntimeRepository- Overrides:
getClassLoaderin classAbstractRuntimeRepository
-
getDocumentElement
protected abstract org.w3c.dom.Element getDocumentElement(ProductCmptTocEntry tocEntry)
This method returns the xml element of the product component identified by the tocEntry
-
getDocumentElement
protected abstract org.w3c.dom.Element getDocumentElement(GenerationTocEntry tocEntry)
This method returns the xml element of the product component generation identified by the tocEntry
-
getDocumentElement
protected abstract org.w3c.dom.Element getDocumentElement(TestCaseTocEntry tocEntry)
This method returns the xml element of the test case identified by the tocEntry
-
getProductComponentGenerationImplClass
protected abstract java.lang.String getProductComponentGenerationImplClass(GenerationTocEntry tocEntry)
This 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.
-
getXmlAsStream
protected abstract java.io.InputStream getXmlAsStream(EnumContentTocEntry tocEntry)
Returns the XML data for the specified tocEntry asInputStream- Parameters:
tocEntry- Specifying the requested EnumContent- Returns:
- An InputStream containing the XML data - should not return null!
- Throws:
java.lang.RuntimeException- in case of any exception do not return null but an accurateRuntimeException
-
getXmlAsStream
protected abstract java.io.InputStream getXmlAsStream(TableContentTocEntry tocEntry)
Returns the XML data for the specified tocEntry asInputStream- Parameters:
tocEntry- Specifying the requested TableContent- Returns:
- An InputStream containing the XML data - should not return null!
- Throws:
java.lang.RuntimeException- in case of any exception do not return null but an accurateRuntimeException
-
createCustomObject
protected <T> T createCustomObject(CustomTocEntryObject<T> tocEntry)
- Specified by:
createCustomObjectin classAbstractTocBasedRuntimeRepository
-
initClRepositoryObject
protected <T> void initClRepositoryObject(CustomTocEntryObject<T> tocEntry, IClRepositoryObject runtimeObject)
-
getDocumentElement
protected abstract <T> org.w3c.dom.Element getDocumentElement(CustomTocEntryObject<T> tocEntry)
This method returns the xml element of the product component identified by the tocEntry
-
-