Message from discussion
Issue 635 in google-guice: GuiceFilter uses wrong instance of FilterPipeline if used with multiple servlet context and multiple injectors
Received: by 10.101.116.9 with SMTP id t9mr3193889anm.19.1308661682828;
Tue, 21 Jun 2011 06:08:02 -0700 (PDT)
X-BeenThere: google-guice-dev@googlegroups.com
Received: by 10.100.12.13 with SMTP id 13ls1454765anl.2.gmail; Tue, 21 Jun
2011 06:08:02 -0700 (PDT)
Received: by 10.101.192.27 with SMTP id u27mr3132244anp.21.1308661682059;
Tue, 21 Jun 2011 06:08:02 -0700 (PDT)
Received: by 10.101.192.27 with SMTP id u27mr3132243anp.21.1308661682040;
Tue, 21 Jun 2011 06:08:02 -0700 (PDT)
Return-Path: <3sZcATgwOAFg6EE6B4-6K8246EE6B42E34....@codesite.bounces.google.com>
Received: from mail-gy0-f203.google.com (mail-gy0-f203.google.com [209.85.160.203])
by gmr-mx.google.com with ESMTPS id v1si3215anh.2.2011.06.21.06.08.02
(version=TLSv1/SSLv3 cipher=OTHER);
Tue, 21 Jun 2011 06:08:02 -0700 (PDT)
Received-SPF: pass (google.com: domain of 3sZcATgwOAFg6EE6B4-6K8246EE6B42E34....@codesite.bounces.google.com designates 209.85.160.203 as permitted sender) client-ip=209.85.160.203;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of 3sZcATgwOAFg6EE6B4-6K8246EE6B42E34....@codesite.bounces.google.com designates 209.85.160.203 as permitted sender) smtp.mail=3sZcATgwOAFg6EE6B4-6K8246EE6B42E34....@codesite.bounces.google.com
Received: by mail-gy0-f203.google.com with SMTP id 4so515404gyg.4
for <google-guice-dev@googlegroups.com>; Tue, 21 Jun 2011 06:08:02 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.224.17.211 with SMTP id t19mr6233242qaa.16.1308661681863; Tue,
21 Jun 2011 06:08:01 -0700 (PDT)
Reply-To: codesite-nore...@google.com
X-Generated-By: Google Code
X-GoogleCode-Project: google-guice
X-GoogleCode-Issue-Id: 635
References: <21-1492727805935382846-3197605416504241051-google-guice=googlecode.com@googlecode.com>
<0-1492727805935382846-3197605416504241051-google-guice=googlecode.com@googlecode.com>
In-Reply-To: <21-1492727805935382846-3197605416504241051-google-guice=googlecode.com@googlecode.com>
Message-ID: <22-1492727805935382846-3197605416504241051-google-guice=googlecode.com@googlecode.com>
Date: Tue, 21 Jun 2011 13:08:01 +0000
Subject: Re: Issue 635 in google-guice: GuiceFilter uses wrong instance of
FilterPipeline if used with multiple servlet context and multiple injectors
From: google-gu...@googlecode.com
To: google-guice-dev@googlegroups.com
Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes
Comment #22 on issue 635 by mccu...@gmail.com: GuiceFilter uses wrong
instance of FilterPipeline if used with multiple servlet context and
multiple injectors
http://code.google.com/p/google-guice/issues/detail?id=635
> Keeping separation of concerns in mind, can you please explain what
> GuiceFilter
> and GuiceServletContextListener are meant to do, independently of one
> another?
I believe I answered this in an earlier comment (note: its just my personal
view, I didn't design these classes)
* GuiceFilter is responsible for filtering requests/responses by using the
pipeline(s) injected into it
* GuiceServletContextListener is responsible for creating injectors
on-demand that inject pipelines
So while there is a link between the two - one creates injectors, the other
expects pipeline(s) to be injected - they could conceivably work
independently, in that you could put in your own Filter implementation that
just used the injector created and stashed in the context by the listener.
Or you could write your own listener that used a different pipeline
implementation (assuming the FilterPipeline type was opened up as in my
patch).
Conversely, why should these classes be combined? They implement different
interfaces that have no relation or reference to each other in the servlet
spec, so combining them is imho purely an implementation detail to avoid a
little bit of indirection.