-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I use Thread in filters together with PipedInputStream/-OutputStream.
An example is an XSLT-Transformer filter, the filter needs to provide a (Servlet)OuputStream (and a Writer) to the filter-chain and an InputStream (wrapped in a javax.xml.transform.stream.StreamSource) to the Transformer: I pass a PipedOutputStream (wrapped to be a ServletOutputStream) to the filter-chain and pass the connected PipedInputStream to the Transformer. I see no alternative to invoking the Transform-method in a new Thread before calling chain.doFilter(..) (OK, an alternative would be to use a ByteArrayOuputStream but ...).
Cheers, reto
Zerbe John W wrote:
| With the introduction of EJB 2.0 Message Driven Beans, you no longer need to start and manage your own threads to do asynchronous processing. | | While the answer to the original question is "yes", the recommendation is no. By creating your own threads, you're making the container's job more difficult, especially if you are using container managed resources from those threads. | | Example: You create a security context for your thread in order to use a java Connector, or to call an ejb. | If that is not a "container managed" thread, the container may not know how to clean up those resources when either they "time out", or the thread ends. | | If you have the option to use MDBs, you can configure the number of container managed threads available to the JMS listener to invoke MDB instances. The transaction management, security, and threading are now the container's responsibility. | | | -----Original Message----- | From: A mailing list for discussion about Sun Microsystem's Java Servlet | API Technology. [mailto:[EMAIL PROTECTED] Behalf Of Endre | Stølsvik | Sent: Tuesday, May 18, 2004 10:25 AM | To: [EMAIL PROTECTED] | Subject: Re: Thread Question | | | On Tue, 18 May 2004, Zerbe John W wrote: | | | Why do you think you need to start threads in a J2EE application? | | This is "-SERVLET- interest".. So I presume he's talking about servlets. | Yes, he is. | | The answer to the original question is most probably "yes". | | Endre | | | | | -----Original Message----- | | From: A mailing list for discussion about Sun Microsystem's Java Servlet | | API Technology. [mailto:[EMAIL PROTECTED] Behalf Of | | Karthikeyan | | Sent: Tuesday, May 18, 2004 4:46 AM | | To: [EMAIL PROTECTED] | | Subject: Thread Question | | | | | | Hi all, | | | | I want to create 10 threads for an Object. If it exceed 10 threads | | then I want to create new instance of that Object. | | | | Is it possible in servlet. | | | | Have a great day. | | | | Karthikeyan B | | | | ___________________________________________________________________________ | To unsubscribe, send email to [EMAIL PROTECTED] and include in the body | of the message "signoff SERVLET-INTEREST". | | Archives: http://archives.java.sun.com/archives/servlet-interest.html | Resources: http://java.sun.com/products/servlet/external-resources.html | LISTSERV Help: http://www.lsoft.com/manuals/user/user.html | | The information contained in this e-mail may be confidential and is intended solely for the use of the named addressee. | Access, copying or re-use of the e-mail or any information contained therein by any other person is not authorized. | If you are not the intended recipient please notify us immediately by returning the e-mail to the originator.(A) | | ___________________________________________________________________________ | To unsubscribe, send email to [EMAIL PROTECTED] and include in the body | of the message "signoff SERVLET-INTEREST". | | Archives: http://archives.java.sun.com/archives/servlet-interest.html | Resources: http://java.sun.com/products/servlet/external-resources.html | LISTSERV Help: http://www.lsoft.com/manuals/user/user.html |
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFAqkWeD1pReGFYfq4RAtMOAKCU9yFwLLNqNxFNmtU4+a2zO6xIoQCgsG/7 8tkfF/sfHlBxTay0/J41ons= =v841 -----END PGP SIGNATURE-----
___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html