Class AbstractGrailsApplication

  • 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
    Direct Known Subclasses:
    DefaultGrailsApplication

    public abstract class AbstractGrailsApplication
    extends groovy.lang.GroovyObjectSupport
    implements GrailsApplication, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.context.event.SmartApplicationListener
    • Field Detail

      • classLoader

        protected java.lang.ClassLoader classLoader
      • config

        protected grails.config.Config config
      • parentContext

        protected org.springframework.context.ApplicationContext parentContext
      • applicationMeta

        protected grails.util.Metadata applicationMeta
      • contextInitialized

        protected boolean contextInitialized
    • Constructor Detail

      • AbstractGrailsApplication

        public AbstractGrailsApplication()
    • Method Detail

      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)
                                   throws org.springframework.beans.BeansException
        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
        Throws:
        org.springframework.beans.BeansException
      • getMetadata

        public grails.util.Metadata getMetadata()
        Description copied from interface: GrailsApplication

        Get access to the project's metadata, specified in application.yml and grails.build.info if it is present

        This provides access to information like required grails version, application name, version etc but NOT general application settings.

        Specified by:
        getMetadata in interface GrailsApplication
        Returns:
        A read-only Map of data about the application, not environment specific
      • isWarDeployed

        public boolean isWarDeployed()
        Description copied from interface: GrailsApplication
        Returns true if this application has been deployed as a WAR file
        Specified by:
        isWarDeployed in interface GrailsApplication
        Returns:
        true if the application is WAR deployed
      • getConfig

        public grails.config.Config getConfig()
        Description copied from interface: GrailsApplication
        Returns the ConfigObject instance.
        Specified by:
        getConfig in interface GrailsApplication
        Returns:
        The ConfigObject instance
      • setConfig

        public void setConfig​(grails.config.Config config)
      • setConfig

        public void setConfig​(groovy.util.ConfigObject config)
      • setBeanClassLoader

        public void setBeanClassLoader​(java.lang.ClassLoader classLoader)
        Specified by:
        setBeanClassLoader in interface org.springframework.beans.factory.BeanClassLoaderAware
      • getClassLoader

        public java.lang.ClassLoader getClassLoader()
        Description copied from interface: GrailsApplication
        Returns the class loader instance for the Grails application.
        Specified by:
        getClassLoader in interface GrailsApplication
        Returns:
        The ClassLoader instance
      • getClassForName

        public java.lang.Class getClassForName​(java.lang.String className)
        Description copied from interface: GrailsApplication
        Retrieves a class for the given name within the GrailsApplication or returns null
        Specified by:
        getClassForName in interface GrailsApplication
        Parameters:
        className - The name of the class
        Returns:
        The class or null
      • getMainContext

        public org.springframework.context.ApplicationContext getMainContext()
        Description copied from interface: GrailsApplication
        Returns the Spring context for this application. Note that this will return null until the application is fully initialised. This context contains all the application artifacts, plugin beans, the works.
        Specified by:
        getMainContext in interface GrailsApplication
      • setMainContext

        public void setMainContext​(org.springframework.context.ApplicationContext context)
        Description copied from interface: GrailsApplication
        Sets the main Spring context for this application.
        Specified by:
        setMainContext in interface GrailsApplication
      • onApplicationEvent

        public void onApplicationEvent​(org.springframework.context.ApplicationEvent event)
        Specified by:
        onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
      • supportsEventType

        public boolean supportsEventType​(java.lang.Class<? extends org.springframework.context.ApplicationEvent> eventType)
        Specified by:
        supportsEventType in interface org.springframework.context.event.SmartApplicationListener
      • supportsSourceType

        public boolean supportsSourceType​(java.lang.Class<?> sourceType)
        Specified by:
        supportsSourceType in interface org.springframework.context.event.SmartApplicationListener
      • getOrder

        public int getOrder()
        Specified by:
        getOrder in interface org.springframework.core.Ordered
        Specified by:
        getOrder in interface org.springframework.context.event.SmartApplicationListener