Package org.springframework.beans.factory.config

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


      ClassLoader classLoader = context.getClassLoader();

      Properties properties = new BeanSetPropertiesReader().readBeanSetDefinition(classLoader, overrides);     
     
      final ConfigurableListableBeanFactory beanFactory = context.getBeanFactory();
      final RecordingImportingBeanDefinitionDocumentReader documentReader = new RecordingImportingBeanDefinitionDocumentReader(properties);

      XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(ModuleUtils.castToBeanDefinitionRegistry(beanFactory)){
        protected BeanDefinitionDocumentReader createBeanDefinitionDocumentReader() {
          return documentReader;
View Full Code Here


      if (logger.isDebugEnabled()) logger.debug("Setting class loader to " + classLoader);

      final Resource[] resources = moduleLoader.getSpringConfigResources(definition, classLoader);

      ConfigurableApplicationContext context = moduleLoader.newApplicationContext(parent, definition, classLoader);
      ConfigurableListableBeanFactory beanFactory = context.getBeanFactory();
      beanFactory.addBeanPostProcessor(new ServiceRegistryPostProcessor(serviceRegistry));
      beanFactory.addBeanPostProcessor(new ModuleDefinitionPostProcessor(definition));
     
      BeanDefinitionReader reader = moduleLoader.newBeanDefinitionReader(context, definition);

      if (reader instanceof AbstractBeanDefinitionReader) {
        ((AbstractBeanDefinitionReader) reader).setBeanClassLoader(classLoader);
View Full Code Here

    }
    return classLoaderFactory;
  }

  public XmlBeanDefinitionReader newBeanDefinitionReader(ConfigurableApplicationContext context, ModuleDefinition definition) {
    final ConfigurableListableBeanFactory beanFactory = context.getBeanFactory();
    return new XmlBeanDefinitionReader(ModuleUtils.castToBeanDefinitionRegistry(beanFactory));
  }
View Full Code Here

    boolean trace = log.isTraceEnabled();

    try {
      currentThread.setContextClassLoader(context.getClassLoader());

      ConfigurableListableBeanFactory beanFactory = context.getBeanFactory();

      if (trace)
        log.trace("Looking for dependency factories inside bean factory [" + beanFactory.toString() + "]");

      Map localFactories = BeanFactoryUtils.beansOfTypeIncludingAncestors(beanFactory,
        OsgiServiceDependencyFactory.class, true, false);

      if (debug)
View Full Code Here

   
    /* *************** package level methods ************** */

    void processBeanFactory(final BeanFactoryCallback callback) {
       
        ConfigurableListableBeanFactory listableBeanFactory = ObjectUtils.cast(beanFactory, ConfigurableListableBeanFactory.class);
          
        // gets list of all bean definitions in this context
        final String[] beanNames = listableBeanFactory.getBeanDefinitionNames();
        for (String beanName : beanNames) {

            final BeanDefinition beanDefinition = listableBeanFactory.getBeanDefinition(beanName);
            if (!beanDefinition.isAbstract()) {

                final Object bean = beanFactory.getBean(beanName);
                callback.doWithBean(beanName, bean);
            }
View Full Code Here

    resourceLoaders.add(new ClassPathResourceLoader());
    return resourceLoaders;
  }

  public XmlBeanDefinitionReader newBeanDefinitionReader(ConfigurableApplicationContext context, ModuleDefinition definition) {
    final ConfigurableListableBeanFactory beanFactory = context.getBeanFactory();
    return new XmlBeanDefinitionReader(ModuleUtils.castToBeanDefinitionRegistry(beanFactory));
  }
View Full Code Here

      Thread.currentThread().setContextClassLoader(classLoader);
     
      if (logger.isDebugEnabled()) logger.debug("Setting class loader to " + classLoader);

      ConfigurableApplicationContext context = moduleLoader.newApplicationContext(parent, definition, classLoader);
      ConfigurableListableBeanFactory beanFactory = context.getBeanFactory();
      addBeanPostProcessors(definition, beanFactory);
     
      BeanDefinitionReader reader = moduleLoader.newBeanDefinitionReader(context, definition);

      if (reader != null) {
View Full Code Here

        if (!OsgiBundleUtils.isBundleActive(getBundle())) {
          throw new ApplicationContextException("Unable to refresh application context: bundle is "
              + OsgiStringUtils.bundleStateAsString(getBundle()));
        }

        ConfigurableListableBeanFactory beanFactory = null;
        // Prepare this context for refreshing.
        prepareRefresh();

        // Tell the subclass to refresh the internal bean factory.
        beanFactory = obtainFreshBeanFactory();

        // Prepare the bean factory for use in this context.
        prepareBeanFactory(beanFactory);

        try {
          // Allows post-processing of the bean factory in context
          // subclasses.
          postProcessBeanFactory(beanFactory);

          // Invoke factory processors registered as beans in the
          // context.
          invokeBeanFactoryPostProcessors(beanFactory);

          // Register bean processors that intercept bean creation.
          registerBeanPostProcessors(beanFactory);

        }
        catch (BeansException ex) {
          // Destroy already created singletons to avoid dangling
          // resources.
          beanFactory.destroySingletons();
          cancelRefresh(ex);
          // propagate exception to the caller
          throw ex;
        }
      }
View Full Code Here

      synchronized (contextMonitor) {
        thread.setContextClassLoader(contextClassLoaderProvider().getContextClassLoader());

        try {
          ConfigurableListableBeanFactory beanFactory = getBeanFactory();

          // Initialize message source for this context.
          initMessageSource();

          // Initialize event multicaster for this context.
View Full Code Here

    synchronized (this.startupShutdownMonitor) {
      // Prepare this context for refreshing.
      prepareRefresh();

      // Tell the subclass to refresh the internal bean factory.
      ConfigurableListableBeanFactory beanFactory = obtainFreshBeanFactory();

      // Prepare the bean factory for use in this context.
      prepareBeanFactory(beanFactory);

      try {
View Full Code Here

TOP

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

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.