public abstract class BaseKeyedObjectPool extends java.lang.Object implements KeyedObjectPool
ObjectPool.
All optional operations are implemented as throwing
UnsupportedOperationException.| Constructor and Description |
|---|
BaseKeyedObjectPool() |
| Modifier and Type | Method and Description |
|---|---|
void |
addObject(java.lang.Object key)
Not supported in this base implementation.
|
abstract java.lang.Object |
borrowObject(java.lang.Object key)
Obtain an instance from my pool
for the specified key.
|
void |
clear()
Not supported in this base implementation.
|
void |
clear(java.lang.Object key)
Not supported in this base implementation.
|
void |
close()
Does nothing this base implementation.
|
int |
getNumActive()
Not supported in this base implementation.
|
int |
getNumActive(java.lang.Object key)
Not supported in this base implementation.
|
int |
getNumIdle()
Not supported in this base implementation.
|
int |
getNumIdle(java.lang.Object key)
Not supported in this base implementation.
|
abstract void |
invalidateObject(java.lang.Object key,
java.lang.Object obj)
Invalidates an object from the pool
By contract, obj MUST have been obtained
using
borrowObject
or a related method as defined in an implementation
or sub-interface
using a key that is equivalent to the one used to
borrow the Object in the first place. |
abstract void |
returnObject(java.lang.Object key,
java.lang.Object obj)
Return an instance to my pool.
|
void |
setFactory(KeyedPoolableObjectFactory factory)
Not supported in this base implementation.
|
public void addObject(java.lang.Object key)
throws java.lang.Exception,
java.lang.UnsupportedOperationException
addObject in interface KeyedObjectPooljava.lang.Exceptionjava.lang.UnsupportedOperationExceptionpublic abstract java.lang.Object borrowObject(java.lang.Object key)
throws java.lang.Exception
KeyedObjectPoolreturnObject,
or a related method as defined in an implementation
or sub-interface,
using a key that is equivalent to the one used to
borrow the instance in the first place.borrowObject in interface KeyedObjectPoolkey - the key used to obtain the objectjava.lang.Exceptionpublic void clear()
throws java.lang.Exception,
java.lang.UnsupportedOperationException
clear in interface KeyedObjectPooljava.lang.UnsupportedOperationException - when this implementation doesn't support the operationjava.lang.Exceptionpublic void clear(java.lang.Object key)
throws java.lang.Exception,
java.lang.UnsupportedOperationException
clear in interface KeyedObjectPoolkey - the key to clearjava.lang.UnsupportedOperationException - when this implementation doesn't support the operationjava.lang.Exceptionpublic void close()
throws java.lang.Exception
close in interface KeyedObjectPooljava.lang.Exceptionpublic int getNumActive()
throws java.lang.UnsupportedOperationException
getNumActive in interface KeyedObjectPooljava.lang.UnsupportedOperationException - when this implementation doesn't support the operationpublic int getNumActive(java.lang.Object key)
throws java.lang.UnsupportedOperationException
getNumActive in interface KeyedObjectPoolkey - the keyjava.lang.UnsupportedOperationException - when this implementation doesn't support the operationpublic int getNumIdle()
throws java.lang.UnsupportedOperationException
getNumIdle in interface KeyedObjectPooljava.lang.UnsupportedOperationException - when this implementation doesn't support the operationpublic int getNumIdle(java.lang.Object key)
throws java.lang.UnsupportedOperationException
getNumIdle in interface KeyedObjectPoolkey - the keyjava.lang.UnsupportedOperationException - when this implementation doesn't support the operationpublic abstract void invalidateObject(java.lang.Object key,
java.lang.Object obj)
throws java.lang.Exception
KeyedObjectPoolborrowObject
or a related method as defined in an implementation
or sub-interface
using a key that is equivalent to the one used to
borrow the Object in the first place.
This method should be used when an object that has been borrowed
is determined (due to an exception or other problem) to be invalid.
If the connection should be validated before or after borrowing,
then the PoolableObjectFactory.validateObject(java.lang.Object) method should be
used instead.
invalidateObject in interface KeyedObjectPoolobj - a borrowed instance to be returned.java.lang.Exceptionpublic abstract void returnObject(java.lang.Object key,
java.lang.Object obj)
throws java.lang.Exception
KeyedObjectPoolborrowObject
or a related method as defined in an implementation
or sub-interface
using a key that is equivalent to the one used to
borrow the Object in the first place.returnObject in interface KeyedObjectPoolkey - the key used to obtain the objectobj - a borrowed instance to be returned.java.lang.Exceptionpublic void setFactory(KeyedPoolableObjectFactory factory) throws java.lang.IllegalStateException, java.lang.UnsupportedOperationException
setFactory in interface KeyedObjectPoolfactory - the KeyedPoolableObjectFactory I use to create new instances.java.lang.IllegalStateException - when the factory cannot be set at this timejava.lang.UnsupportedOperationException - when this implementation doesn't support the operationCopyright © 2001-2003 Apache Software Foundation. Documenation generated October 15 2014.