Package org.apache.openjpa.lib.conf
Class AbstractProductDerivation
- java.lang.Object
-
- org.apache.openjpa.lib.conf.AbstractProductDerivation
-
- All Implemented Interfaces:
ProductDerivation
public abstract class AbstractProductDerivation extends Object implements ProductDerivation
Abstract no-op product derivation for easy extension.- Since:
- 0.4.1
- Author:
- Pinaki Poddar
-
-
Field Summary
-
Fields inherited from interface org.apache.openjpa.lib.conf.ProductDerivation
TYPE_FEATURE, TYPE_PRODUCT
-
-
Constructor Summary
Constructors Constructor Description AbstractProductDerivation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanafterSpecificationSet(Configuration conf)Called after the specification has been set.voidbeforeConfigurationClose(Configuration conf)Called before the given Configuration is closed.booleanbeforeConfigurationConstruct(ConfigurationProvider cp)Provides the instance with a callback to mutate the initial properties of theConfigurationProvider.booleanbeforeConfigurationLoad(Configuration conf)Provides the instance with the opportunity to mutateconfbefore the user configuration is applied.List<String>getAnchorsInFile(File file)Return a Listof all the anchors defined in file.List<String>getAnchorsInResource(String resource)Return a Listof all the anchors defined in resource.StringgetConfigurationPrefix()Return the configuration prefix for properties of this product.StringgetDefaultResourceLocation()Return a string identifying the default resource location for this product derivation, if one exists.Set<String>getSupportedQueryHints()Return set of Query hint keys recognized by this receiver.ConfigurationProviderload(File file, String anchor)Load given file, or return null if it is not a file this receiver understands.ConfigurationProviderload(String resource, String anchor, ClassLoader loader)Load the given given resource into the returned ConfigurationProvider, or return null if it is not a resource this receiver understands.ConfigurationProviderloadDefaults(ClassLoader loader)Load defaults into the returned ConfigurationProvider, or return null if no defaults are found.ConfigurationProviderloadGlobals(ClassLoader loader)Load globals into the returned ConfigurationProvider, or return null if no globals are found.voidvalidate()Ensure that this derivation is valid.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.openjpa.lib.conf.ProductDerivation
getType
-
-
-
-
Method Detail
-
getConfigurationPrefix
public String getConfigurationPrefix()
Description copied from interface:ProductDerivationReturn the configuration prefix for properties of this product.- Specified by:
getConfigurationPrefixin interfaceProductDerivation
-
validate
public void validate() throws ExceptionDescription copied from interface:ProductDerivationEnsure that this derivation is valid. This action might consist of loading classes for the product this derivation represents to be sure they exist. Throw any throwable to indicate an invalid derivation. Invalid derivations will not be used.- Specified by:
validatein interfaceProductDerivation- Throws:
Exception
-
loadGlobals
public ConfigurationProvider loadGlobals(ClassLoader loader) throws Exception
Description copied from interface:ProductDerivationLoad globals into the returned ConfigurationProvider, or return null if no globals are found.- Specified by:
loadGlobalsin interfaceProductDerivation- Throws:
Exception
-
loadDefaults
public ConfigurationProvider loadDefaults(ClassLoader loader) throws Exception
Description copied from interface:ProductDerivationLoad defaults into the returned ConfigurationProvider, or return null if no defaults are found.- Specified by:
loadDefaultsin interfaceProductDerivation- Throws:
Exception
-
load
public ConfigurationProvider load(String resource, String anchor, ClassLoader loader) throws Exception
Description copied from interface:ProductDerivationLoad the given given resource into the returned ConfigurationProvider, or return null if it is not a resource this receiver understands. The given class loader may be null.- Specified by:
loadin interfaceProductDerivationanchor- optional named anchor within a multiple-configuration resource- Throws:
Exception
-
load
public ConfigurationProvider load(File file, String anchor) throws Exception
Description copied from interface:ProductDerivationLoad given file, or return null if it is not a file this receiver understands.- Specified by:
loadin interfaceProductDerivationanchor- optional named anchor within a multiple-configuration file- Throws:
Exception
-
getDefaultResourceLocation
public String getDefaultResourceLocation()
Description copied from interface:ProductDerivationReturn a string identifying the default resource location for this product derivation, if one exists. If there is no default location, returnsnull.- Specified by:
getDefaultResourceLocationin interfaceProductDerivation
-
getAnchorsInFile
public List<String> getAnchorsInFile(File file) throws Exception
Description copied from interface:ProductDerivationReturn a Listof all the anchors defined in file. The returned names are not fully-qualified, so must be used in conjunction withfilein calls toProductDerivation.load(java.io.File, String). Returnsnullor an empty list if no anchors could be found.- Specified by:
getAnchorsInFilein interfaceProductDerivation- Throws:
Exception
-
getAnchorsInResource
public List<String> getAnchorsInResource(String resource) throws Exception
Description copied from interface:ProductDerivationReturn a Listof all the anchors defined in resource. The returned names are not fully-qualified, so must be used in conjunction withresourcein calls toProductDerivation.load(java.io.File, String). Returnsnullor an empty list if no anchors could be found.- Specified by:
getAnchorsInResourcein interfaceProductDerivation- Throws:
Exception
-
beforeConfigurationConstruct
public boolean beforeConfigurationConstruct(ConfigurationProvider cp)
Description copied from interface:ProductDerivationProvides the instance with a callback to mutate the initial properties of theConfigurationProvider. This is primarily to alter or add properties that determine what type of configuration is constructed, and therefore is typically used at runtime only.- Specified by:
beforeConfigurationConstructin interfaceProductDerivation- Returns:
- true if given ConfigurationProvider has been mutated.
-
beforeConfigurationLoad
public boolean beforeConfigurationLoad(Configuration conf)
Description copied from interface:ProductDerivationProvides the instance with the opportunity to mutateconfbefore the user configuration is applied.- Specified by:
beforeConfigurationLoadin interfaceProductDerivation- Returns:
- true if given Configuration has been mutated.
-
afterSpecificationSet
public boolean afterSpecificationSet(Configuration conf)
Description copied from interface:ProductDerivationCalled after the specification has been set.- Specified by:
afterSpecificationSetin interfaceProductDerivation- Returns:
- true if given Configuration has been mutated.
-
beforeConfigurationClose
public void beforeConfigurationClose(Configuration conf)
Description copied from interface:ProductDerivationCalled before the given Configuration is closed.- Specified by:
beforeConfigurationClosein interfaceProductDerivation
-
getSupportedQueryHints
public Set<String> getSupportedQueryHints()
Description copied from interface:ProductDerivationReturn set of Query hint keys recognized by this receiver.- Specified by:
getSupportedQueryHintsin interfaceProductDerivation
-
-