Uploaded image for project: 'Commons Pool'
  1. Commons Pool
  2. POOL-183

potential new method for interface ObjectPool<T>: returnAndValidateObject

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Labels:
      None

      Description

      Would it be possible to add a method:

      void returnAndValidateObject(T obj) throws Exception

      In general I was thinking of the following use case:

      Object o = pool.borrowObject();
      try
      {
      .........
      o.doStuff();
      .........
      pool.returnObject(o);
      }
      catch(Exception e)
      {
      // not sure what the cause is, let's make sure o is valid.
      pool.returnAndValidateObject(o);
      }

      the reason is that validation in general is an expensive operation, and enabling
      it all the time is inpractical.

      any thoughts ?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              zolyfarkas Zoltan Farkas
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: