[
https://issues.apache.org/jira/browse/POOL-301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14697932#comment-14697932
]
Phil Steitz edited comment on POOL-301 at 8/14/15 11:51 PM:
------------------------------------------------------------
A comment I forgot to add in the modification to BaseProxyHandler. The setup
there is not thread-safe. If intercepted methods are concurrently executed on
the same pooled object, the before and after methods may get interleaved.
Also, the interceptors themselves need to be threadsafe and able to handle
interleaved invocation across pooled objects. The example handles this. I
would expect most interceptors to just implement one of before/after.
was (Author: psteitz):
A comment I forgot to add in the modification to BaseProxyHandler. The setup
there is not thread-safe. If intercepted methods are concurrently executed on
the same pooled object, the before and after methods may get interleaved.
Also, the interceptors themselves need to be threadsafe and able to handle
interleaved invocation across pooled objects.
> Add interceptors to proxied pools
> ---------------------------------
>
> Key: POOL-301
> URL: https://issues.apache.org/jira/browse/POOL-301
> Project: Commons Pool
> Issue Type: Improvement
> Affects Versions: 2.0, 2.1, 2.2, 2.3
> Reporter: Phil Steitz
> Attachments: interceptors.patch
>
>
> The proxied pools in org.apache.commons.pool2.proxy have some built-in
> support for some method interceptor functions (e.g. calling use() to prevent
> reset abandoned timers for objects that implement UsageTracking). Support
> might be added for configurable interceptors that could be user-supplied.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)