JMX Console Operationen ausführen

iNstinct

Mitglied
Hi Leute,

ich stehe vor einem großen Problem. Ich will einige Operationen der JMX Objekte eines externen JBoss Servers ausführen und deren Rückgabewerte bearbeiten. Vorallem das System Objekt. An die Attribute komme ich ran (JMX Connection), aber wie kann ich die Methoden der Objekte aufrufen und deren Rückgabewerte an mich nehmen?

Ich hoffe, dass es überhaupt möglich ist.

Grüße,
iNstinct
 
Hallo,

willst du wirklich mit der JConsole operationen aufrufen und die Rückgabewerte ansehen, oder willst du das programatisch im Code machen?
Das ist möglich, jedoch musst du beachten, dass du auch die Klassen im Classpath des "Clients" hast welche in den Rückgabewerten verwendet werden.

Gruß Tom
 
Ich möchte zum Beispiel aus der den system.server.ServerInfo.listThreadDump() Operator aufrufen und den String in meiner Anwendung bearbeiten (danach erst ausgeben).

Also nur den String bekommen, damit ich mit diesem Objekt arbeiten kann.
 
Hallo,

schau mal hier:
http://www.tutorials.de/forum/j2ee/258064-probleme-bei-verbindung-mit-rmi.html

Java:
/**
 * 
 */
package de.tutorials;

import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
import javax.naming.InitialContext;

/**
 * @author Thomas.Darimont
 */
public class JMXClient {

  /**
   * @param args
   */
  public static void main(String[] args) throws Exception {
    InitialContext initialContext = new InitialContext();
    MBeanServerConnection mBeanServerConnection = (MBeanServerConnection) initialContext
      .lookup("jmx/invoker/RMIAdaptor");
    ObjectName objectName = new ObjectName("jboss.system:type=ServerInfo");
    Object result = mBeanServerConnection.invoke(objectName, "listThreadDump", new Object[0], new String[0]);
    System.out.println(result);
  }
}

Ausgabe:
Code:
<b>Total Threads:</b> 52<br><b>Total Thread Groups:</b> 8<br><br><b>Thread Group: system</b> : max priority:10, demon:false<blockquote><b>Thread: Reference Handler</b> : priority:10, demon:true, threadId:2, threadState:WAITING, lockName:java.lang.ref.Reference$Lock@19f1a8a<br><blockquote>java.lang.Object.wait(Native Method)<br>java.lang.Object.wait(Object.java:485)<br>java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)<br></blockquote><b>Thread: Finalizer</b> : priority:8, demon:true, threadId:3, threadState:WAITING, lockName:java.lang.ref.ReferenceQueue$Lock@127e4be<br><blockquote>java.lang.Object.wait(Native Method)<br>java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)<br>java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)<br>java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)<br></blockquote><b>Thread: Signal Dispatcher</b> : priority:9, demon:true, threadId:4, threadState:RUNNABLE, lockName:null<br><b>Thread: Attach Listener</b> : priority:5, demon:true, threadId:5, threadState:RUNNABLE, lockName:null<br><b>Thread: RMI TCP Accept-1098</b> : priority:5, demon:true, threadId:17, threadState:RUNNABLE, lockName:null<br><blockquote>java.net.PlainSocketImpl.socketAccept(Native Method)<br>java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)<br>java.net.ServerSocket.implAccept(ServerSocket.java:453)<br>java.net.ServerSocket.accept(ServerSocket.java:421)<br>sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:369)<br>sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:341)<br>java.lang.Thread.run(Thread.java:619)<br></blockquote><b>Thread: RMI Reaper</b> : priority:5, demon:false, threadId:18, threadState:WAITING, lockName:java.lang.ref.ReferenceQueue$Lock@4ba66<br><blockquote>java.lang.Object.wait(Native Method)<br>java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)<br>java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)<br>sun.rmi.transport.ObjectTable$Reaper.run(ObjectTable.java:333)<br>java.lang.Thread.run(Thread.java:619)<br></blockquote><b>Thread: GC Daemon</b> : priority:2, demon:true, threadId:19, threadState:TIMED_WAITING, lockName:sun.misc.GC$LatencyLock@aea8cf<br><blockquote>java.lang.Object.wait(Native Method)<br>sun.misc.GC$Daemon.run(GC.java:100)<br></blockquote><b>Thread: RMI TCP Accept-4444</b> : priority:5, demon:true, threadId:27, threadState:RUNNABLE, lockName:null<br><blockquote>java.net.PlainSocketImpl.socketAccept(Native Method)<br>java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)<br>java.net.ServerSocket.implAccept(ServerSocket.java:453)<br>java.net.ServerSocket.accept(ServerSocket.java:421)<br>sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:369)<br>sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:341)<br>java.lang.Thread.run(Thread.java:619)<br></blockquote><b>Thread: RMI Scheduler(0)</b> : priority:5, demon:true, threadId:61, threadState:TIMED_WAITING, lockName:java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@d9973a<br><blockquote>sun.misc.Unsafe.park(Native Method)<br>java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)<br>java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1963)<br>java.util.concurrent.DelayQueue.take(DelayQueue.java:164)<br>java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:582)<br>java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:575)<br>java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)<br>java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)<br>java.lang.Thread.run(Thread.java:619)<br></blockquote><br><b>Thread Group: main</b> : max priority:10, demon:false<blockquote><b>Thread: DestroyJavaVM</b> : priority:5, demon:false, threadId:10, threadState:RUNNABLE, lockName:null<br><br><b>Thread Group: jboss</b> : max priority:10, demon:false<blockquote><b>Thread: Timer-0</b> : priority:5, demon:true, threadId:13, threadState:TIMED_WAITING, lockName:java.util.TaskQueue@5f8245<br><blockquote>java.lang.Object.wait(Native Method)<br>java.util.TimerThread.mainLoop(Timer.java:509)<br>java.util.TimerThread.run(Timer.java:462)<br></blockquote><b>Thread: ScannerThread</b> : priority:5, demon:true, threadId:14, threadState:TIMED_WAITING, lockName:null<br><blockquote>java.lang.Thread.sleep(Native Method)<br>org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:280)<br>org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)<br></blockquote><b>Thread: Listener:4769</b> : priority:5, demon:true, threadId:21, threadState:RUNNABLE, lockName:null<br><blockquote>java.net.PlainSocketImpl.socketAccept(Native Method)<br>java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)<br>java.net.ServerSocket.implAccept(ServerSocket.java:453)<br>java.net.ServerSocket.accept(ServerSocket.java:421)<br>com.arjuna.ats.internal.arjuna.recovery.Listener.run(Listener.java:119)<br></blockquote><b>Thread: Thread-3</b> : priority:5, demon:true, threadId:23, threadState:TIMED_WAITING, lockName:null<br><blockquote>java.lang.Thread.sleep(Native Method)<br>com.arjuna.ats.internal.arjuna.recovery.ExpiredEntryMonitor.run(ExpiredEntryMonitor.java:237)<br></blockquote><b>Thread: Listener:4773</b> : priority:5, demon:true, threadId:26, threadState:RUNNABLE, lockName:null<br><blockquote>java.net.PlainSocketImpl.socketAccept(Native Method)<br>java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)<br>java.net.ServerSocket.implAccept(ServerSocket.java:453)<br>java.net.ServerSocket.accept(ServerSocket.java:421)<br>com.arjuna.ats.internal.arjuna.recovery.Listener.run(Listener.java:119)<br></blockquote><b>Thread: PooledInvokerAcceptor#0-4445</b> : priority:5, demon:false, threadId:28, threadState:RUNNABLE, lockName:null<br><blockquote>java.net.PlainSocketImpl.socketAccept(Native Method)<br>java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)<br>java.net.ServerSocket.implAccept(ServerSocket.java:453)<br>java.net.ServerSocket.accept(ServerSocket.java:421)<br>org.jboss.invocation.pooled.server.PooledInvoker.run(PooledInvoker.java:262)<br>java.lang.Thread.run(Thread.java:619)<br></blockquote><b>Thread: AcceptorThread#0:4446</b> : priority:5, demon:false, threadId:29, threadState:RUNNABLE, lockName:null<br><blockquote>java.net.PlainSocketImpl.socketAccept(Native Method)<br>java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)<br>java.net.ServerSocket.implAccept(ServerSocket.java:453)<br>java.net.ServerSocket.accept(ServerSocket.java:421)<br>org.jboss.remoting.transport.socket.SocketServerInvoker.run(SocketServerInvoker.java:520)<br>java.lang.Thread.run(Thread.java:619)<br></blockquote><b>Thread: ServerSocketRefresh</b> : priority:5, demon:true, threadId:30, threadState:WAITING, lockName:java.lang.Object@d6a0e0<br><blockquote>java.lang.Object.wait(Native Method)<br>java.lang.Object.wait(Object.java:485)<br>org.jboss.remoting.transport.socket.SocketServerInvoker$ServerSocketRefresh.run(SocketServerInvoker.java:704)<br></blockquote><b>Thread: AcceptorThread#0:3873</b> : priority:5, demon:false, threadId:31, threadState:RUNNABLE, lockName:null<br><blockquote>java.net.PlainSocketImpl.socketAccept(Native Method)<br>java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)<br>java.net.ServerSocket.implAccept(ServerSocket.java:453)<br>java.net.ServerSocket.accept(ServerSocket.java:421)<br>org.jboss.remoting.transport.socket.SocketServerInvoker.run(SocketServerInvoker.java:520)<br>java.lang.Thread.run(Thread.java:619)<br></blockquote><b>Thread: ServerSocketRefresh</b> : priority:5, demon:true, threadId:32, threadState:WAITING, lockName:java.lang.Object@9a44d6<br><blockquote>java.lang.Object.wait(Native Method)<br>java.lang.Object.wait(Object.java:485)<br>org.jboss.remoting.transport.socket.SocketServerInvoker$ServerSocketRefresh.run(SocketServerInvoker.java:704)<br></blockquote><b>Thread: SubscriptionWatchDog</b> : priority:5, demon:false, threadId:33, threadState:TIMED_WAITING, lockName:null<br><blockquote>java.lang.Thread.sleep(Native Method)<br>org.jboss.ws.extensions.eventing.mgmt.SubscriptionManager$WatchDog.run(SubscriptionManager.java:643)<br>java.lang.Thread.run(Thread.java:619)<br></blockquote><b>Thread: ContainerBackgroundProcessor[StandardEngine[jboss.web]]</b> : priority:5, demon:true, threadId:34, threadState:TIMED_WAITING, lockName:null<br><blockquote>java.lang.Thread.sleep(Native Method)<br>org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1549)<br>java.lang.Thread.run(Thread.java:619)<br></blockquote><b>Thread: JBossMQ Cache Reference Softner</b> : priority:5, demon:true, threadId:35, threadState:TIMED_WAITING, lockName:java.lang.ref.ReferenceQueue$Lock@1789a96<br><blockquote>java.lang.Object.wait(Native Method)<br>java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)<br>org.jboss.mq.server.MessageCache.run(MessageCache.java:245)<br>java.lang.Thread.run(Thread.java:619)<br></blockquote><b>Thread: Thread-5</b> : priority:5, demon:true, threadId:36, threadState:TIMED_WAITING, lockName:null<br><blockquote>java.lang.Thread.sleep(Native Method)<br>org.jboss.console.plugins.AOPLister$1.run(AOPLister.java:882)<br>java.lang.Thread.run(Thread.java:619)<br></blockquote><b>Thread: DefaultQuartzScheduler_Worker-0</b> : priority:5, demon:false, threadId:37, threadState:TIMED_WAITING, lockName:java.lang.Object@190d1e8<br><blockquote>java.lang.Object.wait(Native Method)<br>org.quartz.simpl.SimpleThreadPool.getNextRunnable(SimpleThreadPool.java:428)<br>org.quartz.simpl.SimpleThreadPool.access$000(SimpleThreadPool.java:47)<br>org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:518)<br></blockquote><b>Thread: DefaultQuartzScheduler_Worker-1</b> : priority:5, demon:false, threadId:38, threadState:TIMED_WAITING, lockName:java.lang.Object@190d1e8<br><blockquote>java.lang.Object.wait(Native Method)<br>org.quartz.simpl.SimpleThreadPool.getNextRunnable(SimpleThreadPool.java:428)<br>org.quartz.simpl.SimpleThreadPool.access$000(SimpleThreadPool.java:47)<br>org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:518)<br></blockquote><b>Thread: DefaultQuartzScheduler_Worker-2</b> : priority:5, demon:false, threadId:39, threadState:TIMED_WAITING, lockName:java.lang.Object@190d1e8<br><blockquote>java.lang.Object.wait(Native Method)<br>org.quartz.simpl.SimpleThreadPool.getNextRunnable(SimpleThreadPool.java:428)<br>org.quartz.simpl.SimpleThreadPool.access$000(SimpleThreadPool.java:47)<br>org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:518)<br></blockquote><b>Thread: DefaultQuartzScheduler_Worker-3</b> : priority:5, demon:false, threadId:40, threadState:TIMED_WAITING, lockName:java.lang.Object@190d1e8<br><blockquote>java.lang.Object.wait(Native Method)<br>org.quartz.simpl.SimpleThreadPool.getNextRunnable(SimpleThreadPool.java:428)<br>org.quartz.simpl.SimpleThreadPool.access$000(SimpleThreadPool.java:47)<br>org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:518)<br></blockquote><b>Thread: DefaultQuartzScheduler_Worker-4</b> : priority:5, demon:false, threadId:41, threadState:TIMED_WAITING, lockName:java.lang.Object@190d1e8<br><blockquote>java.lang.Object.wait(Native Method)<br>org.quartz.simpl.SimpleThreadPool.getNextRunnable(SimpleThreadPool.java:428)<br>org.quartz.simpl.SimpleThreadPool.access$000(SimpleThreadPool.java:47)<br>org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:518)<br></blockquote><b>Thread: DefaultQuartzScheduler_Worker-5</b> : priority:5, demon:false, threadId:42, threadState:TIMED_WAITING, lockName:java.lang.Object@190d1e8<br><blockquote>java.lang.Object.wait(Native Method)<br>org.quartz.simpl.SimpleThreadPool.getNextRunnable(SimpleThreadPool.java:428)<br>org.quartz.simpl.SimpleThreadPool.access$000(SimpleThreadPool.java:47)<br>org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:518)<br></blockquote><b>Thread: DefaultQuartzScheduler_Worker-6</b> : priority:5, demon:false, threadId:43, threadState:TIMED_WAITING, lockName:java.lang.Object@190d1e8<br><blockquote>java.lang.Object.wait(Native Method)<br>org.quartz.simpl.SimpleThreadPool.getNextRunnable(SimpleThreadPool.java:428)<br>org.quartz.simpl.SimpleThreadPool.access$000(SimpleThreadPool.java:47)<br>org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:518)<br></blockquote><b>Thread: DefaultQuartzScheduler_Worker-7</b> : priority:5, demon:false, threadId:44, threadState:TIMED_WAITING, lockName:java.lang.Object@190d1e8<br><blockquote>java.lang.Object.wait(Native Method)<br>org.quartz.simpl.SimpleThreadPool.getNextRunnable(SimpleThreadPool.java:428)<br>org.quartz.simpl.SimpleThreadPool.access$000(SimpleThreadPool.java:47)<br>org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:518)<br></blockquote><b>Thread: DefaultQuartzScheduler_Worker-8</b> : priority:5, demon:false, threadId:45, threadState:TIMED_WAITING, lockName:java.lang.Object@190d1e8<br><blockquote>java.lang.Object.wait(Native Method)<br>org.quartz.simpl.SimpleThreadPool.getNextRunnable(SimpleThreadPool.java:428)<br>org.quartz.simpl.SimpleThreadPool.access$000(SimpleThreadPool.java:47)<br>org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:518)<br></blockquote><b>Thread: DefaultQuartzScheduler_Worker-9</b> : priority:5, demon:false, threadId:46, threadState:TIMED_WAITING, lockName:java.lang.Object@190d1e8<br><blockquote>java.lang.Object.wait(Native Method)<br>org.quartz.simpl.SimpleThreadPool.getNextRunnable(SimpleThreadPool.java:428)<br>org.quartz.simpl.SimpleThreadPool.access$000(SimpleThreadPool.java:47)<br>org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:518)<br></blockquote><b>Thread: HSQLDB Timer @124d504</b> : priority:5, demon:true, threadId:48, threadState:TIMED_WAITING, lockName:org.hsqldb.lib.HsqlTimer@124d504<br><blockquote>java.lang.Object.wait(Native Method)<br>org.hsqldb.lib.HsqlTimer.nextTask(Unknown Source)<br>org.hsqldb.lib.HsqlTimer$TaskRunner.run(Unknown Source)<br>java.lang.Thread.run(Thread.java:619)<br></blockquote><b>Thread: Timer-1</b> : priority:5, demon:true, threadId:49, threadState:TIMED_WAITING, lockName:java.util.TaskQueue@aee908<br><blockquote>java.lang.Object.wait(Native Method)<br>java.util.TimerThread.mainLoop(Timer.java:509)<br>java.util.TimerThread.run(Timer.java:462)<br></blockquote><b>Thread: JCA PoolFiller</b> : priority:5, demon:false, threadId:50, threadState:WAITING, lockName:java.util.LinkedList@1499616<br><blockquote>java.lang.Object.wait(Native Method)<br>java.lang.Object.wait(Object.java:485)<br>org.jboss.resource.connectionmanager.PoolFiller.run(PoolFiller.java:87)<br>java.lang.Thread.run(Thread.java:619)<br></blockquote><b>Thread: Thread-8</b> : priority:5, demon:true, threadId:51, threadState:TIMED_WAITING, lockName:com.arjuna.ats.arjuna.coordinator.TransactionReaper@422510<br><blockquote>java.lang.Object.wait(Native Method)<br>com.arjuna.ats.internal.arjuna.coordinator.ReaperThread.run(ReaperThread.java:98)<br></blockquote><b>Thread: TimeoutFactory-0</b> : priority:5, demon:true, threadId:52, threadState:WAITING, lockName:java.lang.Object@12d9844<br><blockquote>java.lang.Object.wait(Native Method)<br>java.lang.Object.wait(Object.java:485)<br>org.jboss.util.timeout.TimeoutPriorityQueueImpl.poll(TimeoutPriorityQueueImpl.java:253)<br>org.jboss.util.timeout.TimeoutPriorityQueueImpl.take(TimeoutPriorityQueueImpl.java:230)<br>org.jboss.util.timeout.TimeoutFactory.doWork(TimeoutFactory.java:215)<br>org.jboss.util.timeout.TimeoutFactory.access$000(TimeoutFactory.java:41)<br>org.jboss.util.timeout.TimeoutFactory$1.run(TimeoutFactory.java:136)<br></blockquote><b>Thread: JBossLifeThread</b> : priority:5, demon:false, threadId:54, threadState:WAITING, lockName:java.lang.Object@1c98c1b<br><blockquote>java.lang.Object.wait(Native Method)<br>java.lang.Object.wait(Object.java:485)<br>org.jboss.system.server.ServerImpl$LifeThread.run(ServerImpl.java:940)<br></blockquote><b>Thread: http-127.0.0.1-8080-Acceptor-0</b> : priority:5, demon:true, threadId:55, threadState:RUNNABLE, lockName:null<br><blockquote>java.net.PlainSocketImpl.socketAccept(Native Method)<br>java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)<br>java.net.ServerSocket.implAccept(ServerSocket.java:453)<br>java.net.ServerSocket.accept(ServerSocket.java:421)<br>org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:61)<br>org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:310)<br>java.lang.Thread.run(Thread.java:619)<br></blockquote><b>Thread: ajp-127.0.0.1-8009-Acceptor-0</b> : priority:5, demon:true, threadId:56, threadState:RUNNABLE, lockName:null<br><blockquote>java.net.PlainSocketImpl.socketAccept(Native Method)<br>java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)<br>java.net.ServerSocket.implAccept(ServerSocket.java:453)<br>java.net.ServerSocket.accept(ServerSocket.java:421)<br>org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:61)<br>org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:310)<br>java.lang.Thread.run(Thread.java:619)<br></blockquote><b>Thread: Thread-4</b> : priority:5, demon:false, threadId:24, threadState:TIMED_WAITING, lockName:null<br><blockquote>java.lang.Thread.sleep(Native Method)<br>com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWork(PeriodicRecovery.java:248)<br>com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:163)<br></blockquote><b>Thread: http-127.0.0.1-8080-1</b> : priority:5, demon:true, threadId:62, threadState:WAITING, lockName:org.apache.tomcat.util.net.JIoEndpoint$Worker@12929b2<br><blockquote>java.lang.Object.wait(Native Method)<br>java.lang.Object.wait(Object.java:485)<br>org.apache.tomcat.util.net.JIoEndpoint$Worker.await(JIoEndpoint.java:416)<br>org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:442)<br>java.lang.Thread.run(Thread.java:619)<br></blockquote><b>Thread: http-127.0.0.1-8080-2</b> : priority:5, demon:true, threadId:63, threadState:WAITING, lockName:org.apache.tomcat.util.net.JIoEndpoint$Worker@17667bd<br><blockquote>java.lang.Object.wait(Native Method)<br>java.lang.Object.wait(Object.java:485)<br>org.apache.tomcat.util.net.JIoEndpoint$Worker.await(JIoEndpoint.java:416)<br>org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:442)<br>java.lang.Thread.run(Thread.java:619)<br></blockquote><br><b>Thread Group: JBoss Pooled Threads</b> : max priority:10, demon:false<blockquote><br><b>Thread Group: System Threads</b> : max priority:10, demon:false<blockquote><b>Thread: JBoss System Threads(1)-1</b> : priority:5, demon:true, threadId:16, threadState:RUNNABLE, lockName:null<br><blockquote>java.net.PlainSocketImpl.socketAccept(Native Method)<br>java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)<br>java.net.ServerSocket.implAccept(ServerSocket.java:453)<br>java.net.ServerSocket.accept(ServerSocket.java:421)<br>org.jboss.web.WebServer.run(WebServer.java:320)<br>org.jboss.util.threadpool.RunnableTaskWrapper.run(RunnableTaskWrapper.java:148)<br>EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)<br>java.lang.Thread.run(Thread.java:619)<br></blockquote><b>Thread: JBoss System Threads(1)-2</b> : priority:5, demon:true, threadId:20, threadState:RUNNABLE, lockName:null<br><blockquote>java.net.PlainSocketImpl.socketAccept(Native Method)<br>java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)<br>java.net.ServerSocket.implAccept(ServerSocket.java:453)<br>java.net.ServerSocket.accept(ServerSocket.java:421)<br>org.jnp.server.Main$AcceptHandler.run(Main.java:481)<br>org.jboss.util.threadpool.RunnableTaskWrapper.run(RunnableTaskWrapper.java:148)<br>EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)<br>java.lang.Thread.run(Thread.java:619)<br></blockquote><b>Thread: JBoss System Threads(1)-6</b> : priority:5, demon:true, threadId:64, threadState:TIMED_WAITING, lockName:java.lang.Object@47c130<br><blockquote>java.lang.Object.wait(Native Method)<br>EDU.oswego.cs.dl.util.concurrent.BoundedLinkedQueue.poll(BoundedLinkedQueue.java:253)<br>EDU.oswego.cs.dl.util.concurrent.PooledExecutor.getTask(PooledExecutor.java:723)<br>org.jboss.util.threadpool.MinPooledExecutor.getTask(MinPooledExecutor.java:106)<br>EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:747)<br>java.lang.Thread.run(Thread.java:619)<br></blockquote></blockquote><br><b>Thread Group: JBossMQ Server Threads</b> : max priority:10, demon:false<blockquote><b>Thread: UILServerILService Accept Thread</b> : priority:5, demon:false, threadId:53, threadState:RUNNABLE, lockName:null<br><blockquote>java.net.PlainSocketImpl.socketAccept(Native Method)<br>java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)<br>java.net.ServerSocket.implAccept(ServerSocket.java:453)<br>java.net.ServerSocket.accept(ServerSocket.java:421)<br>org.jboss.mq.il.uil2.UILServerILService.run(UILServerILService.java:159)<br>java.lang.Thread.run(Thread.java:619)<br></blockquote></blockquote></blockquote><br><b>Thread Group: QuartzScheduler:DefaultQuartzScheduler</b> : max priority:10, demon:false<blockquote><b>Thread: DefaultQuartzScheduler_QuartzSchedulerThread</b> : priority:5, demon:false, threadId:47, threadState:TIMED_WAITING, lockName:null<br><blockquote>java.lang.Thread.sleep(Native Method)<br>org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:394)<br></blockquote></blockquote></blockquote></blockquote><br><b>Thread Group: RMI Runtime</b> : max priority:10, demon:false<blockquote><b>Thread: RMI TCP Connection(2)-127.0.0.1</b> : priority:5, demon:true, threadId:65, threadState:RUNNABLE, lockName:null<br><blockquote>java.net.SocketInputStream.socketRead0(Native Method)<br>java.net.SocketInputStream.read(SocketInputStream.java:129)<br>java.io.BufferedInputStream.fill(BufferedInputStream.java:218)<br>java.io.BufferedInputStream.read(BufferedInputStream.java:237)<br>java.io.FilterInputStream.read(FilterInputStream.java:66)<br>sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:517)<br>sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)<br>sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)<br>java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)<br>java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)<br>java.lang.Thread.run(Thread.java:619)<br></blockquote><b>Thread: RMI TCP Connection(3)-127.0.0.1</b> : priority:5, demon:true, threadId:66, threadState:RUNNABLE, lockName:null<br><blockquote>sun.management.ThreadImpl.getThreadInfo0(Native Method)<br>sun.management.ThreadImpl.getThreadInfo(ThreadImpl.java:145)<br>sun.management.ThreadImpl.getThreadInfo(ThreadImpl.java:123)<br>sun.reflect.GeneratedMethodAccessor73.invoke(Unknown Source)<br>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>java.lang.reflect.Method.invoke(Method.java:597)<br>org.jboss.system.server.ServerInfo.outputJdk5ThreadMXBeanInfo(ServerInfo.java:662)<br>org.jboss.system.server.ServerInfo.getThreadGroupInfo(ServerInfo.java:631)<br>org.jboss.system.server.ServerInfo.getThreadGroupInfo(ServerInfo.java:638)<br>org.jboss.system.server.ServerInfo.listThreadDump(ServerInfo.java:508)<br>sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>java.lang.reflect.Method.invoke(Method.java:597)<br>org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)<br>org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)<br>org.jboss.mx.server.Invocation.invoke(Invocation.java:86)<br>org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)<br>org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)<br>sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>java.lang.reflect.Method.invoke(Method.java:597)<br>org.jboss.jmx.connector.invoker.InvokerAdaptorService.invoke(InvokerAdaptorService.java:266)<br>sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>java.lang.reflect.Method.invoke(Method.java:597)<br>org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)<br>org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)<br>org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)<br>org.jboss.mx.server.Invocation.invoke(Invocation.java:88)<br>org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)<br>org.jboss.jmx.connector.invoker.SerializableInterceptor.invoke(SerializableInterceptor.java:74)<br>org.jboss.mx.server.Invocation.invoke(Invocation.java:88)<br>org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)<br>org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)<br>org.jboss.invocation.jrmp.server.JRMPProxyFactory.invoke(JRMPProxyFactory.java:179)<br>sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>java.lang.reflect.Method.invoke(Method.java:597)<br>org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)<br>org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)<br>org.jboss.mx.server.Invocation.invoke(Invocation.java:86)<br>org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)<br>org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)<br>org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:818)<br>org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:419)<br>sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>java.lang.reflect.Method.invoke(Method.java:597)<br>sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)<br>sun.rmi.transport.Transport$1.run(Transport.java:159)<br>java.security.AccessController.doPrivileged(Native Method)<br>sun.rmi.transport.Transport.serviceCall(Transport.java:155)<br>sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)<br>sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)<br>sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)<br>java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)<br>java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)<br>java.lang.Thread.run(Thread.java:619)<br></blockquote></blockquote></blockquote>

Gruß Tom
 
Leider muss ich den Thread noch einmal aufachen.
Ich will nun den ausgelesenen String in eine Baumstruktur bringen und schaffe dies auch, leider geht das sehr auf die Performance, da ich einen automatischen Refresher benutze.

Hier mein aktueller Code:
Code:
public int getThreadList(int lineNumber, CheckerNode parent){
        CheckerNode node;
        String lines[] = this.threadDump.split("/n");
        for(int i=lineNumber;i<lines.length;i++){
            if(lines[i].contains("Thread Group: system")){
                lines[i] = lines[i].replace("<blockquote>", "");
                node = new CheckerNode();
                node.setText(lines[i]);
                parent.add(node);
                i = getThreadList(i+1,node);
            }
            if(i+1 <= lines.length){
                if(lines[i+1].equals("<blockquote>")){
                    node = new CheckerNode();
                    node.setText(lines[i]);
                    parent.add(node);
                    i = getThreadList(i+1, node);
                }
            }
            else if(lines[i].equals("</blockquote>")){
                lines = null;
                node = null;
                return i;
            }
            else if((lines[i] != null && !lines[i].equals(""))
                    && (!lines[i].equals("<blockquote>")
                    && !lines[i].equals("</blockquote>")
                    && !lines[i].contains("Thread Group: system")
                    && !lines[i].contains("Total Threads:")
                    && !lines[i].contains("Total Thread Groups:"))){
                    node = new CheckerNode();
                    node.setText(lines[i]);
                    parent.add(node);
            }
        }
        lines = null;
        node = null;
        return 0;
    }

Geht das auch irgendwie einfacher?
 
Zurück