Package org.springframework.beans.factory.config

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


        if (properties == null)
            properties = System.getProperty("co.paralleluniverse.galaxy.propertiesFile");
        this.context = SpringContainerHelper.createContext("co.paralleluniverse.galaxy",
                configFile != null ? new FileSystemResource(configFile) : new ClassPathResource("galaxy.xml"),
                properties instanceof String ? new FileSystemResource((String) properties) : properties,
                new BeanFactoryPostProcessor() {
                    @Override
                    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory1) throws BeansException {
                        final DefaultListableBeanFactory beanFactory = ((DefaultListableBeanFactory) beanFactory1);

                        // messenger
View Full Code Here


    private Grid(String configFile, Object properties) throws InterruptedException {
        this.context = SpringContainerHelper.createContext("co.paralleluniverse.galaxy",
                configFile != null ? new FileSystemResource(configFile) : new ClassPathResource("galaxy.xml"),
                properties instanceof String ? new FileSystemResource((String) properties) : properties,
                new BeanFactoryPostProcessor() {

                    @Override
                    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory1) throws BeansException {
                        final DefaultListableBeanFactory beanFactory = ((DefaultListableBeanFactory) beanFactory1);
View Full Code Here

        //mbeanExporter.setServer(ManagementFactory.getPlatformMBeanServer());
        //beanFactory.registerSingleton("mbeanExporter", mbeanExporter);
        context.registerBeanDefinition("mbeanExporter", getMBeanExporterBeanDefinition(defaultDomain));

        // inject bean names into components
        context.addBeanFactoryPostProcessor(new BeanFactoryPostProcessor() {
            @Override
            public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
                for (String beanName : beanFactory.getBeanDefinitionNames()) {
                    try {
                        final BeanDefinition beanDefinition = beanFactory.getBeanDefinition(beanName);
View Full Code Here

   *         cores exists.
   */
  @Bean
  public static BeanFactoryPostProcessor solrServerFactory(
      final CoreContainer cores) {
    return new BeanFactoryPostProcessor() {
      @Override
      public void postProcessBeanFactory(
          final ConfigurableListableBeanFactory beanFactory) {
        for (String coreName : coreNames(cores)) {
          coreName = isEmpty(coreName)
View Full Code Here

   * @param context The application's context.
   * @param mode The application's mode.
   */
  private static void complement(final ConfigurableApplicationContext context, final Mode mode) {
    context.addApplicationListener(new ConfigureComponents());
    context.addBeanFactoryPostProcessor(new BeanFactoryPostProcessor() {
      @Override
      public void postProcessBeanFactory(final ConfigurableListableBeanFactory beanFactory) {
        beanFactory.addBeanPostProcessor(modeAwareBeanPostProcessor(mode));
        beanFactory.registerSingleton(APP_MODE, mode);
        // Enable @Named and @Value
View Full Code Here

   *         cores exists.
   */
  @Bean
  public static BeanFactoryPostProcessor solrServerFactory(
      final CoreContainer cores) {
    return new BeanFactoryPostProcessor() {
      @Override
      public void postProcessBeanFactory(
          final ConfigurableListableBeanFactory beanFactory) {
        for (String coreName : coreNames(cores)) {
          coreName = isEmpty(coreName)
View Full Code Here

   * @param exclude
   */
  private void invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory beanFactory, Class type, Class exclude) {
    // Invoke factory processors registered with the context instance.
    for (Iterator it = getBeanFactoryPostProcessors().iterator(); it.hasNext();) {
      BeanFactoryPostProcessor factoryProcessor = (BeanFactoryPostProcessor) it.next();
      // check the exclude type
      if (type.isInstance(factoryProcessor) && (exclude == null || !exclude.isInstance(factoryProcessor))) {
        factoryProcessor.postProcessBeanFactory(beanFactory);
      }
    }

    // Do not initialize FactoryBeans here: We need to leave all regular
    // beans uninitialized to let the bean factory post-processors apply to
View Full Code Here

   * @param beanFactory
   * @param postProcessors
   */
  private void invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory beanFactory, List postProcessors) {
    for (Iterator it = postProcessors.iterator(); it.hasNext();) {
      BeanFactoryPostProcessor postProcessor = (BeanFactoryPostProcessor) it.next();
      postProcessor.postProcessBeanFactory(beanFactory);
    }
  }
View Full Code Here

      log.debug("No application context created for bundle " + bundleString);
      return;
    }

    // create a dedicated hook for this application context
    BeanFactoryPostProcessor processingHook = new OsgiBeanFactoryPostProcessorAdapter(localBundleContext,
      postProcessors);

    // add in the post processors
    localApplicationContext.addBeanFactoryPostProcessor(processingHook);
View Full Code Here

TOP

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

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.