moved ObjectPool from the util package (it's now in it's own). Added ObjectPool.getVersion()
This commit is contained in:
parent
2f50b02df8
commit
eb45aa15f3
|
@ -44,7 +44,7 @@ Usage:
|
|||
<dependency>
|
||||
<groupId>com.dorkbox</groupId>
|
||||
<artifactId>ObjectPool</artifactId>
|
||||
<version>1.8</version>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
|
@ -55,3 +55,6 @@ https://oss.sonatype.org/content/repositories/releases/com/dorkbox/ObjectPool/
|
|||
<h2>License</h2>
|
||||
|
||||
This project is distributed under the terms of the Apache v2.0 License. See file "LICENSE" for further references.
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -13,15 +13,26 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package dorkbox.util.objectPool;
|
||||
package dorkbox.objectPool;
|
||||
|
||||
import java.util.concurrent.ArrayBlockingQueue;
|
||||
|
||||
/**
|
||||
* @author dorkbox, llc
|
||||
*/
|
||||
public
|
||||
class ObjectPool<T> {
|
||||
private final ArrayBlockingQueue<T> queue;
|
||||
private final PoolableObject<T> poolableObject;
|
||||
|
||||
/**
|
||||
* Gets the version number.
|
||||
*/
|
||||
public static
|
||||
String getVersion() {
|
||||
return "2.0";
|
||||
}
|
||||
|
||||
public
|
||||
ObjectPool(PoolableObject<T> poolableObject, int size) {
|
||||
this.poolableObject = poolableObject;
|
||||
|
@ -87,3 +98,5 @@ class ObjectPool<T> {
|
|||
return queue.size();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package dorkbox.util.objectPool;
|
||||
package dorkbox.objectPool;
|
||||
|
||||
public
|
||||
abstract class PoolableObject<T> {
|
Loading…
Reference in New Issue