Class AbstractNucleusContext
java.lang.Object
org.datanucleus.AbstractNucleusContext
- All Implemented Interfaces:
NucleusContext
- Direct Known Subclasses:
EnhancementNucleusContextImpl, PersistenceNucleusContextImpl
Base implementation of a NucleusContext, providing configuration, metadata management, type management, plugin management and ClassLoader services.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ApiAdapterAPI adapter used by the context.protected final StringName of the class providing the ClassLoaderResolver.protected Map<String, ClassLoaderResolver> Map of the ClassLoaderResolver, keyed by the clr class and the primaryLoader name.protected final ConfigurationConfiguration for this context.protected ClassLoaderResolverDefault ClassLoaderResolver, when no primaryLoader is specified.protected MetaDataManagerMetaDataManager for handling the MetaData.protected final PluginManagerManager for plug-ins.protected TypeManagerManager for java types. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractNucleusContext(String apiName, Map startupProps, PluginManager pluginMgr) -
Method Summary
Modifier and TypeMethodDescriptionvoidMethod called when initialising the Configuration to load up defaults for the properties appropriate for this NucleusContext.voidclose()Clear out resources for the supported services.Accessor for the name of the API (JDO, JPA, etc).getClassLoaderResolver(ClassLoader primaryLoader) Accessor for a ClassLoaderResolver to use in resolving classes.Accessor for the overall configuration for DataNucleus.Accessor for the manager for persistence metadata information.Accessor for the manager for DataNucleus plugins.Accessor for manager for java types.voidMethod to initialise the context for use.protected voidMethod to log the configuration of this context.protected abstract voidConvenience method so that extending implementations can log their own configuration.boolean
-
Field Details
-
config
Configuration for this context. -
pluginManager
Manager for plug-ins. -
metaDataManager
MetaDataManager for handling the MetaData. -
apiAdapter
API adapter used by the context. -
typeManager
Manager for java types. -
classLoaderResolverClassName
Name of the class providing the ClassLoaderResolver. -
classLoaderResolverMap
Map of the ClassLoaderResolver, keyed by the clr class and the primaryLoader name. -
defaultCLR
Default ClassLoaderResolver, when no primaryLoader is specified. -
STARTUP_PROPERTIES
-
-
Constructor Details
-
AbstractNucleusContext
-
-
Method Details
-
applyDefaultProperties
Description copied from interface:NucleusContextMethod called when initialising the Configuration to load up defaults for the properties appropriate for this NucleusContext.- Specified by:
applyDefaultPropertiesin interfaceNucleusContext- Parameters:
conf- The configuration
-
initialise
public void initialise()Description copied from interface:NucleusContextMethod to initialise the context for use. If any services are considered essential for operation then they will be enabled here, otherwise left for lazy initialisation.- Specified by:
initialisein interfaceNucleusContext
-
close
public void close()Description copied from interface:NucleusContextClear out resources for the supported services.- Specified by:
closein interfaceNucleusContext
-
getApiAdapter
- Specified by:
getApiAdapterin interfaceNucleusContext
-
getApiName
Description copied from interface:NucleusContextAccessor for the name of the API (JDO, JPA, etc).- Specified by:
getApiNamein interfaceNucleusContext- Returns:
- the api
-
getConfiguration
Description copied from interface:NucleusContextAccessor for the overall configuration for DataNucleus.- Specified by:
getConfigurationin interfaceNucleusContext- Returns:
- The Configuration
-
getPluginManager
Description copied from interface:NucleusContextAccessor for the manager for DataNucleus plugins.- Specified by:
getPluginManagerin interfaceNucleusContext- Returns:
- The PluginManager
-
getMetaDataManager
Description copied from interface:NucleusContextAccessor for the manager for persistence metadata information.- Specified by:
getMetaDataManagerin interfaceNucleusContext- Returns:
- The MetaDataManager
-
supportsORMMetaData
public boolean supportsORMMetaData()- Specified by:
supportsORMMetaDatain interfaceNucleusContext
-
getTypeManager
Description copied from interface:NucleusContextAccessor for manager for java types.- Specified by:
getTypeManagerin interfaceNucleusContext- Returns:
- The TypeManager
-
getClassLoaderResolver
Description copied from interface:NucleusContextAccessor for a ClassLoaderResolver to use in resolving classes. Caches the resolver for the specified primary loader, and hands it out if present.- Specified by:
getClassLoaderResolverin interfaceNucleusContext- Parameters:
primaryLoader- Loader to use as the primary loader (or null)- Returns:
- The ClassLoader resolver
-
logConfiguration
protected void logConfiguration()Method to log the configuration of this context. -
logConfigurationDetails
protected abstract void logConfigurationDetails()Convenience method so that extending implementations can log their own configuration.
-