Class ApplicationContextAccessor

java.lang.Object
org.craftercms.commons.spring.context.ApplicationContextAccessor
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

public class ApplicationContextAccessor extends Object implements org.springframework.context.ApplicationContextAware
Wraps an instance of ApplicationContext and provides simple access to beans for Groovy & Freemarker
Since:
4.0
Author:
joseross
  • Constructor Details

    • ApplicationContextAccessor

      public ApplicationContextAccessor()
    • ApplicationContextAccessor

      public ApplicationContextAccessor(org.springframework.context.ApplicationContext actualApplicationContext)
  • Method Details

    • 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
    • get

      public Object get(String beanName)
    • get

      public <T> T get(String beanName, Class<T> requiredType)
    • getApplicationContext

      protected org.springframework.context.ApplicationContext getApplicationContext()