|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjfun.yan.factory.CachingPool<T>
jfun.yan.factory.GlobalScope<T>
public class GlobalScope<T>
Represents a pooling strategy that pools the data
in a variable that's global to all threads.
This implementation is thread-safe.
Zephyr Business Solution
| Constructor Summary | |
|---|---|
GlobalScope()
|
|
| Method Summary | |
|---|---|
T |
getInstance(Factory<T> factory)
Apply the pooling strategy and return an instance from either the pool or the factory. |
T |
getPooledInstance(T def)
Get the instance that's already pooled. |
boolean |
isPooled()
Is this pool currently having something in cache? |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GlobalScope()
| Method Detail |
|---|
public T getInstance(Factory<T> factory)
Pool
getInstance in interface Pool<T>getInstance in class CachingPool<T>factory - the factory to create the object instance.
public T getPooledInstance(T def)
Pool
getPooledInstance in interface Pool<T>getPooledInstance in class CachingPool<T>def - the default value to return if there's no pooled instance.
public boolean isPooled()
CachingPool
isPooled in interface Pool<T>isPooled in class CachingPool<T>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||