|
View:
New views
20 Messages
—
Rating Filter:
Alert me
|
| < Prev | 1 - 2 - 3 - 4 | Next > |
|
|
Re: [mina] Refactoring MINA IoFilterChain (Was: IoFilters: DIRMINA-121 / 122)2005/11/15, Irving, Dave <dave.irving@...>:
No problem. I don't feel bad at all. We're all here to make MINA the best network application framework as you know. I think we can even beat ACE in the near future ;) Cheers, Trustin what we call human nature is actually human habit -- http://gleamynode.net/ |
|
|
|
|
|
|
|
|
Re: [mina] Refactoring MINA IoFilterChain (Was: IoFilters: DIRMINA-121 / 122)Jose Alberto Fernandez wrote:
>>From: Irving, Dave [mailto:dave.irving@...] >> >>It kind of boils down to a few points: >> >>1) We want to chain "sequences" of filters (a filter chain) together >> >> > >Ok, why is it that we want to do this? What is it that we are trying to >solve? > > port-specific chains let me explain what it is I want to do. I have a POP3Handler which implements a POP3 server. I want to configure this using Spring. Thanks to the Spring integration code which now is in Mina I can do that. Then we wanted to support SSL connections. Ideally the same POP3Handler could be used and depending on the port an SSLFilter will be applied or not. Since I'm still using Spring it would be very nice if I could configure this without having to add any additional code to POP3Handler. This isn't possible today since there are no port-specific filter chains in Mina at the moment. My current workaround involves code in POP3Handler which checks the local address of a new connection in sessionCreated and if it is 995 (the POP3S port) an SSLFilter instance will be added to the session's filter chain. I would like to do this in my Spring context XML file without my POP3Handler having to know about it. It will reduce complexity and POP3Handler could concentrate on what it is supposed to do without having to worry about configuration. The workaround kind of defeats one of the motivations behind using the DI-pattern in the first place. /Niklas Niklas Therning
www.spamdrain.net |
|
|
|
|
|
Re: [mina] Refactoring MINA IoFilterChain (Was: IoFilters: DIRMINA-121 / 122)Jose Alberto Fernandez wrote:
>>From: Irving, Dave [mailto:dave.irving@...] >> >> >> >> >>>>It kind of boils down to a few points: >>>> >>>>1) We want to chain "sequences" of filters (a filter chain) >>>> >>>> >together > > >>>Ok, why is it that we want to do this? What is it that we are trying >>> >>> >>to solve? >> >>One motivation is that concrete chain implementations currently >> >> >specify > > >>"end of chain" behaviour (e.g: SocketSessionManagerFilterChain, >>DatagramSessionManagerFilterChain etc). >>When we were originally looking at implementing 121 / 122, Niklas >>suggested that it would be nice to refactor this - and I agree - as it >>makes it more difficult to chain arbitrary filter chains in to longer >>chains. >> >> > >Why is it that we want to chain arbitrary filter chains into longer >chains? >It seems that the reason for the requirement is the requirement itself. >But what is the reason for it? > >I may be mistaken, but it seems to me the whole reason for this is to be >able, eventually, to specify a chain in a spring based model and set it >up during configuration. Am I off the mark here? > >Wouldn't it be simpler (or less disruptive) to simply configure some >other object (lets say a ChainBuilder) with all the filters one >requires, and during execution (the call to build) it will just add all >the filters to the chain programmatically. No need to re-engineer >everything just one smart spring aware builder. > >Would this solve any of the user patterns we are trying to deal with in >here? > > > AbstractIoAcceptorFactoryBean. I think it would require a proxy for the real IoHandler which intercepts sessionCreated() and simply adds the appropriate port-specific filters to the session's filter chain before forwarding to the real IoHandler. It's not a bad idea at all and I might do it that way in the meantime. Thanks for pointing that out! :) But I also think that the refactoring Dave is working on will make the code simpler to understand/maintain and give more flexibilty. Let's see what he comes up with and take it from there. /Niklas Niklas Therning
www.spamdrain.net |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: [mina] Refactoring MINA IoFilterChain (Was: IoFilters: DIRMINA-121 / 122)Jose Alberto Fernandez wrote:
>>From: Irving, Dave [mailto:dave.irving@...] >> >> >>As per Niklas' email, we'll need to support a combined sessionManager >>chain, port chain and connection chain. >>Is there a clean way to do this that I've missed? Im certainly not >>interested in doing work for works sake :o) >> >> >> > >My understanding of Niklas e-mail was that his main reason WAS spring. > > to configure port-specific chains and still separate configuration from use. This is what dependency injection (not only Spring) is all about. I could as you pointed out have AbstractIoAcceptorFactoryBean make this happen. But it would be more or less a hack, something I could live with as a temporary solution but not in the long run. > > >>I think the refactoring we are talking about is not related to spring >>configuration per-se. In all cases, the three layers of chains will be >>available to be populated by a builder or whatever. The problem we are >>solving, as far as I can tell, is how to have re-usable chains of >>filters (sessionManager, port, session) cleanly and efficiently (i.e, >>not having to clone). >> >> >> > >As long as you have addBefore/addAfter (which exist on 0.8, not sure >about 0.9) you will have to clone, as the filter chain is mutable. The >best you can do is to implement lazy copy. I do not see a real way out >of it. > > > >>Niklas wants to specify re-usable port chains, and presumably its >>helpful to be able to specify re-usable session manager level chains >>(acceptor / connector). The problem to solve is how to cleanly hook >>these chains together. >>It seems that the proposed refactoring is quite a simple and >> >> >transparent > > >>way of doing this - but if I've missed an existing easy and clean way >> >> >to > > >>do this - please let me know - as I don't want to head down the wrong >>path! >> >> > >So what happens when I call IoFilterChain.addFirst() on >sessionCreated(). As I said the best you can do is lazy copy. > > still be the session private chain. Just like it always has been. Chains won't be copied and you won't be able to change the port-specific or sessionmanager-specific chain by calling session.getFilterChain().addFirst() or whatever. Bottom line: From a user perspective nothing will change. There will be the extra opportunity to add a port-specific filter chain when you bind an IoHandler to a port. Nothing more nothing less. /Niklas Niklas Therning
www.spamdrain.net |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Yall need your own list (was: Re: [mina] Refactoring MINA IoFilterChain (Was: IoFilters: DIRMINA-121 / 122))Looks like the traffic is picking up on MINA and things are heating up
as we approach 1.0. Initially my thought was to get a separate list for MINA however I'm thinking it might be best to just see if we can promote MINA to a TLP. It has out grown its place in directory and many projects will depend on it. It makes sense to me to see it acquire a life of its own. There's a good sized community brewing around MINA. I'd like to see more people come forth as committers then see if we can get a proposal before the ASF board on budding off the MINA project. IMHO this is better than creating a separate mailing list. Right now it would be good to see who favorrs this? Any comments or for or against this idea? How about a little poll: [ ] +1 MINA should become its own TLP at Apache [ ] +0/0/-0 Maybe later, or let's get a separate mailing list for now etc. [ ] -1 MINA should remain at Directory as is Alex |
|
|
|
|
|
|
| < Prev | 1 - 2 - 3 - 4 | Next > |
| Free embeddable forum powered by Nabble | Forum Help |