Package org.springframework.beans.factory.config

Examples of org.springframework.beans.factory.config.AutowireCapableBeanFactory


    public static void initComponentsLifeCycle() {
        if ( ! s_initializeBeans )
            return;

        AutowireCapableBeanFactory beanFactory = s_appContext.getAutowireCapableBeanFactory();

        Map<String, ComponentMethodInterceptable> interceptableComponents = getApplicationContext().getBeansOfType(ComponentMethodInterceptable.class);
        for (Map.Entry<String, ComponentMethodInterceptable> entry : interceptableComponents.entrySet()) {
            Object bean = getTargetObject(entry.getValue());
            beanFactory.configureBean(bean, entry.getKey());
        }

        Map<String, ComponentLifecycle> lifecycleComponents = getApplicationContext().getBeansOfType(ComponentLifecycle.class);

        Map<String, ComponentLifecycle>[] classifiedComponents = new Map[ComponentLifecycle.MAX_RUN_LEVELS];
View Full Code Here


        }
    }

    public static <T> T inject(Object instance) {
        // autowire dynamically loaded object
        AutowireCapableBeanFactory beanFactory = getApplicationContext(instance).getAutowireCapableBeanFactory();
        beanFactory.autowireBean(instance);
        return (T)instance;
    }
View Full Code Here

    public static ApplicationContext getApplicationContext() { 
        return s_appContext; 
    }
   
    public static void initComponentsLifeCycle() {
        AutowireCapableBeanFactory  beanFactory = s_appContext.getAutowireCapableBeanFactory();

      Map<String, ComponentMethodInterceptable> interceptableComponents = getApplicationContext().getBeansOfType(
        ComponentMethodInterceptable.class);
      for(Map.Entry<String, ComponentMethodInterceptable> entry : interceptableComponents.entrySet()) {
        Object bean = getTargetObject(entry.getValue());
        beanFactory.configureBean(bean, entry.getKey());
      }
     
      Map<String, ComponentLifecycle> lifecyleComponents = getApplicationContext().getBeansOfType(ComponentLifecycle.class);
      Map[] classifiedComponents = new Map[ComponentLifecycle.MAX_RUN_LEVELS];
View Full Code Here

    }
    }

    public static <T> T inject(Object instance) {
        // autowire dynamically loaded object
        AutowireCapableBeanFactory  beanFactory = s_appContext.getAutowireCapableBeanFactory();
        beanFactory.autowireBean(instance);
        return (T)instance;
    }
View Full Code Here

    protected void configBuildInTag(){
      if (configurator.getTags() == null){
        configurator.setTags(new ArrayList<ITemplate>());
      }
     
      final AutowireCapableBeanFactory factory = this.getApplicationContext().getAutowireCapableBeanFactory();
      for (final Class<? extends ITemplate> clazz: this.defaultTagClasses()){
        final Object tag = factory.autowire(
            clazz, AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR, false);
       
        configurator.getTags().add((ITemplate) tag);
      }
    }
View Full Code Here

   
    private void initWildcardDefinitionMap() {
        if (null != appContext) {
            for (String n : appContext.getBeanDefinitionNames()) {
                if (isWildcardBeanName(n)) {
                    AutowireCapableBeanFactory bf = appContext.getAutowireCapableBeanFactory();
                    BeanDefinitionRegistry bdr = (BeanDefinitionRegistry) bf;
                    BeanDefinition bd = bdr.getBeanDefinition(n);
                    String className = bd.getBeanClassName();
                    if (null != className) {
                        if (!wildCardBeanDefinitions.containsKey(className)) {
View Full Code Here

    this.schemaConfiguration = schemaConfiguration;
  }

  @InstallerMethod
  public void install() {
    AutowireCapableBeanFactory beanFactory = AcrossContextUtils.getBeanFactory( acrossContext.getContext() );

    SpringLiquibase liquibase = new SpringLiquibase();
    liquibase.setChangeLog( changelog );
    liquibase.setDataSource( dataSource );

    if ( schemaConfiguration != null ) {
      liquibase.setChangeLogParameters( buildParameters( schemaConfiguration ) );
    }

    beanFactory.autowireBeanProperties( liquibase, AutowireCapableBeanFactory.AUTOWIRE_NO, false );
    beanFactory.initializeBean( liquibase, "" );
  }
View Full Code Here

    @Override
    public void setJspContext(JspContext context) {
        super.setJspContext(context);

        AutowireCapableBeanFactory beanFactory = (AutowireCapableBeanFactory) context.findAttribute(ApplicationController.BEAN_FACTORY_KEY);
        beanFactory.autowireBean(this);
    }
View Full Code Here

   */
  public static void autowireBean(Object bean, ApplicationContext applicationContext)
  {
    if (applicationContext != null && bean != null)
    {
      AutowireCapableBeanFactory bf = applicationContext.getAutowireCapableBeanFactory();
      bf.autowireBean(bean);
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.beans.factory.config.AutowireCapableBeanFactory

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.