Uploaded image for project: 'Smack'
  1. Smack
  2. SMACK-632

Make Smack interruptible

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.6
    • Fix Version/s: 4.2.0
    • Component/s: Core, TCP
    • Labels:
    • Expected Effort:
      Medium

      Description

      For example Smack sendX() and PacketCollector.pollX() should throw InterruptedException.

      If a thread which is currently blocking in Smack's send queue put() is interrupted then Smack 4.1 currently swallows the exception. Instead it should be thrown to that users are able to interrupt threads that are waiting in put(). Same goes for packet collector's blocking method calls and also SynchronizationPoint and Roster.waitUntilLoaded(). Basically in most places where Smack currently swallows an InterruptedException ('ag InterruptedException smack') those should be thrown instead of swallowed.

      Scheduling for 4.2 since this is a rather big API change.

      Open Question: Should Smack throw InterruptedException directly or should we wrap InterruptedException into a SmackInterruptedException? Some APIs already throw SmackException (e.g. MultiUserChat.create()), some not e.g. Roster.createEntry()). I guess the right way would be to throw InterruptedException directly, although it does bloat the API a bit. But OTOH the additional exception can be handled by the user very well with try/multi-catch.

      See TODO comment in XMPPTCPConnection.sendStreamElement()

      Motivation was mostly http://www.ibm.com/developerworks/library/j-jtp05236/

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              flow Florian Schmaus
              Reporter:
              flow Florian Schmaus
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: