I would like to create a HAObjectPoolProxy that will be a proxy for a two standalone object pools. The problem with ObjectPoolProxy is that the client should be able to return the object back to the correct pool.
The question I have is does JBoss already have a similar proxy and if it does how does it work. Does the proxy keep the state of what was given out and from where, so it can return it back to the pool, or does the proxy return to the client a complex object containing the result together with the source where it came from so the client can return the object itself to the correct pool? If the second is the case, should the client return an object directly or via the proxy?
What do you guys think? How should HAObjectPoolProxy be designed?