Object pool pattern: Difference between revisions

Content deleted Content added
Vip saran (talk | contribs)
m Java code example: fixed methods visibility, case in getObject() when all available PooledObjects have expired and removed unnecessary cleaning of objects returned from the available map (which only has clean objects)
6 seconds = 6000 milliseconds, not 60000
Line 180:
</syntaxhighlight><syntaxhighlight lang="java">
public class PooledObjectPool {
private static long expTime = 600006000;//6 seconds
public static HashMap<PooledObject, Long> available = new HashMap<PooledObject, Long>();
public static HashMap<PooledObject, Long> inUse = new HashMap<PooledObject, Long>();