Changed package name. The standard package naming
convention with CamelCase is consistent across projects.
This commit is contained in:
parent
d346fad378
commit
125bd8a2fc
|
@ -13,7 +13,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package dorkbox.objectpool;
|
||||
package dorkbox.objectPool;
|
||||
|
||||
import java.util.concurrent.ArrayBlockingQueue;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
|
@ -48,6 +48,7 @@ class BlockingPool<T> extends ObjectPool<T> {
|
|||
* <p/>
|
||||
* This method catches {@link InterruptedException} and discards it silently.
|
||||
*/
|
||||
@Override
|
||||
public
|
||||
T take() {
|
||||
try {
|
||||
|
@ -60,6 +61,7 @@ class BlockingPool<T> extends ObjectPool<T> {
|
|||
/**
|
||||
* Takes an object from the pool, Blocks until an item is available in the pool.
|
||||
*/
|
||||
@Override
|
||||
public
|
||||
T takeInterruptibly() throws InterruptedException {
|
||||
final T take = this.queue.take();
|
||||
|
@ -70,6 +72,7 @@ class BlockingPool<T> extends ObjectPool<T> {
|
|||
/**
|
||||
* Return object to the pool, waking the threads that have blocked during take()
|
||||
*/
|
||||
@Override
|
||||
public
|
||||
void put(T object) {
|
||||
poolableObject.onReturn(object);
|
||||
|
@ -79,6 +82,7 @@ class BlockingPool<T> extends ObjectPool<T> {
|
|||
/**
|
||||
* @return a new object instance created by the pool.
|
||||
*/
|
||||
@Override
|
||||
public
|
||||
T newInstance() {
|
||||
return poolableObject.create();
|
|
@ -13,7 +13,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package dorkbox.objectpool;
|
||||
package dorkbox.objectPool;
|
||||
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
|
@ -41,6 +41,7 @@ class NonBlockingPool<T> extends ObjectPool<T> {
|
|||
/**
|
||||
* Takes an object from the pool, Blocks until an item is available in the pool.
|
||||
*/
|
||||
@Override
|
||||
public
|
||||
T take() {
|
||||
T take = this.queue.poll();
|
||||
|
@ -57,6 +58,7 @@ class NonBlockingPool<T> extends ObjectPool<T> {
|
|||
* <p/>
|
||||
* This method catches {@link InterruptedException} and discards it silently.
|
||||
*/
|
||||
@Override
|
||||
public
|
||||
T takeInterruptibly() throws InterruptedException {
|
||||
return take();
|
||||
|
@ -65,6 +67,7 @@ class NonBlockingPool<T> extends ObjectPool<T> {
|
|||
/**
|
||||
* Return object to the pool, waking the threads that have blocked during take()
|
||||
*/
|
||||
@Override
|
||||
public
|
||||
void put(T object) {
|
||||
poolableObject.onReturn(object);
|
||||
|
@ -74,6 +77,7 @@ class NonBlockingPool<T> extends ObjectPool<T> {
|
|||
/**
|
||||
* @return a new object instance created by the pool.
|
||||
*/
|
||||
@Override
|
||||
public
|
||||
T newInstance() {
|
||||
return poolableObject.create();
|
|
@ -13,7 +13,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package dorkbox.objectpool;
|
||||
package dorkbox.objectPool;
|
||||
|
||||
import java.lang.ref.SoftReference;
|
||||
import java.util.Queue;
|
||||
|
@ -41,6 +41,7 @@ class NonBlockingSoftPool<T> extends ObjectPool<T> {
|
|||
/**
|
||||
* Takes an object from the pool.
|
||||
*/
|
||||
@Override
|
||||
public
|
||||
T take() {
|
||||
T obj;
|
||||
|
@ -60,6 +61,7 @@ class NonBlockingSoftPool<T> extends ObjectPool<T> {
|
|||
/**
|
||||
* Takes an object from the pool.
|
||||
*/
|
||||
@Override
|
||||
public
|
||||
T takeInterruptibly() throws InterruptedException {
|
||||
return take();
|
||||
|
@ -68,6 +70,7 @@ class NonBlockingSoftPool<T> extends ObjectPool<T> {
|
|||
/**
|
||||
* Return object to the pool.
|
||||
*/
|
||||
@Override
|
||||
public
|
||||
void put(T object) {
|
||||
poolableObject.onReturn(object);
|
||||
|
@ -77,6 +80,7 @@ class NonBlockingSoftPool<T> extends ObjectPool<T> {
|
|||
/**
|
||||
* @return a new object instance created by the pool.
|
||||
*/
|
||||
@Override
|
||||
public
|
||||
T newInstance() {
|
||||
return poolableObject.create();
|
|
@ -13,7 +13,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package dorkbox.objectpool;
|
||||
package dorkbox.objectPool;
|
||||
|
||||
import java.lang.ref.SoftReference;
|
||||
import java.util.Queue;
|
|
@ -13,7 +13,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package dorkbox.objectpool;
|
||||
package dorkbox.objectPool;
|
||||
|
||||
/**
|
||||
* @author dorkbox, llc
|
|
@ -13,7 +13,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package dorkbox.objectpool;
|
||||
package dorkbox.objectPool;
|
||||
|
||||
public
|
||||
abstract class PoolableObject<T> {
|
Loading…
Reference in New Issue