<commit_before>
/*
 * Copyright (C) 2011 <NAME>. All rights reserved.
 *
 * $Id$
 */

package org.dellroad.stuff.vaadin;

import javax.servlet.ServletContext;

import org.springframework.beans.BeanUtils;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.SourceFilteringListener;
import org.springframework.web.context.ConfigurableWebApplicationContext;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
import org.springframework.web.context.support.XmlWebApplicationContext;

/**
 * {@link ContextApplication} implementation that loads and initializes an associated Spring {@link WebApplicationContext}
 * on application startup.
 *
 * <p>
 * This setup works analagously to the way Spring's {@link org.springframework.web.servlet.DispatcherServlet DispatcherServlet}
 * creates a per-servlet application context whose parent context is the context associated with
 * the overal servlet context. In this case, each new {@link SpringContextApplication} instance results in a new
 * application context being created. When an {@link SpringContextApplication} instance is closed, the corresponding
 * Spring application context is also closed.
 * </p>
 *
 * <p>
 * By default, each instance of this class is itself autowired by the associated application context; this behavior
 * can be disabled by overriding {@link #isAutowire} to return {@code false}.
 * </p>
 *
 * <p>
 * For the application subclass {@code com.example.FooApplication}, this class will find and load an XML file named
 * {@code FooApplication.xml} to create the new Spring application context (this naming scheme {@linkplain #getApplicationName
 * can be overriden}).
 * </p>
 *
 * <p>
 * Note: Requires Servlet 3.0.
 * </p>
 */
@SuppressWarnings("serial")
public abstract class SpringContextApplication extends ContextApplication {

    private ConfigurableWebApplicationContext context;

    /**
     * Get this instance's associated application context.
     */
    public ConfigurableWebApplicationContext getApplicationContext() {
        return this.context;
    }

    /**
     * Initializes the associated {@link WebApplicationContext}.
     */
    protected final void initApplication() {
<commit_msg>More Javadoc tweaks.<commit_after>
/*
 * Copyright (C) 2011 <NAME>. All rights reserved.
 *
 * $Id$
 */

package org.dellroad.stuff.vaadin;

import javax.servlet.ServletContext;

import org.springframework.beans.BeanUtils;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.SourceFilteringListener;
import org.springframework.web.context.ConfigurableWebApplicationContext;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
import org.springframework.web.context.support.XmlWebApplicationContext;

/**
 * {@link ContextApplication} implementation that loads and initializes an associated Spring {@link WebApplicationContext}
 * on application startup.
 *
 * <p>
 * This setup works similar to the way Spring's {@link org.springframework.web.servlet.DispatcherServlet DispatcherServlet}
 * creates a per-servlet application context whose parent context is the one associated with the overal servlet context
 * (e.g., the one created by {@link org.springframework.web.context.ContextLoaderListener ContextLoaderListener}.
 * In this case, each new {@link SpringContextApplication} instance results in a new Spring application context being created.
 * When a {@link SpringContextApplication} instance is closed, the corresponding Spring application context is also closed.
 * </p>
 *
 * <p>
 * By default, each instance of this class is itself autowired by the associated application context; this behavior
 * can be disabled by overriding {@link #isAutowire} to return {@code false}.
 * </p>
 *
 * <p>
 * For the application subclass {@code com.example.FooApplication}, this class will look for an XML file named
 * {@code FooApplication.xml} to create the new Spring application context (this naming scheme {@linkplain #getApplicationName
 * can be overriden}).
 * </p>
 *
 * <p>
 * Note: Requires Servlet 3.0.
 * </p>
 */
@SuppressWarnings("serial")
public abstract class SpringContextApplication extends ContextApplication {

    private ConfigurableWebApplicationContext context;

    /**
     * Get this instance's associated application context.
     */
    public ConfigurableWebApplicationContext getApplicationContext() {
        return this.context;
    }

    /**
     * Initializes the associated {@link WebApplicationContext}.
     */
    protected final void initApplication() {

{'fraction_non_alphanumeric': 0.08681672025723473, 'fraction_numerical': 0.002411575562700965, 'mean_word_length': 4.910926365795724, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2369500', 'n_tokens_mistral': 1232, 'n_tokens_neox': 1196, 'n_words': 426}