Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
UUID |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com | |
3 | * The software in this package is published under the terms of the CPAL v1.0 | |
4 | * license, a copy of which has been included with this distribution in the | |
5 | * LICENSE.txt file. | |
6 | */ | |
7 | package org.mule.util; | |
8 | ||
9 | import org.safehaus.uuid.UUIDGenerator; | |
10 | ||
11 | /** | |
12 | * <code>UUID</code> Generates a UUID using the <a href="http://jug.safehaus.org/">Safehaus UUID generator</a> | |
13 | * rather than the built-in version of JDK5. In our performance tests we found the Java version | |
14 | * to be blocking much more than the Safehaus one. | |
15 | */ | |
16 | // @ThreadSafe | |
17 | public final class UUID | |
18 | { | |
19 | 0 | private static final UUIDGenerator generator = UUIDGenerator.getInstance(); |
20 | ||
21 | private UUID() | |
22 | 0 | { |
23 | // no go | |
24 | 0 | } |
25 | ||
26 | public static String getUUID() | |
27 | { | |
28 | 0 | return generator.generateTimeBasedUUID().toString(); |
29 | } | |
30 | } |