|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.shindig.protocol.conversion.xstream.ThreadSafeWriterStack
public class ThreadSafeWriterStack
A simple implementation of a WriterStack that can be shared amongst multiple threads and will record the state of each thread. This cannot however be shared amongst multiple writers on multiple threads as this would lead to an inconsistent state. In the shindig implementation this is not an issue as the serialization process is atomic below the API.
| Constructor Summary | |
|---|---|
ThreadSafeWriterStack()
Create a WriterStack that is thread safe. |
|
| Method Summary | |
|---|---|
String |
peek()
Peek into the current location of the writer. |
Object |
peek(int i)
Look at the node name on the top of the stack on the current thread. |
NamespaceSet |
peekNamespace()
|
String |
pop()
Remove a node name from the stack on the current thread. |
void |
push(String name,
NamespaceSet namespaceSet)
Add an element name to the stack on the current thread. |
void |
reset()
Reset the stack back to the default state. |
int |
size()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ThreadSafeWriterStack()
WriterStack that is thread safe. The stack will store its
contents on the thread so this class can be shared amongst multiple
threads, but obviously there must be only one instance of the class per
writer per thread.
| Method Detail |
|---|
public void push(String name,
NamespaceSet namespaceSet)
push in interface WriterStackname - the node name just added.namespaceSet - the namespace set associated with the current element.public String pop()
pop in interface WriterStackpublic String peek()
peek in interface WriterStackWriterStack.peek()public NamespaceSet peekNamespace()
peekNamespace in interface WriterStackWriterStack.peekNamespace()public Object peek(int i)
public void reset()
reset in interface WriterStackWriterStack.reset()public int size()
size in interface WriterStackWriterStack.size()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||