org.vishia.util
Class ThreadContext

java.lang.Object
  extended by org.vishia.util.ThreadContext

public class ThreadContext
extends java.lang.Object


Field Summary
private static java.lang.ThreadLocal<ThreadContext> currentThreadContext
          The thread-specific ThreadContext.
 java.lang.StringBuffer excMsg
          String Buffer to store a thread local exception message for throw operations.
 
Constructor Summary
ThreadContext()
           
 
Method Summary
static ThreadContext getCurrent()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentThreadContext

private static java.lang.ThreadLocal<ThreadContext> currentThreadContext
The thread-specific ThreadContext. This element is existing once per Thread.


excMsg

public java.lang.StringBuffer excMsg
String Buffer to store a thread local exception message for throw operations. Using this variable no new operation is needed on throw statement. But on using first the exsMsg should be clerad.
Example:
 ThreadContext threadContext = ThreadContext.getCurrent();
 threadContext->excMsg.setLength(0);
 threadContext->excMsg.append("The message text");
 throw new RuntimeException(threadContext->excMsg);

Constructor Detail

ThreadContext

public ThreadContext()
Method Detail

getCurrent

public static ThreadContext getCurrent()