public Tracer createTracer ( String tracerName , boolean requestedBySource ) { TracerImpl tparent = null ; TracerImpl t = tracers . get ( tracerName ) ; if ( t == null ) { String [ ] split = tracerName . split ( "\\." ) ; String currentName = "" ; for ( String s : split ) { if ( tparent == null ) { // first loop tparent = rootTracer ; currentName = s ; } else { currentName = currentName + "." + s ; } t = tracers . get ( currentName ) ; if ( t == null ) { t = new TracerImpl ( currentName , tparent , this . notificationSource , this . traceFacility ) ; final TracerImpl u = tracers . putIfAbsent ( t . getTracerName ( ) , t ) ; if ( u != null ) { t = u ; } } tparent = t ; } } if ( requestedBySource ) t . setRequestedBySource ( requestedBySource ) ; return t ; }
This method can be called multiple times .