You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Eric Jung <gr...@mailbolt.com> on 2003/12/23 10:55:13 UTC

Question about a JCP proposition

Hello,

I'd like to propose an addition to the Servlet specification
through the JCP, but thought I'd ask first on the tomcat-dev
list if anyone has seen a similar request.

There is currently no way in the Servlet spec to know the number
of bytes that have been read as a ServletRequest is being processed.
By the time Servlet.service() or Filter.doFilter() are called,
the *entire* InputStream has been read from the socket.

But what if one is trying to implement certain behavior after every
n bytes have been consumed? There is presently no way to do this
without writing a custom Servlet Container (or extending Coyote).

Likewise, the same holds true for knowing the number of bytes that
have been written to an OutputStream in "real-time."

I believe these capabilities can be supported with the addition of
one new EventListener interface, something like:

  public interface javax.servlet.ServletStreamListener {

    /**
     * Called repeatedly by the Servlet container
     * after n bytes have been read/written to/from a ServletRequest
     * or ServletResponse, where n is the integer returned by
     * getCallbackThreshold().
     */
    public void thresholdReached();


    /**
     * The number of bytes to read/write before calling
     * thresholdReached().
     */
    public int getCallbackThreshold();

  }

Has anyone seen this kind of specification request made before? I'd
rather not waste the time of JSR154/JCP if this is a common request that
has been previously shot down.

Thank you,

Eric H. Jung
ejung@russellmellon.com


-- 
http://www.fastmail.fm - IMAP accessible web-mail

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: Question about a JCP proposition

Posted by mahadevan iyer <ma...@yahoo.com>.
no answer??

=====
A.Mahadevan

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org