|
JProfiler API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jprofiler.api.agent.interceptor.ThreadLocalStack
public class ThreadLocalStack
A stack that saves objects in thread-local data structures.
This utility class is important for cacluating payload timing where you need to save payload infos
in the Interceptor#interceptionEnter(Object, String, String, Object[])
method and retrieve them in the Interceptor#interceptionExit(Object, String, String, Object)
method
of an interceptor.
To avoid expensive synchronization and conflicts between different threads, this thread-local stack is the best solution for storing payloads. Please see the interceptor sample for an example on how to use this class.
Constructor Summary | |
---|---|
ThreadLocalStack()
|
Method Summary | |
---|---|
boolean |
isEmpty()
Checks if the thread-local stack is empty. |
java.lang.Object |
pop()
Pops an object from the thread-local stack. |
void |
push(java.lang.Object object)
Pushes an object onto the thread-local stack. |
int |
size()
Returns the number of objects currently on the thread-local stack. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ThreadLocalStack()
Method Detail |
---|
public void push(java.lang.Object object)
object
- the objectpublic java.lang.Object pop()
public int size()
public boolean isEmpty()
|
JProfiler API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |