what would the chain do if you add a filter with the same name as a
filter already in the chain?

1. throw exception
2. not add the filter
3. overwrite the existing filter
4. have the chain rename the filter

--
..Cheers
Mark


On 4/30/07, Trustin Lee <[EMAIL PROTECTED]> wrote:
On 4/29/07, peter royal <[EMAIL PROTECTED]> wrote:
> On Apr 27, 2007, at 3:09 AM, Trustin Lee wrote:
> > On 4/27/07, peter royal <[EMAIL PROTECTED]> wrote:
> >> Compute a static string upon class construction? append the class's
> >> hashcode to the attribute? that should make it unique.
> >
> > We can do that if an IoFilter is supposed to belong to one session.
> > That might make more sense because most filters needs to store some
> > state.  Is this what you thought?
>
> Maybe I'm confused on what's being solved.. But we want to be able to
> add multiple instances of the same IoFilter class? One of ours that
> uses fixed attribute names?

Yes.  All filters use fixed attribute names IIRC.

> Since a class instance will only be in a single filter chain once
> (even if its used for multiple sessions), if the filter appended a
> number to its attributes, such as its hashcode, that'd provide
> uniqueness?

We might need to allow the same instance of IoFilter to be inserted
more than once to one filter chain, which makes hashcode useless.
Logging filter is a good example.  A user can insert the same logging
filter instance before and after the codec filter for debugging
purpose.

Hmmm... but just adding small restriction (i.e. no same filter
instances in a chain) might make things much easier.  :D

WDYT?

Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Reply via email to