Off-Topic: Terminating hidden threads.
I have the following code in my main method: public static void main(String[] args) { Image inImage = new ImageIcon(C:\\logo.gif).getImage(); System.out.println(inImage.getWidth()=+inImage.getWidth(null)); System.out.println(inImage.getHeight()=+inImage.getHeight(null)); } I get the correct output but how come the program never exits? How to make the program exit? kim. === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant archives, FAQs and Forums on JSPs can be found at: http://java.sun.com/products/jsp http://archives.java.sun.com/jsp-interest.html http://forums.java.sun.com http://www.jspinsider.com
Creating Threads
hi all, i am searching for an answer .. there are 2 ways of creating threads .. 1. extending Thread class 2. implementing Runnable but , it is always better to implement runnable .. i know 1 good reason for that .. ie. u have an option to extend another class if u implement Runnable interface .. as u can extend one class only .. is there any other reason for implementing Runnable ?? is it because composition is always better than inheritance .. ==To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
JSP and Threads
Hi All i'd like to write application where I need to share one Thread between multiple .jsp pages eg. I'll create thread where i would check some file status once in 20sec and svae status to private string variable and i'd have a public .checkStatus() method which will return this status string now i have some (2 or more) .jsp pages and in all i need to call that's thread.checkStatus() method and write it to output can someone help me??/ [woodu] ==To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: JSP and Threads
Why not construct a class using the singleton class design pattern and have the class launch a thread that checks the file status every 20 seconds? This singleton class would have a public, static method, checkStatus(), that would return the file status. Original Message From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: RE: JSP and Threads Date: Fri, 3 May 2002 14:44:10 +0200 Hi All i'd like to write application where I need to share one Thread between multiple .jsp pages eg. I'll create thread where i would check some file status once in 20sec and svae status to private string variable and i'd have a public .checkStatus() method which will return this status string now i have some (2 or more) .jsp pages and in all i need to call that's thread.checkStatus() method and write it to output can someone help me??/ [woodu] === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: JSP and Threads
Hi everybody... I installed J2sdk 1.3.0 on SUSE 7.3 for sparc. I compiled a class and.. perfect... but when i try to compile a class that instance the first class then it can't does it. the error is that it can't find the firs class. thanks in advanced! bye --- Wilson Ernesto Lozano RolOn Ingeniero de Sistemas Universidad Industrial de Santander e-mail [EMAIL PROTECTED] --- === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Tool for monitoring the number of threads from the JVM
Hi all, does anyone know of a way or a tool that I can use to monitor the threads from the JVM in my application. Thanks === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
gracefully stopping idle/suspended/ threads that are still alive?
hey all, i was wondering what the best way to stop a thread was.. the jdk docs say that the stop() method is depreciated, but it doesnt clearly make out a (safe) alternative.. does anyone have any idea on this matter? say for instance.. list[i] is a Thread object.. list[i].stop(); -- want to avoid doing this. === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: gracefully stopping idle/suspended/ threads that are still al ive?
http://java.sun.com/products/jdk/1.2/docs/guide/misc/threadPrimitiveDeprecat ion.html -Original Message- From: Lai, Kenny [mailto:[EMAIL PROTECTED]] Sent: Friday, March 01, 2002 2:17 PM To: [EMAIL PROTECTED] Subject: gracefully stopping idle/suspended/ threads that are still alive? hey all, i was wondering what the best way to stop a thread was.. the jdk docs say that the stop() method is depreciated, but it doesnt clearly make out a (safe) alternative.. does anyone have any idea on this matter? say for instance.. list[i] is a Thread object.. list[i].stop(); -- want to avoid doing this. === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
Re: gracefully stopping idle/suspended/ threads thatare still alive?
Lai, Kenny wrote: i was wondering what the best way to stop a thread was.. the jdk docs say that the stop() method is depreciated, but it doesnt clearly make out a (safe) alternative.. does anyone have any idea on this matter? Java provides no alternative. The thread you want to stop has to be written specially. The official Sun line is that applications cannot safely use stop(). That's probably true, but it also makes it impossible to write servlet containers that can properly manage their webapps. (Imagine if your operating system prohibited you from killing rogue processes because 'it might leave things in an inconsistent state'). Ok, right, I'm calm now, sorry for the rant. Anyway, in addition to the URL posted by Vamsee Bommakanti, you might want to check out: http://g.oswego.edu/dl/cpj/cancel.html -- Christopher St. John [EMAIL PROTECTED] DistribuTopia http://www.distributopia.com === To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com
HELP: chroot and native threads
Apologies if this isn't the best forum, but I've come up empty. We run Tomcat in a chroot environment but cannot use native threads. Everything works great in a non-chroot environment but irratic problems occur in chroot unless we use green threads. Anyone have a clue? pointers to someplace or someone? Anything? Dave
WTC EXPERIENCE AND TERRORIST THREADS
Status Distribution September 14, 2001 19:17:06 The message regarding WTC EXPERIENCE AND TERRORIST THREADS sent on September 14, 2001 19:17:06 was sent by StaStatus Recipien TypeT Native Name [EMAIL PROTECTED] Foreign Native Name [EMAIL PROTECTED]\n\n\nSMTP Recipients Status Reporters Type TypeFrom InitialsPE Middle Initial E Name Domain LOTUS Native Name CN=Patricia E Shoemaker/OU=ITM/OU=DCC/O=DCX Org Foreign Nati Org Unit 1 DCC Org Unit 2 ITM Last Name Narasimha First Name Vijaya Status 769 Explanation Invalid recipient X.400 Status769 Explanation User Vijaya Narasimha/ITM/DCC/DCX (Vijaya Narasimha/ITM/DCC/DCX@wK-America) not listed in public Name Address Book E Shoemaker/ITM/DCC/DCX (Patricia E Shoemaker/ITM/DCC/DCX@wK-America) not listed in public Name Address Book ==To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST. For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST. Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Many Processes JSP from JDK Native Threads ?
I got a RH 7.1 box with the latest apache and Tomcat 3.2.2 running this morning. However, after lunch the server was seemingly dead as it would serve no pages... I know I don't have any config files attached, but ... Are there any 'commonly' misconfigured paramaters that could cause apache/tomcat to die ? After apache/tomcat starts and the 1st pages get served I noticed A LOT of processes on the server. Is this common ? !-- attached long list of processes-- root 9532 2.3 5.1 259388 13184 pts/1 S18:54 0:03 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9559 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9560 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9561 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9562 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9563 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9564 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9565 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9566 0.3 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9567 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9568 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9569 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9570 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9571 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9572 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9573 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9574 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9575 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9576 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9577 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9578 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9579 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9580 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9581 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9582 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9583 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9584 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9585 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9586 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9587 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9588 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9589 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9590 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtomcat.home=/var/ww root 9591 0.0 5.1 259388 13184 pts/1 S18:54 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java
Model Two Threads of Execution Question
Is it reasonable to assume that the thread of execution that represents a request ceases execution after the request has been fulfilled? I ask because I'd like to know if in my controller servlet I can maintain a list of currently executing requests. I imagined getting the current thread my using Thread currentThread = Thread.getCurrentThread(), adding a identifier for it to a list, and start another thread to track the current Thread's progress by using currentThread.join(). Then when the currentThread ceases executing the tracker thread removes the identifier from the list. I'm guessing that this assumes too much about the underlying Servlet/JSP container. Scott === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Re: Model Two Threads of Execution Question
Scott Evans wrote: Is it reasonable to assume that the thread of execution that represents a request ceases execution after the request has been fulfilled? I ask because I'd like to know if in my controller servlet I can maintain a list of currently executing requests. From the perspective of your servlet, it looks like the thread ceases execution. What actually happens, though, is dependent on the internals of your servlet container. For example, Tomcat recycles request processing threads so that it doesn't have to create new ones every time. For the same reason, the request and response objects themselves are also recycled. I imagined getting the current thread my using Thread currentThread = Thread.getCurrentThread(), adding a identifier for it to a list, and start another thread to track the current Thread's progress by using currentThread.join(). Then when the currentThread ceases executing the tracker thread removes the identifier from the list. I'm guessing that this assumes too much about the underlying Servlet/JSP container. It makes assumptions about the implementation that are not in the spec, so they are container specific. That sounds like "assumes too much" to me. Scott Craig McClanahan === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
Controlling Threads in Servlets/JSP
I am writing a servlet/JSP which spawns three java threads and has to wait for the 3 threads to finish processing before sending the results got from the threads to the client browser. Here a gist of what i do --- doGet method create thread1 create thread2 create thread3 start thread1 start thread2 start thread3 wait for all threads to complete. This could be a while loop While(atleast one thread is running) sleep send output back as html. --- I know this can be done in different ways using wait/notify and yield/suspend/resume etc. I would like to hear from you guys about the most efficient way to do it. Appreciate your inputs Sanjay === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". FAQs on JSP can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html
Re: Controlling Threads in Servlets/JSP
-Original Message- From: Radhakrishnan, Sanjay (c) [mailto:[EMAIL PROTECTED]] Sent: Monday, February 07, 2000 1:50 PM To: [EMAIL PROTECTED] Subject: Controlling Threads in Servlets/JSP I am writing a servlet/JSP which spawns three java threads and has to wait for the 3 threads to finish processing before sending the results got from the threads to the client browser. this sounds like a job for a concurrent construct called a barrier. a barrier serves as a rendezvous point for some number of threads. doug lea has an implementation of barriers in his "concurrent" package; visit http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.h tml for more info. alternatively, and less elegantly (or maybe if you don't control the nature of the threads), you could just do successive join()s on the three threads you launch. ugh. 8^) hth, p -- // Paul Holser -- mailto:[EMAIL PROTECTED] // ObjectSpace, Inc. -- http://www.objectspace.com // 14850 Quorum Dr. Ste. 500, Dallas TX 75240 USA // 972.726.4560 -- 1.800.OBJECT1 x4560 === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". FAQs on JSP can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html
use of threads in jsp pages
Hello everybody in the group. I have the following problem. I have made a jsp, This jsp page has a function call whose execution time breaks the time out of the browser that i use. In that case the page is never loaded. I think i have two solution branches: 1. Configure time out of the browser (i donĀ“t like this) 2. Launch the function called in the jsp in a separate thread. Could you help me with more details? === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". FAQs on JSP can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html
Re: Again on Threads
Sorry. 5 is the # of concurrent connections, if I read things correctly. I'm not aware of an actual thread limitation. J Thanks for your message at 05:14 PM 6/23/99 +, Elena Palanca: Thanks for your answer, but now I'm a little bit confused. My new questions are: 1) Is 5 the number of threads for every istance of a Servlet in memory? Example: I have 4 Servlets istantiated - does this mean that the maximum number of threads is 20? 2) Which is the maximum number of servlets that could be simultaneously istantiated in memory? Is this dependent from the Web Server or the Application Server or whatever? John ZukowskiFocus on Java Guide / http://java.about.com Author Java AWT Reference / Mastering Java 2 / ... jGuru Java Training by the MageLang Institute http://www.magelang.com | [EMAIL PROTECTED] - Got Java? === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JSP-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
Threads
Hi, does anybody know, how many threads the free version of Jrun is able to support concurrently? Thanks in advance. Elena begin:vcard n:Palanca;Elena tel;work:Dipartimento di Informatica di Pisa x-mozilla-html:FALSE adr:;; version:2.1 email;internet:[EMAIL PROTECTED] fn:Dott. Elena Palanca end:vcard
Re: Threads
5 Thanks for your message at 03:55 PM 6/23/99 +, Elena Palanca: Hi, does anybody know, how many threads the free version of Jrun is able to support concurrently? Thanks in advance. Elena John ZukowskiFocus on Java Guide / http://java.about.com Author Java AWT Reference / Mastering Java 2 / ... jGuru Java Training by the MageLang Institute http://www.magelang.com | [EMAIL PROTECTED] - Got Java? === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JSP-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".