Commit 37c2c89b authored by Phillip Webb's avatar Phillip Webb

Restructure packages

Improve package structure and attempt to co-locate related classes.
parent 6ddbf3bd
......@@ -19,9 +19,9 @@ package org.springframework.boot.actuate.endpoint;
import java.util.List;
import org.springframework.beans.BeansException;
import org.springframework.boot.config.JsonParser;
import org.springframework.boot.config.JsonParserFactory;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.json.JsonParser;
import org.springframework.boot.json.JsonParserFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.support.LiveBeansView;
......
......@@ -24,8 +24,8 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.logging.AutoConfigurationReportLoggingInitializer;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.test.City;
import org.springframework.boot.context.listener.LoggingApplicationListener;
import org.springframework.boot.event.ApplicationPreparedEvent;
import org.springframework.boot.logging.LoggingApplicationListener;
import org.springframework.boot.test.EnvironmentTestUtils;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
......
......@@ -30,8 +30,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
import org.springframework.beans.factory.support.BeanNameGenerator;
import org.springframework.boot.ProfileDetector;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.context.initializer.ParentContextApplicationContextInitializer;
import org.springframework.boot.context.initializer.ServletContextApplicationContextInitializer;
import org.springframework.boot.context.ParentContextApplicationContextInitializer;
import org.springframework.boot.context.web.ServletContextApplicationContextInitializer;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ApplicationListener;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.context.listener;
package org.springframework.boot.cloudfoundry;
import java.util.Collection;
import java.util.Collections;
......@@ -26,9 +26,9 @@ import java.util.Properties;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.boot.config.JsonParser;
import org.springframework.boot.config.JsonParserFactory;
import org.springframework.boot.event.ApplicationEnvironmentPreparedEvent;
import org.springframework.boot.json.JsonParser;
import org.springframework.boot.json.JsonParserFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.core.Ordered;
import org.springframework.core.env.CommandLinePropertySource;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.context.listener;
package org.springframework.boot.config;
import java.util.ArrayList;
import java.util.Arrays;
......@@ -33,9 +33,6 @@ import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.bind.PropertySourcesPropertyValues;
import org.springframework.boot.bind.RelaxedDataBinder;
import org.springframework.boot.config.DefaultPropertySourceLoadersFactory;
import org.springframework.boot.config.PropertySourceLoader;
import org.springframework.boot.config.PropertySourceLoadersFactory;
import org.springframework.boot.event.ApplicationEnvironmentPreparedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.AnnotatedBeanDefinitionReader;
......
......@@ -22,8 +22,11 @@ import java.util.List;
import java.util.Properties;
import java.util.Set;
import org.springframework.boot.config.YamlProcessor.DocumentMatcher;
import org.springframework.boot.config.YamlProcessor.MatchStatus;
import org.springframework.boot.yaml.DefaultProfileDocumentMatcher;
import org.springframework.boot.yaml.SpringProfileDocumentMatcher;
import org.springframework.boot.yaml.YamlPropertiesFactoryBean;
import org.springframework.boot.yaml.YamlProcessor.DocumentMatcher;
import org.springframework.boot.yaml.YamlProcessor.MatchStatus;
import org.springframework.core.env.PropertySource;
import org.springframework.core.io.Resource;
import org.springframework.util.StringUtils;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.context.initializer;
package org.springframework.boot.context;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextInitializer;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.context.listener;
package org.springframework.boot.context;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.context.initializer;
package org.springframework.boot.context;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextInitializer;
......
......@@ -14,9 +14,9 @@
* limitations under the License.
*/
package org.springframework.boot.context.listener;
package org.springframework.boot.context;
import org.springframework.boot.context.initializer.ParentContextApplicationContextInitializer.ParentContextAvailableEvent;
import org.springframework.boot.context.ParentContextApplicationContextInitializer.ParentContextAvailableEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.event.ContextClosedEvent;
......@@ -71,4 +71,4 @@ public class ParentContextCloserApplicationListener implements
}
}
\ No newline at end of file
}
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.context.initializer;
package org.springframework.boot.context.env;
import java.util.ArrayList;
import java.util.Collections;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.context.listener;
package org.springframework.boot.context.env;
import java.util.ArrayList;
import java.util.List;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.context.initializer;
package org.springframework.boot.context.web;
import javax.servlet.ServletContext;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.config;
package org.springframework.boot.json;
import java.util.List;
import java.util.Map;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.config;
package org.springframework.boot.json;
import java.util.List;
import java.util.Map;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.config;
package org.springframework.boot.json;
import org.springframework.util.ClassUtils;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.config;
package org.springframework.boot.json;
import java.util.ArrayList;
import java.util.HashMap;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.config;
package org.springframework.boot.json;
import java.util.List;
import java.util.Map;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.context.listener;
package org.springframework.boot.logging;
import java.net.URLClassLoader;
import java.util.Arrays;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.context.listener;
package org.springframework.boot.logging;
import java.lang.management.ManagementFactory;
import java.util.Arrays;
......@@ -28,8 +28,6 @@ import org.apache.commons.logging.LogFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.event.ApplicationEnvironmentPreparedEvent;
import org.springframework.boot.event.ApplicationStartedEvent;
import org.springframework.boot.logging.LogLevel;
import org.springframework.boot.logging.LoggingSystem;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.SmartApplicationListener;
......
......@@ -26,7 +26,7 @@ import java.util.Set;
import org.springframework.beans.BeanUtils;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.context.initializer.ServletContextApplicationContextInitializer;
import org.springframework.boot.context.web.ServletContextApplicationContextInitializer;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.mock.web.MockServletContext;
......
......@@ -23,9 +23,9 @@ import javax.servlet.ServletException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.ParentContextApplicationContextInitializer;
import org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext;
import org.springframework.boot.context.initializer.ParentContextApplicationContextInitializer;
import org.springframework.boot.context.initializer.ServletContextApplicationContextInitializer;
import org.springframework.boot.context.web.ServletContextApplicationContextInitializer;
import org.springframework.context.ApplicationContext;
import org.springframework.web.WebApplicationInitializer;
import org.springframework.web.context.ContextLoaderListener;
......
......@@ -14,13 +14,13 @@
* limitations under the License.
*/
package org.springframework.boot.config;
package org.springframework.boot.yaml;
import java.util.Properties;
import java.util.Set;
import org.springframework.boot.config.YamlProcessor.DocumentMatcher;
import org.springframework.boot.config.YamlProcessor.MatchStatus;
import org.springframework.boot.yaml.YamlProcessor.DocumentMatcher;
import org.springframework.boot.yaml.YamlProcessor.MatchStatus;
import org.springframework.util.StringUtils;
/**
......
......@@ -14,12 +14,12 @@
* limitations under the License.
*/
package org.springframework.boot.config;
package org.springframework.boot.yaml;
import java.util.Properties;
import org.springframework.boot.config.YamlProcessor.DocumentMatcher;
import org.springframework.boot.config.YamlProcessor.MatchStatus;
import org.springframework.boot.yaml.YamlProcessor.DocumentMatcher;
import org.springframework.boot.yaml.YamlProcessor.MatchStatus;
/**
* A {@link DocumentMatcher} that matches the default profile implicitly but not
......
......@@ -14,14 +14,14 @@
* limitations under the License.
*/
package org.springframework.boot.config;
package org.springframework.boot.yaml;
import java.util.Arrays;
import java.util.LinkedHashSet;
import java.util.Properties;
import org.springframework.boot.config.YamlProcessor.DocumentMatcher;
import org.springframework.boot.config.YamlProcessor.MatchStatus;
import org.springframework.boot.yaml.YamlProcessor.DocumentMatcher;
import org.springframework.boot.yaml.YamlProcessor.MatchStatus;
import org.springframework.core.env.Environment;
/**
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.config;
package org.springframework.boot.yaml;
import java.util.LinkedHashMap;
import java.util.Map;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.config;
package org.springframework.boot.yaml;
import java.io.IOException;
import java.util.Collection;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.config;
package org.springframework.boot.yaml;
import java.util.Map;
import java.util.Properties;
......
......@@ -4,17 +4,17 @@ org.springframework.boot.event.EventPublishingRunParticipant
# Application Context Initializers
org.springframework.context.ApplicationContextInitializer=\
org.springframework.boot.context.initializer.ContextIdApplicationContextInitializer,\
org.springframework.boot.context.initializer.EnvironmentDelegateApplicationContextInitializer
org.springframework.boot.context.ContextIdApplicationContextInitializer,\
org.springframework.boot.context.env.EnvironmentDelegateApplicationContextInitializer
# Application Listeners
org.springframework.context.ApplicationListener=\
org.springframework.boot.context.listener.ClasspathLoggingApplicationListener,\
org.springframework.boot.context.listener.ConfigFileApplicationListener,\
org.springframework.boot.context.listener.EnvironmentDelegateApplicationListener,\
org.springframework.boot.context.listener.FileEncodingApplicationListener,\
org.springframework.boot.context.listener.LoggingApplicationListener,\
org.springframework.boot.context.listener.VcapApplicationListener,\
org.springframework.boot.context.listener.ParentContextCloserApplicationListener,\
org.springframework.boot.liquibase.LiquibaseServiceLocatorApplicationListener
org.springframework.boot.cloudfoundry.VcapApplicationListener,\
org.springframework.boot.config.ConfigFileApplicationListener,\
org.springframework.boot.context.FileEncodingApplicationListener,\
org.springframework.boot.context.ParentContextCloserApplicationListener,\
org.springframework.boot.context.env.EnvironmentDelegateApplicationListener,\
org.springframework.boot.liquibase.LiquibaseServiceLocatorApplicationListener,\
org.springframework.boot.logging.ClasspathLoggingApplicationListener,\
org.springframework.boot.logging.LoggingApplicationListener
......@@ -14,10 +14,11 @@
* limitations under the License.
*/
package org.springframework.boot.context.listener;
package org.springframework.boot.cloudfoundry;
import org.junit.Test;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.cloudfoundry.VcapApplicationListener;
import org.springframework.boot.event.ApplicationEnvironmentPreparedEvent;
import org.springframework.boot.test.EnvironmentTestUtils;
import org.springframework.context.ConfigurableApplicationContext;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.context.listener;
package org.springframework.boot.config;
import java.util.Arrays;
import java.util.List;
......@@ -24,6 +24,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.config.ConfigFileApplicationListener;
import org.springframework.boot.config.PropertySourceLoader;
import org.springframework.boot.config.PropertySourceLoadersFactory;
import org.springframework.boot.event.ApplicationEnvironmentPreparedEvent;
......
......@@ -14,9 +14,10 @@
* limitations under the License.
*/
package org.springframework.boot.context.initializer;
package org.springframework.boot.context;
import org.junit.Test;
import org.springframework.boot.context.ContextIdApplicationContextInitializer;
import org.springframework.boot.test.EnvironmentTestUtils;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
......
......@@ -14,11 +14,12 @@
* limitations under the License.
*/
package org.springframework.boot.context.listener;
package org.springframework.boot.context;
import org.junit.Assume;
import org.junit.Test;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.context.FileEncodingApplicationListener;
import org.springframework.boot.event.ApplicationEnvironmentPreparedEvent;
import org.springframework.boot.test.EnvironmentTestUtils;
import org.springframework.core.env.ConfigurableEnvironment;
......
......@@ -14,11 +14,12 @@
* limitations under the License.
*/
package org.springframework.boot.context.initializer;
package org.springframework.boot.context.env;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.springframework.boot.context.env.EnvironmentDelegateApplicationContextInitializer;
import org.springframework.boot.test.EnvironmentTestUtils;
import org.springframework.context.ApplicationContextException;
import org.springframework.context.ApplicationContextInitializer;
......
......@@ -14,13 +14,14 @@
* limitations under the License.
*/
package org.springframework.boot.context.listener;
package org.springframework.boot.context.env;
import org.junit.After;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.context.env.EnvironmentDelegateApplicationListener;
import org.springframework.boot.event.ApplicationEnvironmentPreparedEvent;
import org.springframework.boot.test.EnvironmentTestUtils;
import org.springframework.context.ApplicationListener;
......@@ -33,6 +34,11 @@ import org.springframework.core.annotation.Order;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
/**
* Tests for {@link EnvironmentDelegateApplicationListener}.
*
* @author Dave Syer
*/
public class EnvironmentDelegateApplicationListenerTests {
@Rule
......
......@@ -14,7 +14,10 @@
* limitations under the License.
*/
package org.springframework.boot.config;
package org.springframework.boot.json;
import org.springframework.boot.json.JacksonJsonParser;
import org.springframework.boot.json.JsonParser;
/**
* Tests for {@link JsonParser}.
......
......@@ -14,12 +14,14 @@
* limitations under the License.
*/
package org.springframework.boot.config;
package org.springframework.boot.json;
import java.util.List;
import java.util.Map;
import org.junit.Test;
import org.springframework.boot.json.JsonParser;
import org.springframework.boot.json.SimpleJsonParser;
import static org.junit.Assert.assertEquals;
......
......@@ -14,7 +14,10 @@
* limitations under the License.
*/
package org.springframework.boot.config;
package org.springframework.boot.json;
import org.springframework.boot.json.JsonParser;
import org.springframework.boot.json.YamlJsonParser;
/**
* Tests for {@link YamlJsonParser}.
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.context.listener;
package org.springframework.boot.logging;
import java.io.File;
import java.io.IOException;
......@@ -31,6 +31,7 @@ import org.junit.rules.TemporaryFolder;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.event.ApplicationStartedEvent;
import org.springframework.boot.logging.LogLevel;
import org.springframework.boot.logging.LoggingApplicationListener;
import org.springframework.boot.logging.java.JavaLoggingSystem;
import org.springframework.boot.test.EnvironmentTestUtils;
import org.springframework.boot.test.OutputCapture;
......
......@@ -14,13 +14,14 @@
* limitations under the License.
*/
package org.springframework.boot.config;
package org.springframework.boot.yaml;
import java.io.IOException;
import java.util.Properties;
import org.junit.Test;
import org.springframework.boot.config.YamlProcessor.MatchStatus;
import org.springframework.boot.yaml.ArrayDocumentMatcher;
import org.springframework.boot.yaml.YamlProcessor.MatchStatus;
import org.springframework.core.io.ByteArrayResource;
import org.springframework.core.io.support.PropertiesLoaderUtils;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.config;
package org.springframework.boot.yaml;
import java.io.IOException;
import java.io.InputStream;
......@@ -22,7 +22,8 @@ import java.util.LinkedHashMap;
import java.util.Map;
import org.junit.Test;
import org.springframework.boot.config.YamlProcessor.ResolutionMethod;
import org.springframework.boot.yaml.YamlMapFactoryBean;
import org.springframework.boot.yaml.YamlProcessor.ResolutionMethod;
import org.springframework.core.io.AbstractResource;
import org.springframework.core.io.ByteArrayResource;
import org.springframework.core.io.FileSystemResource;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.boot.config;
package org.springframework.boot.yaml;
import java.util.Map;
import java.util.Properties;
......@@ -21,7 +21,8 @@ import java.util.Properties;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.springframework.boot.config.YamlProcessor.MatchCallback;
import org.springframework.boot.yaml.YamlProcessor;
import org.springframework.boot.yaml.YamlProcessor.MatchCallback;
import org.springframework.core.io.ByteArrayResource;
import org.springframework.core.io.Resource;
import org.yaml.snakeyaml.parser.ParserException;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.config;
package org.springframework.boot.yaml;
import java.util.Arrays;
import java.util.Map;
......@@ -24,9 +24,10 @@ import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.springframework.boot.config.YamlProcessor.DocumentMatcher;
import org.springframework.boot.config.YamlProcessor.MatchStatus;
import org.springframework.boot.config.YamlProcessor.ResolutionMethod;
import org.springframework.boot.yaml.YamlPropertiesFactoryBean;
import org.springframework.boot.yaml.YamlProcessor.DocumentMatcher;
import org.springframework.boot.yaml.YamlProcessor.MatchStatus;
import org.springframework.boot.yaml.YamlProcessor.ResolutionMethod;
import org.springframework.core.io.ByteArrayResource;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment