org.codehaus.gpars

groovyx.gpars
[Java] Class ThreadLocalPools

java.lang.Object
  java.lang.ThreadLocal
      groovyx.gpars.ThreadLocalPools

final class ThreadLocalPools
extends java.lang.ThreadLocal

Holds a thread-local stack of pools to allow for nested calls to ForkJoinPool.withPool() or GParsExecutorsPool.withPool()

Authors:
Vaclav Pech Date: Dec 15, 2009


Constructor Summary
ThreadLocalPools()

 
Method Summary
java.lang.Object getCurrent()

Gives the current element

protected java.util.LinkedList initialValue()

void leftShift(java.lang.Object pool)

Adds a new element

void pop()

Removes the top (last) element

 
Methods inherited from class java.lang.ThreadLocal
java.lang.ThreadLocal#get(), java.lang.ThreadLocal#remove(), java.lang.ThreadLocal#set(java.lang.Object), java.lang.ThreadLocal#wait(long), java.lang.ThreadLocal#wait(), java.lang.ThreadLocal#wait(long, int), java.lang.ThreadLocal#equals(java.lang.Object), java.lang.ThreadLocal#toString(), java.lang.ThreadLocal#hashCode(), java.lang.ThreadLocal#getClass(), java.lang.ThreadLocal#notify(), java.lang.ThreadLocal#notifyAll()
 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Constructor Detail

ThreadLocalPools

ThreadLocalPools()


 
Method Detail

getCurrent

java.lang.Object getCurrent()
Gives the current element
Returns:
The retrieved pool


initialValue

@Override
protected java.util.LinkedList initialValue()


leftShift

@SuppressWarnings({"UnusedDeclaration"})
void leftShift(java.lang.Object pool)
Adds a new element
Parameters:
pool - The pool to store


pop

void pop()
Removes the top (last) element


 

Copyright © 2008–2010 Václav Pech. All Rights Reserved.