Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D9146C539 for ; Wed, 6 Jun 2012 19:47:25 +0000 (UTC) Received: (qmail 70612 invoked by uid 500); 6 Jun 2012 19:47:22 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 70530 invoked by uid 500); 6 Jun 2012 19:47:22 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 70517 invoked by uid 99); 6 Jun 2012 19:47:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jun 2012 19:47:22 +0000 X-ASF-Spam-Status: No, hits=2.9 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [212.227.17.9] (HELO moutng.kundenserver.de) (212.227.17.9) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jun 2012 19:47:16 +0000 Received: from oxbaltgw07.schlund.de (oxbaltgw07.schlund.de [172.19.246.13]) by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis) id 0MNcni-1Sdzoy1itW-0079Ov; Wed, 06 Jun 2012 21:46:54 +0200 Date: Wed, 6 Jun 2012 20:46:54 +0100 (BST) From: "smillidge@c2b2.co.uk" Reply-To: "smillidge@c2b2.co.uk" To: Tomcat Users List , Mark Thomas Message-ID: <320206308.264096.1339012014540.JavaMail.open-xchange@email.1and1.co.uk> In-Reply-To: <4FCFA485.1090201@apache.org> References: <017901cd4403$089d9c70$19d8d550$@c2b2.co.uk> <4FCFA485.1090201@apache.org> Subject: Re: getting frustrated with web sockets MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_264095_995670617.1339012014492" X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v- X-Provags-ID: V02:K0:7d7PvaF5kHnczfu/5UXypi5wBl+lfn2bNSFJzi1nJRU aPsO9P8wXGp8f3QV1bYNbES4vCpo42yg0H/RoAsHIDbobDzK3k iRdkIcc8tHWqYlIIarBv1D1WdyDhQAJvOKKzlrCJH+0ETPHbYp 1IlGbkmkgcJUvrM2NTXS1MWPG3hMCEizKJPmORIS1bDxjWMONW LPweGpqHRr21wEbgaFh3kDSocbEKvuEV3UAt4oJeDvxbZxY9DG mnTgJWMy8lqlA2a7b1U4GV6IYysDZo2TFs56oaT1ZGPTR2VNiC oA8385WazXrCqy3dLrqXWTiBPtJiX7SMef3LEP0LR0W4eJqety /GDGf8unxr9YdFXs4PL7m0y7021Oeo9AczHEF1KD3Xio8bDzVT ajFMcFCkIHGeyz92tCXwOb9yCCYbuouIdGet4+W7j29yXGA145 bQRFT X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_264095_995670617.1339012014492 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thinking off the top of my head. How about passing in an unmodifiable map o= f the session attributes to give some context to the creation of the MessageInbou= nd class? Hmm however then some bright spark will probably want the URL and the reque= st parameters, then the cookies etc. of the initiating HTTP request. I assume the JSR 356 expert group is grappling with this question as well. Steve On 06 June 2012 at 19:42 Mark Thomas wrote: > On 06/06/2012 17:40, Steve Millidge wrote: > > Mark, > > > >=20 > > > > I think it would be useful to get access to the session at least when y= ou > > are bootstrapping the web socket and creating the MessageInBound subcla= ss > > instance. It is very likely that a user will have accessed a web applic= ation > > and logged in etc. prior to bootstrapping the websocket connection. > > Therefore there's likely to be a whole bunch of useful context informat= ion I > > want in my MessageInbound class when I create it. > > > > Looking at the code it would be a simple change to pass Session into th= e > > createWebSocketInbound(String subProtocol) call. > > I'd rather not pass in the session object since it just encourages folks > to retain a copy of it and I am not at all convinced that is a good idea > for WebSockets. > > I have no objection to making session attributes available at that point > (or data from the request) but I don't like the idea of providing direct > access to the Request and Session objects. Neither do I like the idea of > having to proxy every getter... > > Hmm. We could wrap them with a fa=C3=A7ade and null out the underlying > objects once the HTTP request ends to "discourage" folks from retaining > references to them since all they'll get is NPEs. > > > Any chance we can get it added as a parameter, otherwise I'll have to h= ack > > about with thread locals in the subclass of WebSocketServlet. > > If the above seems reasonable then that is probably doable with the > caveat I haven't thought too hard about it at this point. > > Mark > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > ------=_Part_264095_995670617.1339012014492--