88import org .jetbrains .annotations .Nullable ;
99
1010/**
11- * Resolves transaction name using {@link HttpServletRequest#getMethod()} and templated route that
12- * handled the request. To return correct transaction name, it must be used after request is
13- * processed by {@link org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping}
14- * where {@link org.springframework.web.servlet.HandlerMapping#BEST_MATCHING_PATTERN_ATTRIBUTE} is
15- * set.
11+ * Resolves transaction name using other transaction name providers by invoking them in order.
12+ * If a provider returns no transaction name, the next one is invoked.
1613 */
1714@ ApiStatus .Internal
1815public final class CombinedTransactionNameProvider implements TransactionNameProvider {
1916
2017 private final @ NotNull List <TransactionNameProvider > providers ;
21- private @ Nullable TransactionNameSource source = null ;
2218
2319 public CombinedTransactionNameProvider (final @ NotNull List <TransactionNameProvider > providers ) {
2420 this .providers = providers ;
@@ -29,7 +25,6 @@ public CombinedTransactionNameProvider(final @NotNull List<TransactionNameProvid
2925 for (TransactionNameProvider provider : providers ) {
3026 String transactionName = provider .provideTransactionName (request );
3127 if (transactionName != null ) {
32- source = provider .provideTransactionSource ();
3328 return transactionName ;
3429 }
3530 }
@@ -40,8 +35,7 @@ public CombinedTransactionNameProvider(final @NotNull List<TransactionNameProvid
4035 @ Override
4136 @ ApiStatus .Internal
4237 public @ NotNull TransactionNameSource provideTransactionSource () {
43- final @ Nullable TransactionNameSource tmpSource = source ;
44- return tmpSource == null ? TransactionNameSource .CUSTOM : tmpSource ;
38+ return TransactionNameSource .CUSTOM ;
4539 }
4640
4741 @ ApiStatus .Internal
0 commit comments