M
Mitch
Hi, I have some new experience with threads and collections and servlets
and am now looking at a way of throwing the three together.
I have a program that currently fires off threads at random intervals
and does some stuff, and holds some information individual to each thread.
I also have a servlet which is designed to output the information of
this system in XML format.
I would like to find a way to allow the servlet to iterate over the
running threads and obtain the information it requires.
One idea I had was to add each object that implements the Runnable
interface to an ArrayList - will this affect the Runnable nature of the
object? If I did this I could then iterate over the indexes of the
ArrayList.
Is there a cleaner way of doing this - perhaps an iterator that runs on
threads? (I haven't found any in the Thread class) perhaps adding the
threads to a thread group adds the required functionality?
Thanks for any ideas,
Mitch.
and am now looking at a way of throwing the three together.
I have a program that currently fires off threads at random intervals
and does some stuff, and holds some information individual to each thread.
I also have a servlet which is designed to output the information of
this system in XML format.
I would like to find a way to allow the servlet to iterate over the
running threads and obtain the information it requires.
One idea I had was to add each object that implements the Runnable
interface to an ArrayList - will this affect the Runnable nature of the
object? If I did this I could then iterate over the indexes of the
ArrayList.
Is there a cleaner way of doing this - perhaps an iterator that runs on
threads? (I haven't found any in the Thread class) perhaps adding the
threads to a thread group adds the required functionality?
Thanks for any ideas,
Mitch.