Package org.apache.openjpa.lib.conf
Class AbstractProductDerivation
java.lang.Object
org.apache.openjpa.lib.conf.AbstractProductDerivation
- All Implemented Interfaces:
ProductDerivation
- Direct Known Subclasses:
JDBCPersistenceProductDerivation
,JDBCProductDerivation
,PersistenceProductDerivation
,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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Called after the specification has been set.void
Called before the given Configuration is closed.boolean
Provides the instance with a callback to mutate the initial properties of theConfigurationProvider
.boolean
Provides the instance with the opportunity to mutateconf
before the user configuration is applied.getAnchorsInFile
(File file) Return a Listof all the anchors defined in file
.getAnchorsInResource
(String resource) Return a Listof all the anchors defined in resource
.Return the configuration prefix for properties of this product.Return a string identifying the default resource location for this product derivation, if one exists.Return set of Query hint keys recognized by this receiver.Load given file, or return null if it is not a file this receiver understands.load
(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.loadDefaults
(ClassLoader loader) Load defaults into the returned ConfigurationProvider, or return null if no defaults are found.loadGlobals
(ClassLoader loader) Load globals into the returned ConfigurationProvider, or return null if no globals are found.void
validate()
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
-
Constructor Details
-
AbstractProductDerivation
public AbstractProductDerivation()
-
-
Method Details
-
getConfigurationPrefix
Description copied from interface:ProductDerivation
Return the configuration prefix for properties of this product.- Specified by:
getConfigurationPrefix
in interfaceProductDerivation
-
validate
Description copied from interface:ProductDerivation
Ensure 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:
validate
in interfaceProductDerivation
- Throws:
Exception
-
loadGlobals
Description copied from interface:ProductDerivation
Load globals into the returned ConfigurationProvider, or return null if no globals are found.- Specified by:
loadGlobals
in interfaceProductDerivation
- Throws:
Exception
-
loadDefaults
Description copied from interface:ProductDerivation
Load defaults into the returned ConfigurationProvider, or return null if no defaults are found.- Specified by:
loadDefaults
in interfaceProductDerivation
- Throws:
Exception
-
load
public ConfigurationProvider load(String resource, String anchor, ClassLoader loader) throws Exception Description copied from interface:ProductDerivation
Load 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:
load
in interfaceProductDerivation
anchor
- optional named anchor within a multiple-configuration resource- Throws:
Exception
-
load
Description copied from interface:ProductDerivation
Load given file, or return null if it is not a file this receiver understands.- Specified by:
load
in interfaceProductDerivation
anchor
- optional named anchor within a multiple-configuration file- Throws:
Exception
-
getDefaultResourceLocation
Description copied from interface:ProductDerivation
Return a string identifying the default resource location for this product derivation, if one exists. If there is no default location, returnsnull
.- Specified by:
getDefaultResourceLocation
in interfaceProductDerivation
-
getAnchorsInFile
Description copied from interface:ProductDerivation
Return a Listof all the anchors defined in file
. The returned names are not fully-qualified, so must be used in conjunction withfile
in calls toProductDerivation.load(java.io.File, String)
. Returnsnull
or an empty list if no anchors could be found.- Specified by:
getAnchorsInFile
in interfaceProductDerivation
- Throws:
Exception
-
getAnchorsInResource
Description copied from interface:ProductDerivation
Return a Listof all the anchors defined in resource
. The returned names are not fully-qualified, so must be used in conjunction withresource
in calls toProductDerivation.load(java.io.File, String)
. Returnsnull
or an empty list if no anchors could be found.- Specified by:
getAnchorsInResource
in interfaceProductDerivation
- Throws:
Exception
-
beforeConfigurationConstruct
Description copied from interface:ProductDerivation
Provides 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:
beforeConfigurationConstruct
in interfaceProductDerivation
- Returns:
- true if given ConfigurationProvider has been mutated.
-
beforeConfigurationLoad
Description copied from interface:ProductDerivation
Provides the instance with the opportunity to mutateconf
before the user configuration is applied.- Specified by:
beforeConfigurationLoad
in interfaceProductDerivation
- Returns:
- true if given Configuration has been mutated.
-
afterSpecificationSet
Description copied from interface:ProductDerivation
Called after the specification has been set.- Specified by:
afterSpecificationSet
in interfaceProductDerivation
- Returns:
- true if given Configuration has been mutated.
-
beforeConfigurationClose
Description copied from interface:ProductDerivation
Called before the given Configuration is closed.- Specified by:
beforeConfigurationClose
in interfaceProductDerivation
-
getSupportedQueryHints
Description copied from interface:ProductDerivation
Return set of Query hint keys recognized by this receiver.- Specified by:
getSupportedQueryHints
in interfaceProductDerivation
-