public static class TestJdk14ObjectPool.ResourceFactory extends Object implements ObjectFactory
| 限定符和类型 | 字段和说明 |
|---|---|
private static AtomicInteger |
seq |
| 构造器和说明 |
|---|
ResourceFactory() |
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
createObject()
Create object if unavaliable
|
void |
destroyObject(Object o)
Release the pooled object and remove it from the pool.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittestObjectprivate static final AtomicInteger seq
public Object createObject() throws Exception
ObjectFactorycreateObject 在接口中 ObjectFactoryExceptionpublic void destroyObject(Object o) throws Exception
ObjectFactorydestroyObject 在接口中 ObjectFactoryExceptionCopyright © 2021. All rights reserved.