Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Products
/
LILOM
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
2
Merge Requests
0
Wiki
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
92dffe6c
...
92dffe6c25c977428455a36016a9706461b8b9ae
authored
2017-01-18 17:20:19 +0100
by
Christian Gerdes
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Lagt till dumpAllMBeans()
1 parent
d6ba81ae
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
2 deletions
LILJM/se/lil/jm/JmxMon.java
LILJM/se/lil/jm/TestRunner.java
LILJM/se/lil/jm/JmxMon.java
View file @
92dffe6
...
...
@@ -2,11 +2,15 @@ package se.lil.jm;
import
java.io.IOException
;
import
java.net.MalformedURLException
;
import
java.util.Set
;
import
java.util.concurrent.locks.Lock
;
import
java.util.concurrent.locks.ReentrantLock
;
import
javax.management.JMX
;
import
javax.management.MBeanAttributeInfo
;
import
javax.management.MBeanInfo
;
import
javax.management.MBeanServerConnection
;
import
javax.management.MalformedObjectNameException
;
import
javax.management.ObjectName
;
import
javax.management.remote.JMXConnector
;
import
javax.management.remote.JMXConnectorFactory
;
...
...
@@ -27,6 +31,29 @@ public class JmxMon {
int
getDataCalls
=
0
;
int
getDataSucess
=
0
;
public
void
dumpAllMBeans
()
{
dumpAllMBeans
(
null
);
}
public
void
dumpAllMBeans
(
String
query
)
{
if
(
mbsc
!=
null
)
{
try
{
Set
<
ObjectName
>
res
=
mbsc
.
queryNames
(
query
!=
null
?
new
ObjectName
(
query
)
:
ObjectName
.
WILDCARD
,
null
);
for
(
ObjectName
name
:
res
)
{
System
.
out
.
println
(
name
.
getCanonicalName
());
MBeanInfo
inf
=
mbsc
.
getMBeanInfo
(
name
);
MBeanAttributeInfo
[]
attribs
=
inf
.
getAttributes
();
for
(
MBeanAttributeInfo
ainf
:
attribs
)
{
System
.
out
.
println
(
"("
+
ainf
.
getType
()
+
") "
+
ainf
.
getName
());
}
}
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
}
}
public
int
getDataCalled
()
{
return
getDataCalls
;
}
...
...
LILJM/se/lil/jm/TestRunner.java
View file @
92dffe6
...
...
@@ -19,7 +19,8 @@ public class TestRunner {
Long
ts1
=
System
.
currentTimeMillis
();
JmxMon
mon1
=
new
JmxMon
(
"service:jmx:iiop:///jndi/iiop://u01892.ef.kap.rsv.se:17020/weblogic.management.mbeanservers.runtime"
);
//JmxMon mon1 = new JmxMon("service:jmx:rmi:///jndi/iiop://u01892.ef.kap.rsv.se:17020/weblogic.management.mbeanservers.runtime");
JmxMon
mon1
=
new
JmxMon
(
"service:jmx:iiop:///jndi/iiop://u30009:26732/weblogic.management.mbeanservers.runtime"
);
mon1
.
open
();
jmxList
.
add
(
mon1
);
...
...
@@ -30,7 +31,9 @@ public class TestRunner {
+
"\nTime: "
+
time
+
"ms\n"
);
int
times
=
3
;
mon1
.
dumpAllMBeans
(
"java.lang:*"
);
int
times
=
0
;
while
(
times
--
>
0
)
{
for
(
JmxMon
mon
:
jmxList
)
{
ts1
=
System
.
currentTimeMillis
();
...
...
Please
register
or
sign in
to post a comment