JBoss MBean, start a thread

B

Berlin Brown

Is there code out there for starting a thread in JBoss, mainly within
in a MBean. I could do it the normal way, but I just want to make sure
there isnt a JBoss way of doing it.
 
K

kjc

Berlin said:
Is there code out there for starting a thread in JBoss, mainly within
in a MBean. I could do it the normal way, but I just want to make sure
there isnt a JBoss way of doing it.
What are you trying to do in your thread.
 
B

Berlin Brown

Open a stateless socket connection to a server, read a couple of bytes
of data and close.
 
K

kjc

Berlin said:
I plan to use some kind of timing, possibly turn it off and on,
intervals.
JBoss has a timer, or worker MBean to do that sort of thing.
If you start up the JMX console, you should be able to see it.
 
E

evadnikufesin

Berlin said:
Is there code out there for starting a thread in JBoss, mainly within
in a MBean. I could do it the normal way, but I just want to make
sure there isnt a JBoss way of doing it.

I've done this. I just created a runnable object and started it in
the start method for the service and sent it a semaphore telling it to
stop in the stop method for the service.

I've never tried the MBean that kjc mentions tho. That might be a
better alternative.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top