org.springframework.richclient.application
Class ProgressMonitoringBeanFactoryPostProcessor

java.lang.Object
  extended by org.springframework.richclient.application.ProgressMonitoringBeanFactoryPostProcessor
All Implemented Interfaces:
BeanFactoryPostProcessor

public class ProgressMonitoringBeanFactoryPostProcessor
extends Object
implements BeanFactoryPostProcessor

A BeanFactoryPostProcessor that notifies a specified ProgressMonitor of progress made while loading a bean factory.

The messages sent to the progress monitor can be internationalized by providing a MessageSource to the constructor of this class. Note that if a MessageSource is provided it must already be initialized in order for it to successfully retrieve messages.

The progress monitor will be notified once prior to initializing the beans in the bean factory and once for each singleton bean before it is initialized. The message keys used to find these messages are "progress.loading.applicationContext" and "progress.loading.bean". If the message source is unable to find any messages under these keys, or if no message source is provided, default messages (in English) will be used instead.

Since:
0.3.0
Author:
Kevin Stembridge
See Also:
ProgressMonitor

Field Summary
static String LOADING_APP_CONTEXT_KEY
          The message key used to retrieve the message to be sent to the progress monitor when the application context begins loading.
static String LOADING_BEAN_KEY
          The message key used to retrieve the message to be sent to the progress monitor for each bean that is loaded.
 
Constructor Summary
ProgressMonitoringBeanFactoryPostProcessor(ProgressMonitor progressMonitor, MessageSource messageSource)
          Creates a new ProgressMonitoringBeanFactoryPostProcessor that will report the progress of loading the beans in a bean factory to the given progress monitor, optionally providing internationalized messages.
 
Method Summary
 void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
          Notifies this instance's associated progress monitor of progress made while processing the given bean factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOADING_APP_CONTEXT_KEY

public static final String LOADING_APP_CONTEXT_KEY
The message key used to retrieve the message to be sent to the progress monitor when the application context begins loading.

See Also:
Constant Field Values

LOADING_BEAN_KEY

public static final String LOADING_BEAN_KEY
The message key used to retrieve the message to be sent to the progress monitor for each bean that is loaded.

See Also:
Constant Field Values
Constructor Detail

ProgressMonitoringBeanFactoryPostProcessor

public ProgressMonitoringBeanFactoryPostProcessor(ProgressMonitor progressMonitor,
                                                  MessageSource messageSource)
Creates a new ProgressMonitoringBeanFactoryPostProcessor that will report the progress of loading the beans in a bean factory to the given progress monitor, optionally providing internationalized messages.

Parameters:
progressMonitor - The progress monitor that will be notified of progress while processing the bean factory.
messageSource - The message source that will be used to resolve messages to be displayed by the progress monitor. May be null.
Throws:
IllegalArgumentException - if progressMonitor is null.
Method Detail

postProcessBeanFactory

public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
                            throws BeansException
Notifies this instance's associated progress monitor of progress made while processing the given bean factory.

Specified by:
postProcessBeanFactory in interface BeanFactoryPostProcessor
Parameters:
beanFactory - the bean factory that is to be processed.
Throws:
BeansException


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.