public class ThreadLocalStack<T>
extends java.lang.Object
InterceptorProbe.interceptionEnter(InterceptorContext, Object, Class, String, String, String, Object[])
method and retrieve them in the InterceptorProbe#interceptionExit(InterceptorContext, Object, Class, String, String, String, Object)
method
of an interceptor.
Usually, you can use the InterceptorContext.push(PayloadInfo)
and InterceptorContext.pop()
methods
which use such a thread local stack. Use this class only if you have to maintain more that ony such stack in a single probe.
Constructor and Description |
---|
ThreadLocalStack() |
Modifier and Type | Method and Description |
---|---|
java.util.List<T> |
getList()
Returns the stack as a list.
|
boolean |
isEmpty()
Checks if the thread-local stack is empty.
|
T |
peek()
Retrieves the object on top of the thread-local stack.
|
T |
pop()
Pops an object from the thread-local stack.
|
void |
push(T object)
Pushes an object onto the thread-local stack.
|
int |
size()
Returns the number of objects currently on the thread-local stack.
|
public void push(T object)
object
- the objectpublic T pop()
public T peek()
public int size()
public java.util.List<T> getList()
public boolean isEmpty()