MINA
  1. MINA
  2. DIRMINA-635

The IoFilter.preAdd method should take an IoSession argument

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-M3
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      When injected an ProtocolCodecFilter in a chain when a session is already created, the encoder and decoder are never injected into the session's attribute, leading to NPE.

      This could be fixed if we create those objects during the preAdd() phase, but we need to pass the session to this preAdd method. Anyway, it makes sense, as we may want to update some session's attribute during the addition, just in case.

        Activity

        Show
        Emmanuel Lecharny added a comment - Fixed with : http://svn.apache.org/viewvc?rev=713125&view=rev
        Hide
        Emmanuel Lecharny added a comment -

        The preAdd method takes a IoFilterChain as a first argument, which has a getSession() method, so there is no need to pass a IoSession.

        It will then be easy to modify the preAdd method to initialize the encoder and decoder there, instead of doing so in the sessionCreated() method.

        Also we have to do it in both case, as the preAdd method is not called when the filter is added in the chain outside of the session.

        Show
        Emmanuel Lecharny added a comment - The preAdd method takes a IoFilterChain as a first argument, which has a getSession() method, so there is no need to pass a IoSession. It will then be easy to modify the preAdd method to initialize the encoder and decoder there, instead of doing so in the sessionCreated() method. Also we have to do it in both case, as the preAdd method is not called when the filter is added in the chain outside of the session.

          People

          • Assignee:
            Emmanuel Lecharny
            Reporter:
            Emmanuel Lecharny
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development