Package org.springframework.context

Examples of org.springframework.context.ApplicationContextAware


     *
     * @param page the page instance to activate
     */
    protected void activatePageInstance(Page page) {
        if (page instanceof ApplicationContextAware) {
            ApplicationContextAware aware =
                (ApplicationContextAware) page;
            aware.setApplicationContext(getApplicationContext());
        }
    }
View Full Code Here


                logger.debug("No " + ClassUtils.getShortName(type) + " found, using default " +
                        ClassUtils.getShortName(defaultType));
            }
            T defaultStrategy = BeanUtils.instantiateClass(defaultType);
            if (defaultStrategy instanceof ApplicationContextAware) {
                ApplicationContextAware applicationContextAware = (ApplicationContextAware) defaultStrategy;
                applicationContextAware.setApplicationContext(applicationContext);
            }
            if (defaultStrategy instanceof InitializingBean) {
                InitializingBean initializingBean = (InitializingBean) defaultStrategy;
                try {
                    initializingBean.afterPropertiesSet();
View Full Code Here

            }
            if (strategy instanceof MessageSourceAware) {
                ((MessageSourceAware) strategy).setMessageSource(applicationContext);
            }
            if (strategy instanceof ApplicationContextAware) {
                ApplicationContextAware applicationContextAware = (ApplicationContextAware) strategy;
                applicationContextAware.setApplicationContext(applicationContext);
            }
            if (applicationContext instanceof WebApplicationContext && strategy instanceof ServletContextAware) {
                ServletContext servletContext = ((WebApplicationContext) applicationContext).getServletContext();
                ((ServletContextAware) strategy).setServletContext(servletContext);
            }
View Full Code Here

    @Override
    protected void activatePageInstance(Page page) {
        ApplicationContext applicationContext = getApplicationContext();

        if (page instanceof ApplicationContextAware) {
            ApplicationContextAware aware =
                (ApplicationContextAware) page;
            aware.setApplicationContext(applicationContext);
        }

        Class pageClass = page.getClass();
        String beanName = toBeanName(pageClass);
View Full Code Here

            while (i.hasNext()) {
                PackageConfig packageConfig = (PackageConfig) i.next();
                ExternalReferenceResolver resolver = packageConfig.getExternalRefResolver();
                if (resolver == null || !(resolver instanceof ApplicationContextAware))
                    continue;
                ApplicationContextAware contextAware = (ApplicationContextAware) resolver;
                contextAware.setApplicationContext(appContext);
            }
           
        }
View Full Code Here

        Map<String, String> emptyMap = Collections.emptyMap();
        Map<String,String> parameterMap = (initParameters != null ? initParameters : emptyMap);
        IntegrationFilterConfig config = newFilterConfig(parameterMap);
       
        if (filter instanceof ApplicationContextAware) {
            ApplicationContextAware awa = (ApplicationContextAware) filter;
            awa.setApplicationContext(applicationContext);
        }
       
        initFilterProperties(filter);      
        filter.init(config);
    }
View Full Code Here

        Map<String, String> emptyMap = Collections.emptyMap();
        Map<String,String> parameterMap = (initParameters != null ? initParameters : emptyMap);
        IntegrationFilterConfig config = newFilterConfig(parameterMap);
       
        if (filter instanceof ApplicationContextAware) {
            ApplicationContextAware awa = (ApplicationContextAware) filter;
            awa.setApplicationContext(applicationContext);
        }
       
        initFilterProperties(filter);      
        filter.init(config);
    }
View Full Code Here

       
        servlet = ObjectUtils.cast(BeanUtils.instantiateClass(servletClass), Servlet.class);
        IntegrationServletConfig config = newServletConfig(initParameters);
       
        if (servlet instanceof ApplicationContextAware) {
            ApplicationContextAware awa = (ApplicationContextAware) servlet;
            awa.setApplicationContext(applicationContext);
        }
       
        initServletProperties(servlet);    
        servlet.init(config);
    }
View Full Code Here

        Map<String, String> emptyMap = Collections.emptyMap();
        Map<String,String> parameterMap = (initParameters != null ? initParameters : emptyMap);
        IntegrationFilterConfig config = newFilterConfig(parameterMap);
       
        if (filter instanceof ApplicationContextAware) {
            ApplicationContextAware awa = (ApplicationContextAware) filter;
            awa.setApplicationContext(applicationContext);
        }
       
        initFilterProperties(filter);      
        filter.init(config);
    }
View Full Code Here

        Map<String, String> emptyMap = Collections.emptyMap();
        Map<String,String> parameterMap = (initParameters != null ? initParameters : emptyMap);
        IntegrationServletConfig config = newServletConfig(parameterMap);
       
        if (servlet instanceof ApplicationContextAware) {
            ApplicationContextAware awa = (ApplicationContextAware) servlet;
            awa.setApplicationContext(applicationContext);
        }
       
        initServletProperties(servlet);    
        servlet.init(config);
    }
View Full Code Here

TOP

Related Classes of org.springframework.context.ApplicationContextAware

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.