org.openarchitectureware.util
Class ProfileCollector

java.lang.Object
  extended by org.openarchitectureware.util.ProfileCollector

public class ProfileCollector
extends java.lang.Object

This class serves as a ThreadLocal collector for profiling information.

Author:
arno

Nested Class Summary
static class ProfileCollector.ProfileEntry
           
 
Method Summary
 void enter(java.lang.String context)
           
 void finish()
          This method must be called by the application to indicate that logging is finished.
static ProfileCollector getInstance()
           
 java.util.Collection<ProfileCollector.ProfileEntry> getProfile()
           
 void leave()
          the leave() method does not need to be passed the context because it keeps a stack of all contexts and pops the topmost.
 void setDetailedLoggingWriter(java.io.OutputStream out)
          This method tells the ProfileCollector to perform detailed logging and store it in the Writer passed as a parameter.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static ProfileCollector getInstance()

setDetailedLoggingWriter

public void setDetailedLoggingWriter(java.io.OutputStream out)
This method tells the ProfileCollector to perform detailed logging and store it in the Writer passed as a parameter.


finish

public void finish()
This method must be called by the application to indicate that logging is finished. Once this method was called, enter() and leave() must not be called.


getProfile

public java.util.Collection<ProfileCollector.ProfileEntry> getProfile()

enter

public void enter(java.lang.String context)

leave

public void leave()
the leave() method does not need to be passed the context because it keeps a stack of all contexts and pops the topmost.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object