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
5ed2a963
Commit
5ed2a963
authored
May 22, 2015
by
olivier bourgain
Committed by
Andy Wilkinson
Jun 22, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make InMemoryTraceRepository thread-safe
Closes gh-3027
parent
8681a8ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
InMemoryTraceRepository.java
...framework/boot/actuate/trace/InMemoryTraceRepository.java
+9
-3
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/trace/InMemoryTraceRepository.java
View file @
5ed2a963
...
...
@@ -16,6 +16,7 @@
package
org
.
springframework
.
boot
.
actuate
.
trace
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.LinkedList
;
...
...
@@ -26,6 +27,7 @@ import java.util.Map;
* In-memory implementation of {@link TraceRepository}.
*
* @author Dave Syer
* @author Olivier Bourgain
*/
public
class
InMemoryTraceRepository
implements
TraceRepository
{
...
...
@@ -40,20 +42,24 @@ public class InMemoryTraceRepository implements TraceRepository {
* @param reverse flag value (default true)
*/
public
void
setReverse
(
boolean
reverse
)
{
this
.
reverse
=
reverse
;
synchronized
(
this
.
traces
)
{
this
.
reverse
=
reverse
;
}
}
/**
* @param capacity the capacity to set
*/
public
void
setCapacity
(
int
capacity
)
{
this
.
capacity
=
capacity
;
synchronized
(
this
.
traces
)
{
this
.
capacity
=
capacity
;
}
}
@Override
public
List
<
Trace
>
findAll
()
{
synchronized
(
this
.
traces
)
{
return
Collections
.
unmodifiableList
(
this
.
traces
);
return
Collections
.
unmodifiableList
(
new
ArrayList
<
Trace
>(
this
.
traces
)
);
}
}
...
...
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