Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
joram
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
joram
joram
Commits
c49be272
Commit
c49be272
authored
Dec 17, 2020
by
Andre Freyssinet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds dumpServerState method.
parent
9d3b9ce9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
0 deletions
+42
-0
joram/a3/rt/src/main/java/fr/dyade/aaa/agent/SCServer.java
joram/a3/rt/src/main/java/fr/dyade/aaa/agent/SCServer.java
+41
-0
joram/a3/rt/src/main/java/fr/dyade/aaa/agent/SCServerMBean.java
...a3/rt/src/main/java/fr/dyade/aaa/agent/SCServerMBean.java
+1
-0
No files found.
joram/a3/rt/src/main/java/fr/dyade/aaa/agent/SCServer.java
View file @
c49be272
...
...
@@ -86,6 +86,46 @@ public class SCServer implements SCServerMBean {
return
servers
;
}
@Override
public
void
dumpServerState
(
String
path
)
{
dumpServerState
(
path
,
null
);
}
public
static
void
dumpServerState
(
String
path
,
String
cause
)
{
FileWriter
writer
=
null
;
try
{
writer
=
new
FileWriter
(
path
,
true
);
final
StringBuffer
strbuf
=
new
StringBuffer
();
if
(
cause
!=
null
)
{
writer
.
write
(
"\n===== Dump cause =====\n\n"
);
writer
.
write
(
cause
);
writer
.
write
(
"\n"
);
}
writer
.
write
(
"\n===== MBean's attributes =====\n\n"
);
DumpAttributes
.
dumpAttributes
(
"*:*"
,
strbuf
);
writer
.
write
(
strbuf
.
toString
());
writer
.
flush
();
strbuf
.
setLength
(
0
);
writer
.
write
(
"\n===== Thread's stack traces =====\n\n"
);
DumpAttributes
.
dumpAllStackTraces
(
strbuf
);
writer
.
write
(
strbuf
.
toString
());
writer
.
flush
();
strbuf
.
setLength
(
0
);
}
catch
(
IOException
exc
)
{
logger
.
log
(
BasicLevel
.
ERROR
,
"MqttCheckActivator.dumpServerState, cannot open dump file \""
+
path
+
"\""
,
exc
);
}
finally
{
if
(
writer
!=
null
)
try
{
writer
.
close
();
}
catch
(
IOException
e
)
{}
}
}
public
void
dumpAttributes
(
String
name
,
String
path
,
boolean
threaddump
)
{
FileWriter
writer
=
null
;
try
{
...
...
@@ -95,6 +135,7 @@ public class SCServer implements SCServerMBean {
DumpAttributes
.
dumpAttributes
(
name
,
strbuf
);
if
(
threaddump
)
DumpAttributes
.
dumpAllStackTraces
(
strbuf
);
writer
.
write
(
strbuf
.
toString
());
writer
.
close
();
}
catch
(
IOException
exc
)
{
logger
.
log
(
BasicLevel
.
ERROR
,
...
...
joram/a3/rt/src/main/java/fr/dyade/aaa/agent/SCServerMBean.java
View file @
c49be272
...
...
@@ -33,5 +33,6 @@ public interface SCServerMBean {
public
String
[]
getServers
();
public
void
dumpServerState
(
String
path
);
public
void
dumpAttributes
(
String
name
,
String
path
,
boolean
threaddump
);
}
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