File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Threads and Synchronization and the fly likes Regain Access to Running Thread without passing reference Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Regain Access to Running Thread without passing reference" Watch "Regain Access to Running Thread without passing reference" New topic
Author

Regain Access to Running Thread without passing reference

Thomas Martin
Greenhorn

Joined: Mar 10, 2005
Posts: 2
Howdy! my question is if I can regain access to a thread that is running from different classes without directly passing a reference?

Consider:


Inputs highly appreciated!
Thanks, T.
James Carman
Ranch Hand

Joined: Feb 20, 2001
Posts: 580
You can always access the currently running Thread by doing Thread.currentThread(). In your case, I wouldn't extend Thread at all. Use a Runnable object instead.


James Carman, President<br />Carman Consulting, Inc.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Regain Access to Running Thread without passing reference
 
Similar Threads
Question on WeakHashMap
Using this to reference static variables
here is a good practice question re: Threads (big topic on jdk 1.4 test)
Shift operators - question
main()