Package grails.core
Class DefaultGrailsApplication
- java.lang.Object
-
- groovy.lang.GroovyObjectSupport
-
- org.grails.core.AbstractGrailsApplication
-
- grails.core.DefaultGrailsApplication
-
- All Implemented Interfaces:
GrailsApplication,groovy.lang.GroovyObject,java.util.EventListener,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>,org.springframework.context.event.SmartApplicationListener,org.springframework.core.Ordered
public class DefaultGrailsApplication extends AbstractGrailsApplication implements org.springframework.beans.factory.BeanClassLoaderAware
Default implementation of the GrailsApplication interface that manages application loading, state, and artefact instances. Upon loading this GrailsApplication will inspect each class using its registered ArtefactHandler instances. Each ArtefactHandler provides knowledge about the conventions used to establish its artefact type. For example controllers use the ControllerArtefactHandler to establish this knowledge. New ArtefactHandler instances can be registered with the GrailsApplication thus allowing application extensibility.- Since:
- 0.1
- See Also:
GrailsPluginManager,DefaultGrailsPluginManager,ArtefactHandler,ArtefactInfo
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<java.lang.Class<?>>allArtefactClassesprotected java.lang.Class<?>[]allArtefactClassesArrayprotected java.lang.Class<?>[]allClassesprotected grails.core.GrailsApplicationClassapplicationClassprotected ArtefactHandler[]artefactHandlersprotected java.util.Map<java.lang.String,ArtefactHandler>artefactHandlersByNameprotected java.util.Map<java.lang.String,ArtefactInfo>artefactInfoprotected static java.util.regex.PatternGETCLASS_PATTERNprotected static java.util.regex.PatternGETCLASSESMETH_PATTERNprotected static java.util.regex.PatternGETCLASSESPROP_PATTERNprotected booleaninitialisedprotected static java.util.regex.PatternISCLASS_PATTERNprotected java.util.Set<java.lang.Class<?>>loadedClassesprotected static org.apache.commons.logging.Loglogprotected org.grails.datastore.mapping.model.MappingContextmappingContextprotected org.grails.datastore.mapping.model.MappingContextproxyMappingContextprotected org.springframework.core.io.Resource[]resources-
Fields inherited from class org.grails.core.AbstractGrailsApplication
applicationMeta, classLoader, config, contextInitialized, parentContext
-
Fields inherited from interface grails.core.GrailsApplication
APPLICATION_ID, CLASS_LOADER_BEAN, CONFIG_CLASS, DATA_SOURCE_BEAN, DATA_SOURCE_CLASS, DIALECT_DETECTOR_BEAN, EXCEPTION_HANDLER_BEAN, MESSAGE_SOURCE_BEAN, MULTIPART_RESOLVER_BEAN, OPEN_SESSION_IN_VIEW_INTERCEPTOR_BEAN, PROJECT_META_FILE, SESSION_FACTORY_BEAN, TRANSACTION_MANAGER_BEAN
-
-
Constructor Summary
Constructors Constructor Description DefaultGrailsApplication()Creates a new empty Grails application.DefaultGrailsApplication(grails.core.GrailsApplicationClass applicationClass)Creates a new empty Grails application.DefaultGrailsApplication(java.lang.Class<?>... classes)Construct an application for the given classesDefaultGrailsApplication(java.lang.Class<?>[] classes, java.lang.ClassLoader classLoader)Creates a new GrailsApplication instance using the given classes and GroovyClassLoader.DefaultGrailsApplication(java.lang.ClassLoader classLoader)DefaultGrailsApplication(org.grails.io.support.Resource[] resources)Loads a GrailsApplication using the given ResourceLocator instance which will search for appropriate class namesDefaultGrailsApplication(org.springframework.core.io.Resource[] resources)Loads a GrailsApplication using the given ResourceLocator instance which will search for appropriate class names
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddArtefact(java.lang.Class artefact)Adds the given artefact, attempting to determine type fromGrailsClassaddArtefact(java.lang.String artefactType, GrailsClass artefactGrailsClass)Adds an artefact of the given type for the given GrailsClass.GrailsClassaddArtefact(java.lang.String artefactType, java.lang.Class artefactClass)Adds an artefact of the given type for the given Class.protected GrailsClassaddArtefact(java.lang.String artefactType, java.lang.Class<?> artefactClass, boolean overrideable)voidaddOverridableArtefact(java.lang.Class artefact)Adds an artefact that can be overriden by user defined classesGrailsClassaddOverridableArtefact(java.lang.String artefactType, java.lang.Class artefactClass)Adds an artefact of the given type for the given Class.protected voidaddToLoaded(java.lang.Class<?> clazz)voidclear()Clears the application returning it to an empty state.protected voidconfigureLoadedClasses(java.lang.Class<?>[] classes)Configures the loaded classes within the GrailsApplication instance using the registered ArtefactHandler instances.java.lang.Class<?>[]getAllArtefacts()Returns all the classes identified as artefacts by ArtefactHandler instances.java.lang.Class<?>[]getAllClasses()Retrieves all classes loaded by the GrailsApplication.grails.core.GrailsApplicationClassgetApplicationClass()GrailsClassgetArtefact(java.lang.String artefactType, java.lang.String name)Retrieves an artefact for the given type and name.GrailsClassgetArtefactByLogicalPropertyName(java.lang.String type, java.lang.String logicalName)Retrieves an artefact by its logical property name.protected intgetArtefactCount(java.lang.String artefactType)Retrieves the number of artefacts registered for the given artefactType as defined by the ArtefactHandler.GrailsClassgetArtefactForFeature(java.lang.String artefactType, java.lang.Object featureID)Get an artefact GrailsClass by a "feature" which depending on the artefact may be a URI or tag name for exampleArtefactHandlergetArtefactHandler(java.lang.String type)Returns the ArtefactHandler for the given typeArtefactHandler[]getArtefactHandlers()Obtain a list of all the artefact handlersArtefactInfogetArtefactInfo(java.lang.String artefactType)Get the cache of classes for the specified artefact type.protected DefaultArtefactInfogetArtefactInfo(java.lang.String artefactType, boolean create)Get or create the cache of classes for the specified artefact type.GrailsClass[]getArtefacts(java.lang.String artefactType)Returns all of the GrailsClass instances for the given artefactType as defined by the ArtefactHandlerArtefactHandlergetArtefactType(java.lang.Class theClass)Returns the ArtefactHandler for the given class or nulljava.lang.Class<?>getClassForName(java.lang.String className)Retrieves a class from the GrailsApplication for the given name.grails.config.ConfiggetConfig()Returns the ConfigObject instance.protected GrailsClassgetFirstArtefact(java.lang.String artefactType)org.grails.datastore.mapping.model.MappingContextgetMappingContext()java.lang.ObjectgetProperty(java.lang.String propertyName)Override property access and hit on xxxxClasses to return class arrays of artefacts.org.springframework.core.io.ResourcegetResourceForClass(java.lang.Class theClazz)Retrieves the Spring Resource that was used to load the given Class.booleanhasArtefactHandler(java.lang.String type)Test whether an artefact handler exists for a given typeprotected voidinitArtefactHandlers()Initialises the default set of ArtefactHandler instances.voidinitialise()Initialise this GrailsApplication.protected static voidinitialiseGroovyExtensionModules()protected voidinitializeArtefacts(ArtefactHandler handler)Re-initialize the artefacts of the specified type.protected voidinitializeArtefacts(java.lang.String artefactType)Re-initialize the artefacts of the specified type.java.lang.ObjectinvokeMethod(java.lang.String methodName, java.lang.Object args)Overrides method invocation to return dynamic artefact methods.booleanisArtefact(java.lang.Class theClazz)Returns true if the given class is an artefact identified by one of the registered ArtefactHandler instances.booleanisArtefactOfType(java.lang.String artefactType, java.lang.Class theClazz)Returns true if the specified class is of the given artefact type as defined by the ArtefactHandler.booleanisArtefactOfType(java.lang.String artefactType, java.lang.String className)Returns true if the specified class name is of the given artefact type as defined by the ArtefactHandler.booleanisInitialised()Returns whether this GrailsApplication has been initialised or not.protected java.lang.Class<?>[]populateAllClasses()voidrebuild()Rebuilds this Application throwing away the class loader and re-constructing it from the loaded resources again.voidrefresh()Refreshes this GrailsApplication, rebuilding all of the artefact definitions as defined by the registered ArtefactHandler instances.protected voidrefreshArtefactGrailsClassCaches()Tell all our artefact info objects to update their internal state after we've added a bunch of classes.voidregisterArtefactHandler(ArtefactHandler handler)Registers a new ArtefactHandler that is responsible for identifying and managing a particular artefact type that is defined by some convention.voidsetBeanClassLoader(java.lang.ClassLoader classLoader)voidsetMappingContext(org.grails.datastore.mapping.model.MappingContext mappingContext)Configures theMappingContextfor this application-
Methods inherited from class org.grails.core.AbstractGrailsApplication
configChanged, getClassLoader, getMainContext, getMetadata, getOrder, getParentContext, isWarDeployed, onApplicationEvent, setApplicationContext, setConfig, setConfig, setMainContext, supportsEventType, supportsSourceType
-
-
-
-
Field Detail
-
GETCLASSESPROP_PATTERN
protected static final java.util.regex.Pattern GETCLASSESPROP_PATTERN
-
GETCLASSESMETH_PATTERN
protected static final java.util.regex.Pattern GETCLASSESMETH_PATTERN
-
ISCLASS_PATTERN
protected static final java.util.regex.Pattern ISCLASS_PATTERN
-
GETCLASS_PATTERN
protected static final java.util.regex.Pattern GETCLASS_PATTERN
-
allClasses
protected java.lang.Class<?>[] allClasses
-
log
protected static org.apache.commons.logging.Log log
-
loadedClasses
protected java.util.Set<java.lang.Class<?>> loadedClasses
-
artefactHandlers
protected ArtefactHandler[] artefactHandlers
-
artefactHandlersByName
protected java.util.Map<java.lang.String,ArtefactHandler> artefactHandlersByName
-
allArtefactClasses
protected java.util.List<java.lang.Class<?>> allArtefactClasses
-
artefactInfo
protected java.util.Map<java.lang.String,ArtefactInfo> artefactInfo
-
allArtefactClassesArray
protected java.lang.Class<?>[] allArtefactClassesArray
-
resources
protected org.springframework.core.io.Resource[] resources
-
initialised
protected boolean initialised
-
applicationClass
protected grails.core.GrailsApplicationClass applicationClass
-
proxyMappingContext
protected org.grails.datastore.mapping.model.MappingContext proxyMappingContext
-
mappingContext
protected org.grails.datastore.mapping.model.MappingContext mappingContext
-
-
Constructor Detail
-
DefaultGrailsApplication
public DefaultGrailsApplication()
Creates a new empty Grails application.
-
DefaultGrailsApplication
public DefaultGrailsApplication(grails.core.GrailsApplicationClass applicationClass)
Creates a new empty Grails application.
-
DefaultGrailsApplication
public DefaultGrailsApplication(java.lang.ClassLoader classLoader)
-
DefaultGrailsApplication
public DefaultGrailsApplication(java.lang.Class<?>... classes)
Construct an application for the given classes- Parameters:
classes- The classes
-
DefaultGrailsApplication
public DefaultGrailsApplication(java.lang.Class<?>[] classes, java.lang.ClassLoader classLoader)Creates a new GrailsApplication instance using the given classes and GroovyClassLoader.- Parameters:
classes- The classes that make up the GrailsApplicationclassLoader- The GroovyClassLoader to use
-
DefaultGrailsApplication
public DefaultGrailsApplication(org.springframework.core.io.Resource[] resources)
Loads a GrailsApplication using the given ResourceLocator instance which will search for appropriate class names
-
DefaultGrailsApplication
public DefaultGrailsApplication(org.grails.io.support.Resource[] resources)
Loads a GrailsApplication using the given ResourceLocator instance which will search for appropriate class names
-
-
Method Detail
-
getApplicationClass
public grails.core.GrailsApplicationClass getApplicationClass()
- Returns:
- The application class
-
initArtefactHandlers
protected void initArtefactHandlers()
Initialises the default set of ArtefactHandler instances.- See Also:
ArtefactHandler
-
getAllArtefacts
public java.lang.Class<?>[] getAllArtefacts()
Returns all the classes identified as artefacts by ArtefactHandler instances.- Specified by:
getAllArtefactsin interfaceGrailsApplication- Returns:
- An array of classes
-
populateAllClasses
protected java.lang.Class<?>[] populateAllClasses()
-
configureLoadedClasses
protected void configureLoadedClasses(java.lang.Class<?>[] classes)
Configures the loaded classes within the GrailsApplication instance using the registered ArtefactHandler instances.- Parameters:
classes- The classes to configure
-
refreshArtefactGrailsClassCaches
protected void refreshArtefactGrailsClassCaches()
Tell all our artefact info objects to update their internal state after we've added a bunch of classes.
-
addToLoaded
protected void addToLoaded(java.lang.Class<?> clazz)
-
getConfig
public grails.config.Config getConfig()
Description copied from interface:GrailsApplicationReturns the ConfigObject instance.- Specified by:
getConfigin interfaceGrailsApplication- Overrides:
getConfigin classAbstractGrailsApplication- Returns:
- The ConfigObject instance
-
getArtefactCount
protected int getArtefactCount(java.lang.String artefactType)
Retrieves the number of artefacts registered for the given artefactType as defined by the ArtefactHandler.- Parameters:
artefactType- The type of the artefact as defined by the ArtefactHandler- Returns:
- The number of registered artefacts
-
getAllClasses
public java.lang.Class<?>[] getAllClasses()
Retrieves all classes loaded by the GrailsApplication.- Specified by:
getAllClassesin interfaceGrailsApplication- Returns:
- All classes loaded by the GrailsApplication
-
getClassForName
public java.lang.Class<?> getClassForName(java.lang.String className)
Retrieves a class from the GrailsApplication for the given name.- Specified by:
getClassForNamein interfaceGrailsApplication- Overrides:
getClassForNamein classAbstractGrailsApplication- Parameters:
className- The class name- Returns:
- Either the Class instance or null if it doesn't exist
-
refresh
public void refresh()
Refreshes this GrailsApplication, rebuilding all of the artefact definitions as defined by the registered ArtefactHandler instances.- Specified by:
refreshin interfaceGrailsApplication
-
rebuild
public void rebuild()
Description copied from interface:GrailsApplicationRebuilds this Application throwing away the class loader and re-constructing it from the loaded resources again. Can only be called in development mode and an error will be thrown if called in a different enivronment- Specified by:
rebuildin interfaceGrailsApplication
-
getResourceForClass
public org.springframework.core.io.Resource getResourceForClass(java.lang.Class theClazz)
Retrieves the Spring Resource that was used to load the given Class.- Specified by:
getResourceForClassin interfaceGrailsApplication- Parameters:
theClazz- The class- Returns:
- Either a Spring Resource or null if no Resource was found for the given class
-
isArtefact
public boolean isArtefact(java.lang.Class theClazz)
Returns true if the given class is an artefact identified by one of the registered ArtefactHandler instances. Uses class name equality to handle class reloading- Specified by:
isArtefactin interfaceGrailsApplication- Parameters:
theClazz- The class to check- Returns:
- true if it is an artefact
-
isArtefactOfType
public boolean isArtefactOfType(java.lang.String artefactType, java.lang.Class theClazz)Returns true if the specified class is of the given artefact type as defined by the ArtefactHandler.- Specified by:
isArtefactOfTypein interfaceGrailsApplication- Parameters:
artefactType- The type of the artefacttheClazz- The class- Returns:
- true if it is of the specified artefactType
- See Also:
ArtefactHandler
-
isArtefactOfType
public boolean isArtefactOfType(java.lang.String artefactType, java.lang.String className)Returns true if the specified class name is of the given artefact type as defined by the ArtefactHandler.- Specified by:
isArtefactOfTypein interfaceGrailsApplication- Parameters:
artefactType- The type of the artefactclassName- The class name- Returns:
- true if it is of the specified artefactType
- See Also:
ArtefactHandler
-
getArtefact
public GrailsClass getArtefact(java.lang.String artefactType, java.lang.String name)
Retrieves an artefact for the given type and name.- Specified by:
getArtefactin interfaceGrailsApplication- Parameters:
artefactType- The artefact type as defined by a registered ArtefactHandlername- The name of the class- Returns:
- A GrailsClass instance or null if none could be found for the given artefactType and name
-
getArtefactType
public ArtefactHandler getArtefactType(java.lang.Class theClass)
Description copied from interface:GrailsApplicationReturns the ArtefactHandler for the given class or null- Specified by:
getArtefactTypein interfaceGrailsApplication- Parameters:
theClass- The class- Returns:
- The ArtefactHandler
-
getFirstArtefact
protected GrailsClass getFirstArtefact(java.lang.String artefactType)
-
getArtefacts
public GrailsClass[] getArtefacts(java.lang.String artefactType)
Returns all of the GrailsClass instances for the given artefactType as defined by the ArtefactHandler- Specified by:
getArtefactsin interfaceGrailsApplication- Parameters:
artefactType- The type of the artefact defined by the ArtefactHandler- Returns:
- An array of classes for the given artefact
-
addArtefact
public GrailsClass addArtefact(java.lang.String artefactType, java.lang.Class artefactClass)
Adds an artefact of the given type for the given Class.- Specified by:
addArtefactin interfaceGrailsApplication- Parameters:
artefactType- The type of the artefact as defined by a ArtefactHandler instanceartefactClass- A Class instance that matches the type defined by the ArtefactHandler- Returns:
- The GrailsClass if successful or null if it couldn't be added
- Throws:
GrailsConfigurationException- If the specified Class is not the same as the type defined by the ArtefactHandler- See Also:
ArtefactHandler
-
addArtefact
public GrailsClass addArtefact(java.lang.String artefactType, GrailsClass artefactGrailsClass)
Adds an artefact of the given type for the given GrailsClass.- Specified by:
addArtefactin interfaceGrailsApplication- Parameters:
artefactType- The type of the artefact as defined by a ArtefactHandler instanceartefactGrailsClass- A GrailsClass instance that matches the type defined by the ArtefactHandler- Returns:
- The GrailsClass if successful or null if it couldn't be added
- Throws:
GrailsConfigurationException- If the specified GrailsClass is not the same as the type defined by the ArtefactHandler- See Also:
ArtefactHandler
-
registerArtefactHandler
public void registerArtefactHandler(ArtefactHandler handler)
Registers a new ArtefactHandler that is responsible for identifying and managing a particular artefact type that is defined by some convention.- Specified by:
registerArtefactHandlerin interfaceGrailsApplication- Parameters:
handler- The ArtefactHandler to regster
-
hasArtefactHandler
public boolean hasArtefactHandler(java.lang.String type)
Description copied from interface:GrailsApplicationTest whether an artefact handler exists for a given type
- Specified by:
hasArtefactHandlerin interfaceGrailsApplication- Parameters:
type- The type of the handler- Returns:
- true if it does
-
getArtefactHandlers
public ArtefactHandler[] getArtefactHandlers()
Description copied from interface:GrailsApplicationObtain a list of all the artefact handlers
- Specified by:
getArtefactHandlersin interfaceGrailsApplication- Returns:
- The list, possible empty but not null, of all currently registered handlers
-
getArtefactHandler
public ArtefactHandler getArtefactHandler(java.lang.String type)
Description copied from interface:GrailsApplicationReturns the ArtefactHandler for the given type- Specified by:
getArtefactHandlerin interfaceGrailsApplication- Parameters:
type- The artefact handler type- Returns:
- The artefact handler
-
initializeArtefacts
protected void initializeArtefacts(java.lang.String artefactType)
Re-initialize the artefacts of the specified type. This gives handlers a chance to update caches etc.- Parameters:
artefactType- The type of artefact to init
-
clear
public void clear()
Clears the application returning it to an empty state. Very dangerous method, use with caution.
-
initializeArtefacts
protected void initializeArtefacts(ArtefactHandler handler)
Re-initialize the artefacts of the specified type. This gives handlers a chance to update caches etc.- Parameters:
handler- The handler to register
-
getArtefactInfo
protected DefaultArtefactInfo getArtefactInfo(java.lang.String artefactType, boolean create)
Get or create the cache of classes for the specified artefact type.- Parameters:
artefactType- The name of an artefact typecreate- Set to true if you want non-existent caches to be created- Returns:
- The cache of classes for the type, or null if no cache exists and create is false
-
getArtefactInfo
public ArtefactInfo getArtefactInfo(java.lang.String artefactType)
Get the cache of classes for the specified artefact type.- Specified by:
getArtefactInfoin interfaceGrailsApplication- Parameters:
artefactType- The name of an artefact type- Returns:
- The cache of classes for the type, or null if no cache exists
-
invokeMethod
public java.lang.Object invokeMethod(java.lang.String methodName, java.lang.Object args)Overrides method invocation to return dynamic artefact methods.
We will support getXXXXClasses() and isXXXXClass(class)
- Specified by:
invokeMethodin interfacegroovy.lang.GroovyObject- Parameters:
methodName- The name of the methodargs- The arguments to the method- Returns:
- The return value of the method
TODO Need to add matches for add
Class(java.lang.Class) and add Class(GrailsClass)
-
getProperty
public java.lang.Object getProperty(java.lang.String propertyName)
Override property access and hit on xxxxClasses to return class arrays of artefacts.- Specified by:
getPropertyin interfacegroovy.lang.GroovyObject- Parameters:
propertyName- The name of the property, if it ends in *Classes then match and invoke internal ArtefactHandler- Returns:
- All the artifacts or delegate to super.getProperty
-
initialise
public void initialise()
Description copied from interface:GrailsApplicationInitialise this GrailsApplication.- Specified by:
initialisein interfaceGrailsApplication
-
initialiseGroovyExtensionModules
protected static void initialiseGroovyExtensionModules()
-
getArtefactForFeature
public GrailsClass getArtefactForFeature(java.lang.String artefactType, java.lang.Object featureID)
Description copied from interface:GrailsApplicationGet an artefact GrailsClass by a "feature" which depending on the artefact may be a URI or tag name for example
- Specified by:
getArtefactForFeaturein interfaceGrailsApplication- Parameters:
artefactType- The type ID of the artefact, i.e. "TagLib"featureID- The "feature" ID, say a URL or tag name- Returns:
- The grails class or null if none is found
-
isInitialised
public boolean isInitialised()
Description copied from interface:GrailsApplicationReturns whether this GrailsApplication has been initialised or not.- Specified by:
isInitialisedin interfaceGrailsApplication- Returns:
- true if it has been initialised
-
getArtefactByLogicalPropertyName
public GrailsClass getArtefactByLogicalPropertyName(java.lang.String type, java.lang.String logicalName)
Description copied from interface:GrailsApplicationRetrieves an artefact by its logical property name. For example the logical property name of BookController would be book.- Specified by:
getArtefactByLogicalPropertyNamein interfaceGrailsApplication- Parameters:
type- The artefact typelogicalName- The logical name- Returns:
- The GrailsClass or null if it doesn't exist
-
addArtefact
public void addArtefact(java.lang.Class artefact)
Description copied from interface:GrailsApplicationAdds the given artefact, attempting to determine type from- Specified by:
addArtefactin interfaceGrailsApplication- Parameters:
artefact- The artefact to add
-
setBeanClassLoader
public void setBeanClassLoader(java.lang.ClassLoader classLoader)
- Specified by:
setBeanClassLoaderin interfaceorg.springframework.beans.factory.BeanClassLoaderAware- Overrides:
setBeanClassLoaderin classAbstractGrailsApplication
-
addOverridableArtefact
public void addOverridableArtefact(java.lang.Class artefact)
Description copied from interface:GrailsApplicationAdds an artefact that can be overriden by user defined classes- Specified by:
addOverridableArtefactin interfaceGrailsApplication- Parameters:
artefact- An overridable artefact
-
addOverridableArtefact
public GrailsClass addOverridableArtefact(java.lang.String artefactType, java.lang.Class artefactClass)
Adds an artefact of the given type for the given Class.- Parameters:
artefactType- The type of the artefact as defined by a ArtefactHandler instanceartefactClass- A Class instance that matches the type defined by the ArtefactHandler- Returns:
- The GrailsClass if successful or null if it couldn't be added
- Throws:
GrailsConfigurationException- If the specified Class is not the same as the type defined by the ArtefactHandler- See Also:
ArtefactHandler
-
addArtefact
protected GrailsClass addArtefact(java.lang.String artefactType, java.lang.Class<?> artefactClass, boolean overrideable)
-
getMappingContext
public org.grails.datastore.mapping.model.MappingContext getMappingContext()
- Specified by:
getMappingContextin interfaceGrailsApplication- Returns:
- The GORM
MappingContext. Returns null if none present
-
setMappingContext
public void setMappingContext(org.grails.datastore.mapping.model.MappingContext mappingContext)
Description copied from interface:GrailsApplicationConfigures theMappingContextfor this application- Specified by:
setMappingContextin interfaceGrailsApplication- Parameters:
mappingContext- The mapping context
-
-