Package com.epam.common.thread.runnable
Class FixedRunnablePool<T extends RunnableObject>
java.lang.Object
com.epam.common.thread.runnable.FixedRunnablePool<T>
- All Implemented Interfaces:
RunnablePool<T>
Pool have fixed size.
Create new objects if pool is empty.
Skip objects if the pool is full. Object should be collected by GC in this case.
User: Mykhailo_Sereda
Date: 05.11.12
Time: 15:18
-
Constructor Summary
ConstructorsConstructorDescriptionFixedRunnablePool
(int minSize, int maxSize, RunnableFactory<T> objectFactory) -
Method Summary
-
Constructor Details
-
FixedRunnablePool
-
-
Method Details
-
get
Get object from pool. Create new object if pool is empty.- Specified by:
get
in interfaceRunnablePool<T extends RunnableObject>
- Returns:
-
createNew
-
release
Try return object to the pool. Skip object if the pool is full.- Specified by:
release
in interfaceRunnablePool<T extends RunnableObject>
- Parameters:
ob
-
-