+1 for #1. I think this option makes the most sense. -Mike
Trustin Lee wrote: > Hi community, > > Currently, MINA 2.0.0-M1-SNAPSHOT doesn't allow a user to call > setLocalAddresses() after IoAcceptor.bind() is called. To change the > local addresses, a user have to unbind, change the localAddresses > property and bind again, which is not very convenient and causes > interruption of service. > > MINA 1.x doesn't have this problem because user always specify the > local address and the IoHandler for each bind() call and the local > address for each unbind() (or unbindAll()). > > However, considering an IoService is a logical group of managed > sessions with the same business logic, specifying IoHandler for every > bind() call doesn't make sense. That's why we removed handler > parameter from bind() method. One mistake I've made at the moment of > the change is that I also removed the local address parameter from the > bind() method. I'd like to know what change do you prefer. Let me > list my idea: > > 1) Change localAddress(es) to represent the list of the currently > bound addresses. Add defaultLocalAddress(es) property, which is used > when bind() method is called with no parameter. Also add > bind(localAddress), unbind(localAddress) and unbindAll() methods. > > 2) Retain the current trunk API and let setLocalAddresses() method > decide what address to bind and what address to unbind. > > I think the first solution is better because A) it resembles the 1.x > API, 2) is easy to understand and 3) IoConnector already has the > similar API design: > * > http://mina.apache.org/report/trunk/apidocs/org/apache/mina/common/IoConnector.html > (defaultRemoteAddress) > > What do you think about the suggested changes? Any feed back or whole > new idea is appreciated. If there's no objection within next 72 > hours, I will execute the idea #1. > > Thank in advance, > Trustin
