class AbstractPipelineStage implements PipelineStage, ApplicationContextAware,
                                           BeanFactoryAware, StartupReporterAware, InitializingBean {

    protected final ClassLoader               appClassLoader = Thread.currentThread()
                                                                 .getContextClassLoader();

    protected ApplicationRuntimeModel         application;

    protected ConfigurableApplicationContext  applicationContext;

    protected StartupReporter                 startupReporter;

    protected ConfigurableListableBeanFactory beanFactory;

    protected BaseStat                        baseStat;

    @Override
    public void process() throws Exception {
        BaseStat stat = createBaseStat();
        stat.setName(getName());
        stat.setStartTime(System.currentTimeMillis());
        this.baseStat = stat;
        try {
            doProcess();
        } finally {
            stat.setEndTime(System.currentTimeMillis());
            if (startupReporter != null) {
                startupReporter.addCommonStartupStat(stat);
            }
        }
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        Assert.notNull(application, "applicationRuntimeModel must not be null");
    }

    @Override
    public void setStartupReporter(StartupReporter startupReporter) throws BeansException {
        this.startupReporter = startupReporter;
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {<FILL_FUNCTION_BODY>}

    @Override
    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
        Assert.isTrue(beanFactory instanceof ConfigurableListableBeanFactory,
            "beanFactory must implement ConfigurableListableBeanFactory");
        this.beanFactory = (ConfigurableListableBeanFactory) beanFactory;
    }

    public ApplicationRuntimeModel getApplicationRuntimeModel() {
        return application;
    }

    public void setApplicationRuntimeModel(ApplicationRuntimeModel application) {
        this.application = application;
    }

    protected BaseStat createBaseStat() {
        return new BaseStat();
    }

    /**
     * Do process pipeline stage, subclasses should override this method.
     *
     * @throws Exception if a failure occurred
     */
    protected abstract void doProcess() throws Exception;
}

        Assert.isTrue(applicationContext instanceof ConfigurableApplicationContext,
            "applicationContext must implement ConfigurableApplicationContext");
        this.applicationContext = (ConfigurableApplicationContext) applicationContext;
    
<no_super_class>