org.apache.cocoon.profiling.data
Class UUIDProfilingIdGenerator

java.lang.Object
  extended by org.apache.cocoon.profiling.data.UUIDProfilingIdGenerator
All Implemented Interfaces:
ProfilingIdGenerator

public class UUIDProfilingIdGenerator
extends Object
implements ProfilingIdGenerator

The UUIDProfilingIdGenerator uses ThreadLocal to separate the id management for different threads and generates ids based on UUID objects created by UUID.randomUUID(), which should be reasonably unique for profiling purposes.


Constructor Summary
UUIDProfilingIdGenerator()
           
 
Method Summary
 String create()
          Creates and returns a new id for the current thread.
 String getCurrent()
          Get the current id for the current thread.
 void remove()
          Discard the id for the current thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UUIDProfilingIdGenerator

public UUIDProfilingIdGenerator()
Method Detail

create

public String create()
Creates and returns a new id for the current thread.

Specified by:
create in interface ProfilingIdGenerator
Returns:
the newly created id.

getCurrent

public String getCurrent()
Get the current id for the current thread.

Specified by:
getCurrent in interface ProfilingIdGenerator
Returns:
the current id for the current thread, or null if none has been created or remove was called.

remove

public void remove()
Discard the id for the current thread.

Specified by:
remove in interface ProfilingIdGenerator


Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.