Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 8979 invoked from network); 11 Aug 2006 16:38:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Aug 2006 16:38:22 -0000 Received: (qmail 68212 invoked by uid 500); 11 Aug 2006 16:38:16 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 68157 invoked by uid 500); 11 Aug 2006 16:38:16 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 68144 invoked by uid 99); 11 Aug 2006 16:38:16 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Aug 2006 09:38:16 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [206.123.111.90] (HELO mail.loukasmgmt.com) (206.123.111.90) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Aug 2006 09:38:15 -0700 Received: (qmail 21851 invoked by uid 510); 11 Aug 2006 11:37:54 -0500 Received: from unknown (HELO ?192.168.3.107?) (smtp@loukasmgmt.com@71.123.221.70) by mail.loukasmgmt.com with SMTP; 11 Aug 2006 11:37:54 -0500 Message-ID: <44DCB252.8010204@hanik.com> Date: Fri, 11 Aug 2006 11:37:38 -0500 From: Filip Hanik - Dev Lists User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: Tomcat Developers List Subject: Proposal - Comet changes Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Gents, I have a suggestion on a small refactor for the CometProcessor, mainly to make it a little bit more flexible, here are my suggestions 1. public void begin(HttpServletRequest request, HttpServletResponse response) Suggestion - remove this method, its never called from the container anyway, so there is no need to require the implementation 2. public void end(HttpServletRequest request, HttpServletResponse response) Suggestion - remove this method, its never called from the container, same logic as above 3. public boolean read(HttpServletRequest request, HttpServletResponse response) Suggestion - change this method to public boolean event(CometEvent event) This will allow the container to implement notifications for timeouts, socket close, and read events through a single channel. Easier to add future events and/or more fine grained events 4. public boolean error(HttpServletRequest request, HttpServletResponse response) Suggestion - remove this method, as it can be replaced with the event method. If we do want to keep this method, lets include a little bit more info about the error, is it a timeout or a socket close, or an in process exception etc 5. CometEvent public class CometEvent { public enum EventType { READ,TIMEOUT,SOCKET_CLOSE,CONTAINER_SHUTDOWN,CONTEXT_SHUTDOWN,GENERIC_ERROR //and anything else, we could also create groups of types, READ,ERROR,SHUTDOWN, with subtypes } public HttpServletRequest getRequest(); public HttpServletResponse getResponse(); ...and other useful info here } I believe this would allow for more flexibility in the future and a cleaner interface. The CometServlet can actually stay exactly the same, if need be, as the begin,end methods can be called based on service() and event() Filip --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org