Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
4ff5afc6
Commit
4ff5afc6
authored
Jan 25, 2016
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish contribution
Removing all deprecated code Closes gh-4905 Closes gh-4917
parent
bead2394
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
9 additions
and
556 deletions
+9
-556
DataEndpointMBean.java
...ramework/boot/actuate/endpoint/jmx/DataEndpointMBean.java
+1
-1
EndpointMBean.java
...ingframework/boot/actuate/endpoint/jmx/EndpointMBean.java
+1
-13
ShutdownEndpointMBean.java
...work/boot/actuate/endpoint/jmx/ShutdownEndpointMBean.java
+1
-1
WebRequestTraceFilter.java
...ngframework/boot/actuate/trace/WebRequestTraceFilter.java
+0
-11
ConditionalOnMissingClass.java
...ot/autoconfigure/condition/ConditionalOnMissingClass.java
+0
-8
GroovyTemplateResolver.java
...autoconfigure/groovy/template/GroovyTemplateResolver.java
+0
-69
MongoProperties.java
...ngframework/boot/autoconfigure/mongo/MongoProperties.java
+0
-15
BasicErrorController.java
...ramework/boot/autoconfigure/web/BasicErrorController.java
+1
-12
ServerProperties.java
...ingframework/boot/autoconfigure/web/ServerProperties.java
+1
-128
ConditionalOnMissingClassTests.java
...toconfigure/condition/ConditionalOnMissingClassTests.java
+1
-1
SpringApplication.java
...main/java/org/springframework/boot/SpringApplication.java
+0
-11
AnsiElement.java
.../main/java/org/springframework/boot/ansi/AnsiElement.java
+1
-103
VcapEnvironmentPostProcessor.java
...ework/boot/cloudfoundry/VcapEnvironmentPostProcessor.java
+0
-78
AbstractConfigurableEmbeddedServletContainer.java
...mbedded/AbstractConfigurableEmbeddedServletContainer.java
+1
-13
ConfigurableEmbeddedServletContainer.java
...ontext/embedded/ConfigurableEmbeddedServletContainer.java
+1
-27
ServerPortInfoApplicationContextInitializer.java
...oot/test/ServerPortInfoApplicationContextInitializer.java
+0
-47
SpringApplicationTests.java
...java/org/springframework/boot/SpringApplicationTests.java
+0
-18
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/DataEndpointMBean.java
View file @
4ff5afc6
/*
/*
* Copyright 201
3
-2016 the original author or authors.
* Copyright 201
2
-2016 the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBean.java
View file @
4ff5afc6
/*
/*
* Copyright 201
3-2015
the original author or authors.
* Copyright 201
2-2016
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -40,18 +40,6 @@ public class EndpointMBean {
...
@@ -40,18 +40,6 @@ public class EndpointMBean {
private
final
ObjectMapper
mapper
;
private
final
ObjectMapper
mapper
;
/**
* Create a new {@link EndpointMBean} instance.
* @param beanName the bean name
* @param endpoint the endpoint to wrap
* @deprecated since 1.3 in favor of
* {@link #EndpointMBean(String, Endpoint, ObjectMapper)}
*/
@Deprecated
public
EndpointMBean
(
String
beanName
,
Endpoint
<?>
endpoint
)
{
this
(
beanName
,
endpoint
,
new
ObjectMapper
());
}
/**
/**
* Create a new {@link EndpointMBean} instance.
* Create a new {@link EndpointMBean} instance.
* @param beanName the bean name
* @param beanName the bean name
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/ShutdownEndpointMBean.java
View file @
4ff5afc6
/*
/*
* Copyright 201
3
-2016 the original author or authors.
* Copyright 201
2
-2016 the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/trace/WebRequestTraceFilter.java
View file @
4ff5afc6
...
@@ -62,17 +62,6 @@ public class WebRequestTraceFilter extends OncePerRequestFilter implements Order
...
@@ -62,17 +62,6 @@ public class WebRequestTraceFilter extends OncePerRequestFilter implements Order
private
final
TraceProperties
properties
;
private
final
TraceProperties
properties
;
/**
* Create a new {@link WebRequestTraceFilter} instance.
* @param traceRepository the trace repository.
* @deprecated since 1.3.0 in favor of
* {@link #WebRequestTraceFilter(TraceRepository, TraceProperties)}
*/
@Deprecated
public
WebRequestTraceFilter
(
TraceRepository
traceRepository
)
{
this
(
traceRepository
,
new
TraceProperties
());
}
/**
/**
* Create a new {@link WebRequestTraceFilter} instance.
* Create a new {@link WebRequestTraceFilter} instance.
* @param repository the trace repository
* @param repository the trace repository
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingClass.java
View file @
4ff5afc6
...
@@ -42,12 +42,4 @@ public @interface ConditionalOnMissingClass {
...
@@ -42,12 +42,4 @@ public @interface ConditionalOnMissingClass {
*/
*/
String
[]
value
()
default
{};
String
[]
value
()
default
{};
/**
* An alias for {@link #value} specifying the names of the classes that must not be
* present.
* @return the class names that must not be present.
* @deprecated since 1.3.0 in favor of {@link #value}.
*/
String
[]
name
()
default
{};
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateResolver.java
deleted
100644 → 0
View file @
bead2394
/*
* Copyright 2012-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
groovy
.
template
;
import
java.io.IOException
;
import
java.net.URL
;
import
groovy.text.markup.MarkupTemplateEngine
;
import
groovy.text.markup.TemplateConfiguration
;
import
groovy.text.markup.TemplateResolver
;
import
org.springframework.context.i18n.LocaleContextHolder
;
import
org.springframework.web.servlet.view.groovy.GroovyMarkupConfigurer
;
import
org.springframework.web.servlet.view.groovy.GroovyMarkupViewResolver
;
/**
* A custom {@link groovy.text.markup.TemplateResolver template resolver} which resolves
* templates using the locale found in the thread locale. This resolver ignores the
* template engine configuration locale.
*
* @author Cédric Champeau
* @since 1.1.0
* @deprecated since 1.2 in favor of Spring 4.1's {@link GroovyMarkupViewResolver} and
* {@link GroovyMarkupConfigurer}.
*/
@Deprecated
public
class
GroovyTemplateResolver
implements
TemplateResolver
{
private
ClassLoader
templateClassLoader
;
@Override
public
void
configure
(
final
ClassLoader
templateClassLoader
,
final
TemplateConfiguration
configuration
)
{
this
.
templateClassLoader
=
templateClassLoader
;
}
@Override
public
URL
resolveTemplate
(
final
String
templatePath
)
throws
IOException
{
MarkupTemplateEngine
.
TemplateResource
templateResource
=
MarkupTemplateEngine
.
TemplateResource
.
parse
(
templatePath
);
URL
resource
=
this
.
templateClassLoader
.
getResource
(
templateResource
.
withLocale
(
LocaleContextHolder
.
getLocale
().
toString
().
replace
(
"-"
,
"_"
))
.
toString
());
if
(
resource
==
null
)
{
// no resource found with the default locale, try without any locale
resource
=
this
.
templateClassLoader
.
getResource
(
templateResource
.
withLocale
(
null
).
toString
());
}
if
(
resource
==
null
)
{
throw
new
IOException
(
"Unable to load template:"
+
templatePath
);
}
return
resource
;
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoProperties.java
View file @
4ff5afc6
...
@@ -181,21 +181,6 @@ public class MongoProperties {
...
@@ -181,21 +181,6 @@ public class MongoProperties {
return
new
MongoClientURI
(
this
.
uri
).
getDatabase
();
return
new
MongoClientURI
(
this
.
uri
).
getDatabase
();
}
}
/**
* Creates a {@link MongoClient} using the given {@code options}.
*
* @param options the options
* @return the Mongo client
* @throws UnknownHostException if the configured host is unknown
* @deprecated Since 1.3.0 in favour of
* {@link #createMongoClient(MongoClientOptions, Environment)}
*/
@Deprecated
public
MongoClient
createMongoClient
(
MongoClientOptions
options
)
throws
UnknownHostException
{
return
this
.
createMongoClient
(
options
,
null
);
}
/**
/**
* Creates a {@link MongoClient} using the given {@code options} and
* Creates a {@link MongoClient} using the given {@code options} and
* {@code environment}. If the configured port is zero, the value of the
* {@code environment}. If the configured port is zero, the value of the
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/BasicErrorController.java
View file @
4ff5afc6
/*
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
6
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -51,17 +51,6 @@ public class BasicErrorController extends AbstractErrorController {
...
@@ -51,17 +51,6 @@ public class BasicErrorController extends AbstractErrorController {
private
final
ErrorProperties
errorProperties
;
private
final
ErrorProperties
errorProperties
;
/**
* Create a new {@link BasicErrorController} instance.
* @param errorAttributes the error attributes
* @deprecated since 1.3.0 in favor of
* {@link #BasicErrorController(ErrorAttributes, ErrorProperties)}
*/
@Deprecated
public
BasicErrorController
(
ErrorAttributes
errorAttributes
)
{
this
(
errorAttributes
,
new
ErrorProperties
());
}
/**
/**
* Create a new {@link BasicErrorController} instance.
* Create a new {@link BasicErrorController} instance.
* @param errorAttributes the error attributes
* @param errorAttributes the error attributes
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java
View file @
4ff5afc6
/*
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
6
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -55,7 +55,6 @@ import org.springframework.boot.context.embedded.tomcat.TomcatContextCustomizer;
...
@@ -55,7 +55,6 @@ import org.springframework.boot.context.embedded.tomcat.TomcatContextCustomizer;
import
org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory
;
import
org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory
;
import
org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory
;
import
org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.DeprecatedConfigurationProperty
;
import
org.springframework.boot.context.properties.NestedConfigurationProperty
;
import
org.springframework.boot.context.properties.NestedConfigurationProperty
;
import
org.springframework.context.EnvironmentAware
;
import
org.springframework.context.EnvironmentAware
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.Ordered
;
...
@@ -327,27 +326,6 @@ public class ServerProperties
...
@@ -327,27 +326,6 @@ public class ServerProperties
return
(
platform
==
null
?
false
:
platform
.
isUsingForwardHeaders
());
return
(
platform
==
null
?
false
:
platform
.
isUsingForwardHeaders
());
}
}
/**
* Get the session timeout.
* @return the session timeout
* @deprecated since 1.3.0 in favor of {@code session.timeout}.
*/
@Deprecated
@DeprecatedConfigurationProperty
(
replacement
=
"server.session.timeout"
)
public
Integer
getSessionTimeout
()
{
return
this
.
session
.
getTimeout
();
}
/**
* Set the session timeout.
* @param sessionTimeout the session timeout
* @deprecated since 1.3.0 in favor of {@code session.timeout}.
*/
@Deprecated
public
void
setSessionTimeout
(
Integer
sessionTimeout
)
{
this
.
session
.
setTimeout
(
sessionTimeout
);
}
public
ErrorProperties
getError
()
{
public
ErrorProperties
getError
()
{
return
this
.
error
;
return
this
.
error
;
}
}
...
@@ -632,48 +610,6 @@ public class ServerProperties
...
@@ -632,48 +610,6 @@ public class ServerProperties
return
this
.
accesslog
;
return
this
.
accesslog
;
}
}
/**
* Specify if access log is enabled.
* @return {@code true} if access log is enabled
* @deprecated since 1.3.0 in favor of {@code server.tomcat.accesslog.enabled}
*/
@Deprecated
@DeprecatedConfigurationProperty
(
replacement
=
"server.tomcat.accesslog.enabled"
)
public
boolean
getAccessLogEnabled
()
{
return
this
.
accesslog
.
isEnabled
();
}
/**
* Set if access log is enabled.
* @param accessLogEnabled the access log enable flag
* @deprecated since 1.3.0 in favor of {@code server.tomcat.accesslog.enabled}
*/
@Deprecated
public
void
setAccessLogEnabled
(
boolean
accessLogEnabled
)
{
getAccesslog
().
setEnabled
(
accessLogEnabled
);
}
/**
* Get the format pattern for access logs.
* @return the format pattern for access logs
* @deprecated since 1.3.0 in favor of {@code server.tomcat.accesslog.pattern}
*/
@Deprecated
@DeprecatedConfigurationProperty
(
replacement
=
"server.tomcat.accesslog.pattern"
)
public
String
getAccessLogPattern
()
{
return
this
.
accesslog
.
getPattern
();
}
/**
* Set the format pattern for access logs.
* @param accessLogPattern the pattern for access logs
* @deprecated since 1.3.0 in favor of {@code server.tomcat.accesslog.pattern}
*/
@Deprecated
public
void
setAccessLogPattern
(
String
accessLogPattern
)
{
this
.
accesslog
.
setPattern
(
accessLogPattern
);
}
public
int
getBackgroundProcessorDelay
()
{
public
int
getBackgroundProcessorDelay
()
{
return
this
.
backgroundProcessorDelay
;
return
this
.
backgroundProcessorDelay
;
}
}
...
@@ -990,69 +926,6 @@ public class ServerProperties
...
@@ -990,69 +926,6 @@ public class ServerProperties
return
this
.
accesslog
;
return
this
.
accesslog
;
}
}
/**
* Get the format pattern for access logs.
* @return the format pattern for access logs
* @deprecated since 1.3.0 in favor of {@code server.undertow.accesslog.pattern}
*/
@Deprecated
@DeprecatedConfigurationProperty
(
replacement
=
"server.undertow.accesslog.pattern"
)
public
String
getAccessLogPattern
()
{
return
this
.
accesslog
.
getPattern
();
}
/**
* Set the format pattern for access logs.
* @param accessLogPattern the pattern for access logs
* @deprecated since 1.3.0 in favor of {@code server.undertow.accesslog.pattern}
*/
@Deprecated
public
void
setAccessLogPattern
(
String
accessLogPattern
)
{
this
.
accesslog
.
setPattern
(
accessLogPattern
);
}
/**
* Specify if access log is enabled.
* @return {@code true} if access log is enabled
* @deprecated since 1.3.0 in favor of {@code server.undertow.accesslog.enabled}
*/
@Deprecated
@DeprecatedConfigurationProperty
(
replacement
=
"server.undertow.accesslog.enabled"
)
public
boolean
isAccessLogEnabled
()
{
return
this
.
accesslog
.
isEnabled
();
}
/**
* Set if access log is enabled.
* @param accessLogEnabled the access log enable flag
* @deprecated since 1.3.0 in favor of {@code server.undertow.accesslog.enabled}
*/
@Deprecated
public
void
setAccessLogEnabled
(
boolean
accessLogEnabled
)
{
getAccesslog
().
setEnabled
(
accessLogEnabled
);
}
/**
* Get the access log directory.
* @return the access log directory
* @deprecated since 1.3.0 in favor of {@code server.undertow.accesslog.dir}
*/
@Deprecated
@DeprecatedConfigurationProperty
(
replacement
=
"server.undertow.accesslog.dir"
)
public
File
getAccessLogDir
()
{
return
this
.
accesslog
.
getDir
();
}
/**
* Set the access log directory.
* @param accessLogDir the access log directory
* @deprecated since 1.3.0 in favor of {@code server.tomcat.accesslog.dir}
*/
@Deprecated
public
void
setAccessLogDir
(
File
accessLogDir
)
{
getAccesslog
().
setDir
(
accessLogDir
);
}
void
customizeUndertow
(
ServerProperties
serverProperties
,
void
customizeUndertow
(
ServerProperties
serverProperties
,
UndertowEmbeddedServletContainerFactory
factory
)
{
UndertowEmbeddedServletContainerFactory
factory
)
{
factory
.
setBufferSize
(
this
.
bufferSize
);
factory
.
setBufferSize
(
this
.
bufferSize
);
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingClassTests.java
View file @
4ff5afc6
...
@@ -61,7 +61,7 @@ public class ConditionalOnMissingClassTests {
...
@@ -61,7 +61,7 @@ public class ConditionalOnMissingClassTests {
}
}
@Configuration
@Configuration
@ConditionalOnMissingClass
(
name
=
"FOO"
)
@ConditionalOnMissingClass
(
"FOO"
)
protected
static
class
MissingConfiguration
{
protected
static
class
MissingConfiguration
{
@Bean
@Bean
public
String
bar
()
{
public
String
bar
()
{
...
...
spring-boot/src/main/java/org/springframework/boot/SpringApplication.java
View file @
4ff5afc6
...
@@ -957,17 +957,6 @@ public class SpringApplication {
...
@@ -957,17 +957,6 @@ public class SpringApplication {
this
.
banner
=
banner
;
this
.
banner
=
banner
;
}
}
/**
* Sets if the Spring banner should be displayed when the application runs. Defaults
* to {@code true}.
* @param showBanner if the banner should be shown
* @deprecated since 1.3.0 in favor of {@link #setBannerMode}
*/
@Deprecated
public
void
setShowBanner
(
boolean
showBanner
)
{
setBannerMode
(
showBanner
?
Banner
.
Mode
.
CONSOLE
:
Banner
.
Mode
.
OFF
);
}
/**
/**
* Sets the mode used to display the banner when the application runs. Defaults to
* Sets the mode used to display the banner when the application runs. Defaults to
* {@code Banner.Mode.CONSOLE}.
* {@code Banner.Mode.CONSOLE}.
...
...
spring-boot/src/main/java/org/springframework/boot/ansi/AnsiElement.java
View file @
4ff5afc6
/*
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
6
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -23,112 +23,10 @@ package org.springframework.boot.ansi;
...
@@ -23,112 +23,10 @@ package org.springframework.boot.ansi;
*/
*/
public
interface
AnsiElement
{
public
interface
AnsiElement
{
/**
* @deprecated in 1.3.0 in favor of {@link AnsiStyle#NORMAL}
*/
@Deprecated
AnsiElement
NORMAL
=
new
DefaultAnsiElement
(
"0"
);
/**
* @deprecated in 1.3.0 in favor of {@link AnsiStyle#BOLD}
*/
@Deprecated
AnsiElement
BOLD
=
new
DefaultAnsiElement
(
"1"
);
/**
* @deprecated in 1.3.0 in favor of {@link AnsiStyle#FAINT}
*/
@Deprecated
AnsiElement
FAINT
=
new
DefaultAnsiElement
(
"2"
);
/**
* @deprecated in 1.3.0 in favor of {@link AnsiStyle#ITALIC}
*/
@Deprecated
AnsiElement
ITALIC
=
new
DefaultAnsiElement
(
"3"
);
/**
* @deprecated in 1.3.0 in favor of {@link AnsiStyle#UNDERLINE}
*/
@Deprecated
AnsiElement
UNDERLINE
=
new
DefaultAnsiElement
(
"4"
);
/**
* @deprecated in 1.3.0 in favor of {@link AnsiColor#BLACK}
*/
@Deprecated
AnsiElement
BLACK
=
new
DefaultAnsiElement
(
"30"
);
/**
* @deprecated in 1.3.0 in favor of {@link AnsiColor#RED}
*/
@Deprecated
AnsiElement
RED
=
new
DefaultAnsiElement
(
"31"
);
/**
* @deprecated in 1.3.0 in favor of {@link AnsiColor#GREEN}
*/
@Deprecated
AnsiElement
GREEN
=
new
DefaultAnsiElement
(
"32"
);
/**
* @deprecated in 1.3.0 in favor of {@link AnsiColor#YELLOW}
*/
@Deprecated
AnsiElement
YELLOW
=
new
DefaultAnsiElement
(
"33"
);
/**
* @deprecated in 1.3.0 in favor of {@link AnsiColor#BLUE}
*/
@Deprecated
AnsiElement
BLUE
=
new
DefaultAnsiElement
(
"34"
);
/**
* @deprecated in 1.3.0 in favor of {@link AnsiColor#MAGENTA}
*/
@Deprecated
AnsiElement
MAGENTA
=
new
DefaultAnsiElement
(
"35"
);
/**
* @deprecated in 1.3.0 in favor of {@link AnsiColor#CYAN}
*/
@Deprecated
AnsiElement
CYAN
=
new
DefaultAnsiElement
(
"36"
);
/**
* @deprecated in 1.3.0 in favor of {@link AnsiColor#WHITE}
*/
@Deprecated
AnsiElement
WHITE
=
new
DefaultAnsiElement
(
"37"
);
/**
* @deprecated in 1.3.0 in favor of {@link AnsiColor#DEFAULT}
*/
@Deprecated
AnsiElement
DEFAULT
=
new
DefaultAnsiElement
(
"39"
);
/**
/**
* @return the ANSI escape code
* @return the ANSI escape code
*/
*/
@Override
@Override
String
toString
();
String
toString
();
/**
* Internal default {@link AnsiElement} implementation.
*/
class
DefaultAnsiElement
implements
AnsiElement
{
private
final
String
code
;
DefaultAnsiElement
(
String
code
)
{
this
.
code
=
code
;
}
@Override
public
String
toString
()
{
return
this
.
code
;
}
}
}
}
spring-boot/src/main/java/org/springframework/boot/cloudfoundry/VcapEnvironmentPostProcessor.java
deleted
100644 → 0
View file @
bead2394
/*
* Copyright 2010-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
cloudfoundry
;
import
org.springframework.boot.cloud.CloudFoundryVcapEnvironmentPostProcessor
;
import
org.springframework.boot.env.EnvironmentPostProcessor
;
import
org.springframework.core.env.Environment
;
/**
* An {@link EnvironmentPostProcessor} that knows where to find VCAP (a.k.a. Cloud
* Foundry) meta data in the existing environment. It parses out the VCAP_APPLICATION and
* VCAP_SERVICES meta data and dumps it in a form that is easily consumed by
* {@link Environment} users. If the app is running in Cloud Foundry then both meta data
* items are JSON objects encoded in OS environment variables. VCAP_APPLICATION is a
* shallow hash with basic information about the application (name, instance id, instance
* index, etc.), and VCAP_SERVICES is a hash of lists where the keys are service labels
* and the values are lists of hashes of service instance meta data. Examples are:
*
* <pre class="code">
* VCAP_APPLICATION: {"instance_id":"2ce0ac627a6c8e47e936d829a3a47b5b","instance_index":0,
* "version":"0138c4a6-2a73-416b-aca0-572c09f7ca53","name":"foo",
* "uris":["foo.cfapps.io"], ...}
* VCAP_SERVICES: {"rds-mysql-1.0":[{"name":"mysql","label":"rds-mysql-1.0","plan":"10mb",
* "credentials":{"name":"d04fb13d27d964c62b267bbba1cffb9da","hostname":"mysql-service-public.clqg2e2w3ecf.us-east-1.rds.amazonaws.com",
* "host":"mysql-service-public.clqg2e2w3ecf.us-east-1.rds.amazonaws.com","port":3306,"user":"urpRuqTf8Cpe6",
* "username":"urpRuqTf8Cpe6","password":"pxLsGVpsC9A5S"}
* }]}
* </pre>
*
* These objects are flattened into properties. The VCAP_APPLICATION object goes straight
* to {@code vcap.application.*} in a fairly obvious way, and the VCAP_SERVICES object is
* unwrapped so that it is a hash of objects with key equal to the service instance name
* (e.g. "mysql" in the example above), and value equal to that instances properties, and
* then flattened in the same way. E.g.
*
* <pre class="code">
* vcap.application.instance_id: 2ce0ac627a6c8e47e936d829a3a47b5b
* vcap.application.version: 0138c4a6-2a73-416b-aca0-572c09f7ca53
* vcap.application.name: foo
* vcap.application.uris[0]: foo.cfapps.io
*
* vcap.services.mysql.name: mysql
* vcap.services.mysql.label: rds-mysql-1.0
* vcap.services.mysql.credentials.name: d04fb13d27d964c62b267bbba1cffb9da
* vcap.services.mysql.credentials.port: 3306
* vcap.services.mysql.credentials.host: mysql-service-public.clqg2e2w3ecf.us-east-1.rds.amazonaws.com
* vcap.services.mysql.credentials.username: urpRuqTf8Cpe6
* vcap.services.mysql.credentials.password: pxLsGVpsC9A5S
* ...
* </pre>
*
* N.B. this initializer is mainly intended for informational use (the application and
* instance ids are particularly useful). For service binding you might find that Spring
* Cloud is more convenient and more robust against potential changes in Cloud Foundry.
*
* @author Dave Syer
* @author Andy Wilkinson
* @deprecated since 1.3.0 in favor of CloudFoundryVcapEnvironmentPostProcessor
*/
@Deprecated
public
class
VcapEnvironmentPostProcessor
extends
CloudFoundryVcapEnvironmentPostProcessor
{
}
spring-boot/src/main/java/org/springframework/boot/context/embedded/AbstractConfigurableEmbeddedServletContainer.java
View file @
4ff5afc6
/*
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
6
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -270,12 +270,6 @@ public abstract class AbstractConfigurableEmbeddedServletContainer
...
@@ -270,12 +270,6 @@ public abstract class AbstractConfigurableEmbeddedServletContainer
this
.
registerDefaultServlet
=
registerDefaultServlet
;
this
.
registerDefaultServlet
=
registerDefaultServlet
;
}
}
@Override
public
void
setRegisterJspServlet
(
boolean
registerJspServlet
)
{
Assert
.
notNull
(
this
.
jspServlet
);
this
.
jspServlet
.
setRegistered
(
registerJspServlet
);
}
/**
/**
* Flag to indicate that the default servlet should be registered.
* Flag to indicate that the default servlet should be registered.
* @return true if the default servlet is to be registered
* @return true if the default servlet is to be registered
...
@@ -293,12 +287,6 @@ public abstract class AbstractConfigurableEmbeddedServletContainer
...
@@ -293,12 +287,6 @@ public abstract class AbstractConfigurableEmbeddedServletContainer
return
this
.
ssl
;
return
this
.
ssl
;
}
}
@Override
public
void
setJspServletClassName
(
String
jspServletClassName
)
{
Assert
.
notNull
(
this
.
jspServlet
);
this
.
jspServlet
.
setClassName
(
jspServletClassName
);
}
@Override
@Override
public
void
setJspServlet
(
JspServlet
jspServlet
)
{
public
void
setJspServlet
(
JspServlet
jspServlet
)
{
this
.
jspServlet
=
jspServlet
;
this
.
jspServlet
=
jspServlet
;
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/ConfigurableEmbeddedServletContainer.java
View file @
4ff5afc6
/*
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
6
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -92,32 +92,6 @@ public interface ConfigurableEmbeddedServletContainer {
...
@@ -92,32 +92,6 @@ public interface ConfigurableEmbeddedServletContainer {
*/
*/
void
setAddress
(
InetAddress
address
);
void
setAddress
(
InetAddress
address
);
/**
* The class name for the jsp servlet if used. If
* {@link #setRegisterJspServlet(boolean) registerJspServlet} is true <b>and</b> this
* class is on the classpath then it will be registered. Since both Tomcat and Jetty
* use Jasper for their JSP implementation the default is
* {@code org.apache.jasper.servlet.JspServlet}.
* @param jspServletClassName the class name for the JSP servlet if used
* @deprecated in 1.3.0 in favor of {@link JspServlet#setClassName(String)}
* @see #setJspServlet
* @see JspServlet#setClassName(String)
*/
@Deprecated
void
setJspServletClassName
(
String
jspServletClassName
);
/**
* Set if the JspServlet should be registered if it is on the classpath. Defaults to
* {@code true} so that files from the {@link #setDocumentRoot(File) document root}
* will be served.
* @param registerJspServlet if the JSP servlet should be registered
* @deprecated in 1.3.0 in favor of {@link JspServlet#setRegistered(boolean)}
* @see #setJspServlet
* @see JspServlet#setRegistered(boolean)
*/
@Deprecated
void
setRegisterJspServlet
(
boolean
registerJspServlet
);
/**
/**
* Set if the DefaultServlet should be registered. Defaults to {@code true} so that
* Set if the DefaultServlet should be registered. Defaults to {@code true} so that
* files from the {@link #setDocumentRoot(File) document root} will be served.
* files from the {@link #setDocumentRoot(File) document root} will be served.
...
...
spring-boot/src/main/java/org/springframework/boot/test/ServerPortInfoApplicationContextInitializer.java
deleted
100644 → 0
View file @
bead2394
/*
* Copyright 2012-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
test
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.context.embedded.EmbeddedServletContainer
;
import
org.springframework.boot.context.embedded.EmbeddedWebApplicationContext
;
import
org.springframework.context.ApplicationContextInitializer
;
import
org.springframework.core.env.Environment
;
/**
* {@link ApplicationContextInitializer} that sets {@link Environment} properties for the
* ports that {@link EmbeddedServletContainer} servers are actually listening on. The
* property {@literal "local.server.port"} can be injected directly into tests using
* {@link Value @Value} or obtained via the {@link Environment}.
* <p>
* If the {@link EmbeddedWebApplicationContext} has a
* {@link EmbeddedWebApplicationContext#setNamespace(String) namespace} set, it will be
* used to construct the property name. For example, the "management" actuator context
* will have the property name {@literal "local.management.port"}.
* <p>
* Properties are automatically propagated up to any parent context.
*
* @author Dave Syer
* @author Phillip Webb
* @deprecated since 1.3 in favor of
* org.springframework.boot.context.web.ServerPortInfoApplicationContextInitializer
*/
@Deprecated
public
class
ServerPortInfoApplicationContextInitializer
extends
org
.
springframework
.
boot
.
context
.
web
.
ServerPortInfoApplicationContextInitializer
{
}
spring-boot/src/test/java/org/springframework/boot/SpringApplicationTests.java
View file @
4ff5afc6
...
@@ -177,24 +177,6 @@ public class SpringApplicationTests {
...
@@ -177,24 +177,6 @@ public class SpringApplicationTests {
verify
(
application
,
never
()).
printBanner
((
Environment
)
anyObject
());
verify
(
application
,
never
()).
printBanner
((
Environment
)
anyObject
());
}
}
@SuppressWarnings
(
"deprecation"
)
@Test
public
void
disableBannerWithBoolean
()
throws
Exception
{
SpringApplication
application
=
spy
(
new
SpringApplication
(
ExampleConfig
.
class
));
application
.
setWebEnvironment
(
false
);
application
.
setShowBanner
(
false
);
this
.
context
=
application
.
run
();
verify
(
application
,
never
()).
printBanner
((
Environment
)
anyObject
());
}
@Test
public
void
disableBannerViaShowBannerProperty
()
throws
Exception
{
SpringApplication
application
=
spy
(
new
SpringApplication
(
ExampleConfig
.
class
));
application
.
setWebEnvironment
(
false
);
this
.
context
=
application
.
run
(
"--spring.main.show_banner=false"
);
verify
(
application
,
never
()).
printBanner
((
Environment
)
anyObject
());
}
@Test
@Test
public
void
disableBannerViaBannerModeProperty
()
throws
Exception
{
public
void
disableBannerViaBannerModeProperty
()
throws
Exception
{
SpringApplication
application
=
spy
(
new
SpringApplication
(
ExampleConfig
.
class
));
SpringApplication
application
=
spy
(
new
SpringApplication
(
ExampleConfig
.
class
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment