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

potential new method for interface ObjectPool<T>: returnAndValidateObject

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0
    • 2.0
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: