01: /*
02: * Licensed under the X license (see http://www.x.org/terms.htm)
03: */
04: package org.ofbiz.minerva.pool;
05:
06: /**
07: * Optional interface for an object in an ObjectPool. If the objects created
08: * by the ObjcetFactory implement this, the pool will register as a listener
09: * when an object is checked out, and deregister when the object is returned.
10: * Then if the object sends a close or error event, the pool will return the
11: * object to the pool without the client having to do so explicitly.
12: *
13: * @author Aaron Mulder (ammulder@alumni.princeton.edu)
14: */
15: public interface PooledObject {
16:
17: /**
18: * Adds a new listener.
19: */
20: public void addPoolEventListener(PoolEventListener listener);
21:
22: /**
23: * Removes a listener.
24: */
25: public void removePoolEventListener(PoolEventListener listener);
26: }
|