Created
February 13, 2019 14:20
-
-
Save need4spd/d77dbc7a6bda0dd07eafaa4a5a1700c6 to your computer and use it in GitHub Desktop.
MyPoolableObjectFactory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.commons.pool2.BasePooledObjectFactory; | |
import org.apache.commons.pool2.PooledObject; | |
import org.apache.commons.pool2.impl.DefaultPooledObject; | |
public class MyPoolableObjectFactory extends BasePooledObjectFactory<MyPoolableObject> { | |
@Override | |
public MyPoolableObject create() { | |
return new MyPoolableObject(); | |
} | |
@Override | |
public PooledObject<MyPoolableObject> wrap(MyPoolableObject myPoolableObject) { | |
return new DefaultPooledObject<>(myPoolableObject); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment