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
8db1d0e0
Commit
8db1d0e0
authored
Jan 19, 2014
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some TODOs
parent
07da0345
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
40 additions
and
11 deletions
+40
-11
ErrorMvcAutoConfiguration.java
...boot/actuate/autoconfigure/ErrorMvcAutoConfiguration.java
+7
-1
RedisMetricRepository.java
...tuate/metrics/repository/redis/RedisMetricRepository.java
+6
-3
RedisMultiMetricRepository.java
.../metrics/repository/redis/RedisMultiMetricRepository.java
+6
-2
WebMvcAutoConfiguration.java
...ework/boot/autoconfigure/web/WebMvcAutoConfiguration.java
+13
-0
JmxAutoConfigurationTests.java
...ork/boot/autoconfigure/jmx/JmxAutoConfigurationTests.java
+7
-2
PropertySourceLoader.java
...org/springframework/boot/config/PropertySourceLoader.java
+1
-1
BeanDefinitionLoaderTests.java
...a/org/springframework/boot/BeanDefinitionLoaderTests.java
+0
-2
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ErrorMvcAutoConfiguration.java
View file @
8db1d0e0
...
...
@@ -126,7 +126,13 @@ public class ErrorMvcAutoConfiguration implements EmbeddedServletContainerCustom
.
noMatch
(
"Thymeleaf template found for error view"
);
}
}
// FIXME: add matcher for JSP view if Jasper detected
if
(
ClassUtils
.
isPresent
(
"org.apache.jasper.compiler.JspConfig"
,
context
.
getClassLoader
()))
{
if
(
WebMvcAutoConfiguration
.
templateExists
(
context
.
getEnvironment
(),
context
.
getResourceLoader
(),
"error"
))
{
return
ConditionOutcome
.
noMatch
(
"JSP template found for error view"
);
}
}
return
ConditionOutcome
.
match
(
"no error template view detected"
);
};
}
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/repository/redis/RedisMetricRepository.java
View file @
8db1d0e0
...
...
@@ -17,6 +17,7 @@
package
org
.
springframework
.
boot
.
actuate
.
metrics
.
repository
.
redis
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Set
;
...
...
@@ -129,13 +130,15 @@ public class RedisMetricRepository implements MetricRepository {
}
}
// TODO: memorize timestamps as well?
private
Metric
<?>
deserialize
(
String
redisKey
,
String
v
)
{
return
new
Metric
<
Double
>(
nameFor
(
redisKey
),
Double
.
valueOf
(
v
));
String
[]
vals
=
v
.
split
(
"@"
);
Double
value
=
Double
.
valueOf
(
vals
[
0
]);
Date
timestamp
=
vals
.
length
>
1
?
new
Date
(
Long
.
valueOf
(
vals
[
1
]))
:
new
Date
();
return
new
Metric
<
Double
>(
nameFor
(
redisKey
),
value
,
timestamp
);
}
private
String
serialize
(
Metric
<?>
entity
)
{
return
String
.
valueOf
(
entity
.
getValue
());
return
String
.
valueOf
(
entity
.
getValue
())
+
"@"
+
entity
.
getTimestamp
().
getTime
()
;
}
private
String
keyFor
(
String
name
)
{
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/repository/redis/RedisMultiMetricRepository.java
View file @
8db1d0e0
...
...
@@ -18,6 +18,7 @@ package org.springframework.boot.actuate.metrics.repository.redis;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Date
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Set
;
...
...
@@ -127,11 +128,14 @@ public class RedisMultiMetricRepository implements MultiMetricRepository {
}
private
Metric
<?>
deserialize
(
String
redisKey
,
String
v
)
{
return
new
Metric
<
Double
>(
nameFor
(
redisKey
),
Double
.
valueOf
(
v
));
String
[]
vals
=
v
.
split
(
"@"
);
Double
value
=
Double
.
valueOf
(
vals
[
0
]);
Date
timestamp
=
vals
.
length
>
1
?
new
Date
(
Long
.
valueOf
(
vals
[
1
]))
:
new
Date
();
return
new
Metric
<
Double
>(
nameFor
(
redisKey
),
value
,
timestamp
);
}
private
String
serialize
(
Metric
<?>
entity
)
{
return
String
.
valueOf
(
entity
.
getValue
());
return
String
.
valueOf
(
entity
.
getValue
()
+
"@"
+
entity
.
getTimestamp
().
getTime
()
);
}
private
String
keyFor
(
String
name
)
{
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.java
View file @
8db1d0e0
...
...
@@ -42,6 +42,7 @@ import org.springframework.core.Ordered;
import
org.springframework.core.annotation.Order
;
import
org.springframework.core.convert.converter.Converter
;
import
org.springframework.core.convert.converter.GenericConverter
;
import
org.springframework.core.env.Environment
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.core.io.Resource
;
import
org.springframework.core.io.ResourceLoader
;
...
...
@@ -103,12 +104,24 @@ public class WebMvcAutoConfiguration {
}
}
public
static
String
DEFAULT_PREFIX
=
""
;
public
static
String
DEFAULT_SUFFIX
=
""
;
@Bean
@ConditionalOnMissingBean
(
HiddenHttpMethodFilter
.
class
)
public
HiddenHttpMethodFilter
hiddenHttpMethodFilter
()
{
return
new
HiddenHttpMethodFilter
();
}
public
static
boolean
templateExists
(
Environment
environment
,
ResourceLoader
resourceLoader
,
String
view
)
{
String
prefix
=
environment
.
getProperty
(
"spring.view.prefix"
,
WebMvcAutoConfiguration
.
DEFAULT_PREFIX
);
String
suffix
=
environment
.
getProperty
(
"spring.view.suffix"
,
WebMvcAutoConfiguration
.
DEFAULT_SUFFIX
);
return
resourceLoader
.
getResource
(
prefix
+
view
+
suffix
).
exists
();
}
// Defined as a nested config to ensure WebMvcConfigurerAdapter it not read when not
// on the classpath
@EnableWebMvc
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfigurationTests.java
View file @
8db1d0e0
...
...
@@ -28,8 +28,11 @@ import org.springframework.jmx.export.MBeanExporter;
import
org.springframework.jmx.export.annotation.ManagedAttribute
;
import
org.springframework.jmx.export.annotation.ManagedOperation
;
import
org.springframework.jmx.export.annotation.ManagedResource
;
import
org.springframework.jmx.export.naming.MetadataNamingStrategy
;
import
org.springframework.mock.env.MockEnvironment
;
import
org.springframework.test.util.ReflectionTestUtils
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
/**
...
...
@@ -95,8 +98,10 @@ public class JmxAutoConfigurationTests {
MBeanExporter
mBeanExporter
=
this
.
context
.
getBean
(
MBeanExporter
.
class
);
assertNotNull
(
mBeanExporter
);
// TODO cdupuis add test for default domain
MetadataNamingStrategy
naming
=
(
MetadataNamingStrategy
)
ReflectionTestUtils
.
getField
(
mBeanExporter
,
"metadataNamingStrategy"
);
assertEquals
(
"my-test-domain"
,
ReflectionTestUtils
.
getField
(
naming
,
"defaultDomain"
));
}
@Configuration
...
...
spring-boot/src/main/java/org/springframework/boot/config/PropertySourceLoader.java
View file @
8db1d0e0
...
...
@@ -34,7 +34,7 @@ public interface PropertySourceLoader {
/**
* Load the resource into a property source.
* @param name
TODO
* @param name
the name of the property source
* @return a property source
*/
PropertySource
<?>
load
(
String
name
,
Resource
resource
);
...
...
spring-boot/src/test/java/org/springframework/boot/BeanDefinitionLoaderTests.java
View file @
8db1d0e0
...
...
@@ -33,8 +33,6 @@ import static org.junit.Assert.assertTrue;
*/
public
class
BeanDefinitionLoaderTests
{
// FIXME
private
StaticApplicationContext
registry
;
@Before
...
...
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