Thrift
  1. Thrift
  2. THRIFT-957

THsHaServer: Change access modifier of the invoker field.

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.6, 0.7
    • Fix Version/s: 0.6
    • Component/s: Java - Library
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      I would like to subclass the THsHaServer so that I can override the protected requestInvoke method. I need to implement my own Runnable using the invoker.

      This is hard to do cleanly without the ability to access the invoker field.

      1. THRIFT-957.patch
        1 kB
        Benjamin Coverston

        Activity

        Hide
        Bryan Duxbury added a comment -

        I just committed this with some cosmetic improvements. Thanks for the patch!

        Show
        Bryan Duxbury added a comment - I just committed this with some cosmetic improvements. Thanks for the patch!
        Hide
        Benjamin Coverston added a comment -

        Added a patch taking into account Brian's suggestion of exposing a way to set the runnable through a protected method.

        Show
        Benjamin Coverston added a comment - Added a patch taking into account Brian's suggestion of exposing a way to set the runnable through a protected method.
        Hide
        Bryan Duxbury added a comment -

        What if we made a new overridable method that let you create the Runnable, then? I think that's preferable to exposing the executor to subclasses.

        Show
        Bryan Duxbury added a comment - What if we made a new overridable method that let you create the Runnable, then? I think that's preferable to exposing the executor to subclasses.
        Hide
        Benjamin Coverston added a comment -

        Modified this work item s.t. it only applies to unreleased versions (trunk).

        Clarified (somewhat) that I intend to use the executor service that is already present in the THsHaServer (the invoker field).

        Show
        Benjamin Coverston added a comment - Modified this work item s.t. it only applies to unreleased versions (trunk). Clarified (somewhat) that I intend to use the executor service that is already present in the THsHaServer (the invoker field).
        Hide
        Benjamin Coverston added a comment -

        The executor service is the class that I specifically don't want to rewrite. I want to use the executor service that is already there. I can't effectively do that in my overridden class unless unless that variable is protected. Otherwise I agree, if I were going to write my own executor service I wouldn't need this done at all.

        Show
        Benjamin Coverston added a comment - The executor service is the class that I specifically don't want to rewrite. I want to use the executor service that is already there. I can't effectively do that in my overridden class unless unless that variable is protected. Otherwise I agree, if I were going to write my own executor service I wouldn't need this done at all.
        Hide
        Bryan Duxbury added a comment -

        Out of curiosity, if you're going to go as far as implementing your own runnables and executor service, why not subclass TNonblockingServer?

        Show
        Bryan Duxbury added a comment - Out of curiosity, if you're going to go as far as implementing your own runnables and executor service, why not subclass TNonblockingServer?

          People

          • Assignee:
            Benjamin Coverston
            Reporter:
            Benjamin Coverston
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 2h
              2h
              Remaining:
              Remaining Estimate - 2h
              2h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development