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
79922360
Commit
79922360
authored
Apr 25, 2016
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
d10d819c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
24 deletions
+30
-24
FlywayEndpoint.java
...springframework/boot/actuate/endpoint/FlywayEndpoint.java
+13
-10
ShutdownEndpoint.java
...ringframework/boot/actuate/endpoint/ShutdownEndpoint.java
+12
-8
AbstractMetricExporter.java
...k/boot/actuate/metrics/export/AbstractMetricExporter.java
+1
-1
MetricExporters.java
...ramework/boot/actuate/metrics/export/MetricExporters.java
+1
-1
DataSourceBeanCreationFailureAnalyzer.java
...configure/jdbc/DataSourceBeanCreationFailureAnalyzer.java
+3
-4
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/FlywayEndpoint.java
View file @
79922360
...
@@ -62,27 +62,26 @@ public class FlywayEndpoint extends AbstractEndpoint<List<FlywayMigration>> {
...
@@ -62,27 +62,26 @@ public class FlywayEndpoint extends AbstractEndpoint<List<FlywayMigration>> {
*/
*/
public
static
class
FlywayMigration
{
public
static
class
FlywayMigration
{
private
MigrationType
type
;
private
final
MigrationType
type
;
private
Integer
checksum
;
private
final
Integer
checksum
;
private
String
version
;
private
final
String
version
;
private
String
description
;
private
final
String
description
;
private
String
script
;
private
final
String
script
;
private
MigrationState
state
;
private
final
MigrationState
state
;
private
Date
installedOn
;
private
final
Date
installedOn
;
private
Integer
executionTime
;
private
final
Integer
executionTime
;
public
FlywayMigration
(
MigrationInfo
info
)
{
public
FlywayMigration
(
MigrationInfo
info
)
{
this
.
type
=
info
.
getType
();
this
.
type
=
info
.
getType
();
this
.
checksum
=
info
.
getChecksum
();
this
.
checksum
=
info
.
getChecksum
();
this
.
version
=
info
.
getVersion
()
!=
null
?
info
.
getVersion
().
toString
()
this
.
version
=
nullSafeToString
(
info
.
getVersion
());
:
null
;
this
.
description
=
info
.
getDescription
();
this
.
description
=
info
.
getDescription
();
this
.
script
=
info
.
getScript
();
this
.
script
=
info
.
getScript
();
this
.
state
=
info
.
getState
();
this
.
state
=
info
.
getState
();
...
@@ -90,6 +89,10 @@ public class FlywayEndpoint extends AbstractEndpoint<List<FlywayMigration>> {
...
@@ -90,6 +89,10 @@ public class FlywayEndpoint extends AbstractEndpoint<List<FlywayMigration>> {
this
.
executionTime
=
info
.
getExecutionTime
();
this
.
executionTime
=
info
.
getExecutionTime
();
}
}
private
String
nullSafeToString
(
Object
obj
)
{
return
(
obj
==
null
?
null
:
obj
.
toString
());
}
public
MigrationType
getType
()
{
public
MigrationType
getType
()
{
return
this
.
type
;
return
this
.
type
;
}
}
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ShutdownEndpoint.java
View file @
79922360
...
@@ -35,6 +35,14 @@ import org.springframework.context.ConfigurableApplicationContext;
...
@@ -35,6 +35,14 @@ import org.springframework.context.ConfigurableApplicationContext;
public
class
ShutdownEndpoint
extends
AbstractEndpoint
<
Map
<
String
,
Object
>>
public
class
ShutdownEndpoint
extends
AbstractEndpoint
<
Map
<
String
,
Object
>>
implements
ApplicationContextAware
{
implements
ApplicationContextAware
{
private
static
final
Map
<
String
,
Object
>
NO_CONTEXT_MESSAGE
=
Collections
.
unmodifiableMap
(
Collections
.<
String
,
Object
>
singletonMap
(
"message"
,
"No context to shutdown."
));
private
static
final
Map
<
String
,
Object
>
SHUTDOWN_MESSAGE
=
Collections
.
unmodifiableMap
(
Collections
.<
String
,
Object
>
singletonMap
(
"message"
,
"Shutting down, bye..."
));
private
ConfigurableApplicationContext
context
;
private
ConfigurableApplicationContext
context
;
/**
/**
...
@@ -46,19 +54,15 @@ public class ShutdownEndpoint extends AbstractEndpoint<Map<String, Object>>
...
@@ -46,19 +54,15 @@ public class ShutdownEndpoint extends AbstractEndpoint<Map<String, Object>>
@Override
@Override
public
Map
<
String
,
Object
>
invoke
()
{
public
Map
<
String
,
Object
>
invoke
()
{
if
(
this
.
context
==
null
)
{
if
(
this
.
context
==
null
)
{
return
Collections
.<
String
,
Object
>
singletonMap
(
"message"
,
return
NO_CONTEXT_MESSAGE
;
"No context to shutdown."
);
}
}
try
{
try
{
return
Collections
.<
String
,
Object
>
singletonMap
(
"message"
,
return
SHUTDOWN_MESSAGE
;
"Shutting down, bye..."
);
}
}
finally
{
finally
{
new
Thread
(
new
Runnable
()
{
new
Thread
(
new
Runnable
()
{
@Override
@Override
public
void
run
()
{
public
void
run
()
{
try
{
try
{
...
@@ -69,8 +73,8 @@ public class ShutdownEndpoint extends AbstractEndpoint<Map<String, Object>>
...
@@ -69,8 +73,8 @@ public class ShutdownEndpoint extends AbstractEndpoint<Map<String, Object>>
}
}
ShutdownEndpoint
.
this
.
context
.
close
();
ShutdownEndpoint
.
this
.
context
.
close
();
}
}
}).
start
();
}).
start
();
}
}
}
}
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/AbstractMetricExporter.java
View file @
79922360
/*
/*
* 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.
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/MetricExporters.java
View file @
79922360
/*
/*
* 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.
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceBeanCreationFailureAnalyzer.java
View file @
79922360
...
@@ -32,10 +32,9 @@ class DataSourceBeanCreationFailureAnalyzer
...
@@ -32,10 +32,9 @@ class DataSourceBeanCreationFailureAnalyzer
@Override
@Override
protected
FailureAnalysis
analyze
(
Throwable
rootFailure
,
protected
FailureAnalysis
analyze
(
Throwable
rootFailure
,
DataSourceBeanCreationException
cause
)
{
DataSourceBeanCreationException
cause
)
{
String
description
=
cause
.
getMessage
()
String
message
=
cause
.
getMessage
();
.
substring
(
0
,
cause
.
getMessage
().
indexOf
(
"."
)).
trim
();
String
description
=
message
.
substring
(
0
,
message
.
indexOf
(
"."
)).
trim
();
String
action
=
cause
.
getMessage
().
substring
(
cause
.
getMessage
().
indexOf
(
"."
)
+
1
)
String
action
=
message
.
substring
(
message
.
indexOf
(
"."
)
+
1
).
trim
();
.
trim
();
return
new
FailureAnalysis
(
description
,
action
,
cause
);
return
new
FailureAnalysis
(
description
,
action
,
cause
);
}
}
...
...
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