1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
public class AttributionTraceManager {
private static final AttributionTraceManager INSTANCE = new AttributionTraceManager();
private Map<String,AttributionTrace> traceMap = = new HashMap<String, AttributionTrace>();
private AttributionTraceManager (){
}
public static AttributionTraceManager getInstance(){
return INSTANCE;
}
public synchronized String createAttributionTrace(){
String idTrace = Long.valueOf(System.nanoTime()).toString();
traceMap.put(idTrace, new AttributionTrace());
return idTrace;
}
public void deleteTrace(String idTrace){
traceMap.remove(idTrace);
}
} |