aws-xray-recorder-sdk-core/src/main/java/com/amazonaws/xray/jakarta/servlet/AWSXRayServletFilter.java [74:160]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public AWSXRayServletFilter(@Nullable SegmentNamingStrategy segmentNamingStrategy) {
        this(segmentNamingStrategy, null);
    }

    // TODO(anuraaga): Better define lifecycle relationship between this listener and the filter.
    @SuppressWarnings("nullness")
    public AWSXRayServletFilter(@Nullable SegmentNamingStrategy segmentNamingStrategy, @Nullable AWSXRayRecorder recorder) {
        // Will be configured by web.xml otherwise.
        if (segmentNamingStrategy != null) {
            this.segmentNamingStrategy = segmentNamingStrategy;
        }
        // Will be configured by web.xml otherwise.
        if (recorder != null) {
            this.recorder = recorder;
        }
        this.listener = new AWSXRayServletAsyncListener(this, recorder);
    }

    /**
     * @return the segmentOverrideName
     */
    @Nullable
    public String getSegmentOverrideName() {
        return segmentOverrideName;
    }

    /**
     * @param segmentOverrideName
     *            the segmentOverrideName to set
     */
    public void setSegmentOverrideName(String segmentOverrideName) {
        this.segmentOverrideName = segmentOverrideName;
    }

    /**
     * @return the segmentDefaultName
     */
    @Nullable
    public String getSegmentDefaultName() {
        return segmentDefaultName;
    }

    /**
     * @param segmentDefaultName
     *            the segmentDefaultName to set
     */
    public void setSegmentDefaultName(String segmentDefaultName) {
        this.segmentDefaultName = segmentDefaultName;
    }

    /**
     *
     *
     * @param config
     *  the filter configuration. There are various init-params which may be passed on initialization. The values in init-params
     *  will create segment naming strategies which override those passed in constructors.
     *
     * <ul>
     *
     * <li>
     * <b>fixedName</b> A String value used as the fixedName parameter for a created
     * {@link FixedSegmentNamingStrategy}. Used only if the {@code dynamicNamingFallbackName}
     * init-param is not set.
     * </li>
     *
     * <li>
     * <b>dynamicNamingFallbackName</b> A String value used as the fallbackName parameter for a created
     * {@link DynamicSegmentNamingStrategy}.
     * </li>
     *
     * <li>
     * <b>dynamicNamingRecognizedHosts</b> A String value used as the recognizedHosts parameter for a created
     * {@link DynamicSegmentNamingStrategy}.
     * </li>
     *
     * </ul>
     *
     * @throws ServletException
     *  when a segment naming strategy is not provided in constructor arguments nor in init-params.
     */
    @Override
    public void init(FilterConfig config) throws ServletException {
        String fixedName = config.getInitParameter("fixedName");
        String dynamicNamingFallbackName = config.getInitParameter("dynamicNamingFallbackName");
        String dynamicNamingRecognizedHosts = config.getInitParameter("dynamicNamingRecognizedHosts");
        if (StringValidator.isNotNullOrBlank(dynamicNamingFallbackName)) {
            if (StringValidator.isNotNullOrBlank(dynamicNamingRecognizedHosts)) {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



aws-xray-recorder-sdk-core/src/main/java/com/amazonaws/xray/javax/servlet/AWSXRayServletFilter.java [74:160]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public AWSXRayServletFilter(@Nullable SegmentNamingStrategy segmentNamingStrategy) {
        this(segmentNamingStrategy, null);
    }

    // TODO(anuraaga): Better define lifecycle relationship between this listener and the filter.
    @SuppressWarnings("nullness")
    public AWSXRayServletFilter(@Nullable SegmentNamingStrategy segmentNamingStrategy, @Nullable AWSXRayRecorder recorder) {
        // Will be configured by web.xml otherwise.
        if (segmentNamingStrategy != null) {
            this.segmentNamingStrategy = segmentNamingStrategy;
        }
        // Will be configured by web.xml otherwise.
        if (recorder != null) {
            this.recorder = recorder;
        }
        this.listener = new AWSXRayServletAsyncListener(this, recorder);
    }

    /**
     * @return the segmentOverrideName
     */
    @Nullable
    public String getSegmentOverrideName() {
        return segmentOverrideName;
    }

    /**
     * @param segmentOverrideName
     *            the segmentOverrideName to set
     */
    public void setSegmentOverrideName(String segmentOverrideName) {
        this.segmentOverrideName = segmentOverrideName;
    }

    /**
     * @return the segmentDefaultName
     */
    @Nullable
    public String getSegmentDefaultName() {
        return segmentDefaultName;
    }

    /**
     * @param segmentDefaultName
     *            the segmentDefaultName to set
     */
    public void setSegmentDefaultName(String segmentDefaultName) {
        this.segmentDefaultName = segmentDefaultName;
    }

    /**
     *
     *
     * @param config
     *  the filter configuration. There are various init-params which may be passed on initialization. The values in init-params
     *  will create segment naming strategies which override those passed in constructors.
     *
     * <ul>
     *
     * <li>
     * <b>fixedName</b> A String value used as the fixedName parameter for a created
     * {@link com.amazonaws.xray.strategy.FixedSegmentNamingStrategy}. Used only if the {@code dynamicNamingFallbackName}
     * init-param is not set.
     * </li>
     *
     * <li>
     * <b>dynamicNamingFallbackName</b> A String value used as the fallbackName parameter for a created
     * {@link com.amazonaws.xray.strategy.DynamicSegmentNamingStrategy}.
     * </li>
     *
     * <li>
     * <b>dynamicNamingRecognizedHosts</b> A String value used as the recognizedHosts parameter for a created
     * {@link com.amazonaws.xray.strategy.DynamicSegmentNamingStrategy}.
     * </li>
     *
     * </ul>
     *
     * @throws ServletException
     *  when a segment naming strategy is not provided in constructor arguments nor in init-params.
     */
    @Override
    public void init(FilterConfig config) throws ServletException {
        String fixedName = config.getInitParameter("fixedName");
        String dynamicNamingFallbackName = config.getInitParameter("dynamicNamingFallbackName");
        String dynamicNamingRecognizedHosts = config.getInitParameter("dynamicNamingRecognizedHosts");
        if (StringValidator.isNotNullOrBlank(dynamicNamingFallbackName)) {
            if (StringValidator.isNotNullOrBlank(dynamicNamingRecognizedHosts)) {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



