-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
straight application listener order (#1179)
* straight application listener order * straight application listener order * straight application listener order * straight application listener order * straight application listener order * upgrade sofa-common-tools to 1.3.11 * upgrade sofa-common-tools to 1.3.11 * upgrade sofa-common-tools to 1.3.11 --------- Co-authored-by: 寻芳 <dengjialin.djl@antgroup.com>
- Loading branch information
1 parent
74a991d
commit bb45ec7
Showing
18 changed files
with
128 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
.../sofa-boot/src/main/java/com/alipay/sofa/boot/util/ApplicationListenerOrderConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.alipay.sofa.boot.util; | ||
|
||
import org.springframework.boot.context.config.ConfigFileApplicationListener; | ||
import org.springframework.boot.context.logging.LoggingApplicationListener; | ||
import org.springframework.core.Ordered; | ||
import org.springframework.util.Assert; | ||
|
||
/** | ||
* ApplicationListener 顺序常量 | ||
* | ||
* @author xunfang | ||
* @version ApplicationListenerOrderConstants.java, v 0.1 2023/6/1 | ||
*/ | ||
public class ApplicationListenerOrderConstants { | ||
/** | ||
* 必须最先执行 | ||
*/ | ||
public static final int SOFA_BOOTSTRAP_RUN_LISTENER_ORDER = Ordered.HIGHEST_PRECEDENCE; | ||
|
||
/** | ||
* 必须在其他会触发 sofa-common-tools 日志上下文初始化的组件之前 | ||
*/ | ||
public static final int LOG_ENVIRONMENT_PREPARING_LISTENER_ORDER = ConfigFileApplicationListener.DEFAULT_ORDER + 2; | ||
|
||
/** | ||
* 必须在 LogEnvironmentPreparingListener 之后, 且 LoggingApplicationListener 之前 | ||
*/ | ||
public static final int SOFA_CONFIG_SOURCE_SUPPORT_LISTENER_ORDER = LOG_ENVIRONMENT_PREPARING_LISTENER_ORDER + 3; | ||
|
||
public static final int SOFA_TRACER_CONFIGURATION_LISTENER_ORDER = Ordered.HIGHEST_PRECEDENCE + 50; | ||
|
||
static { | ||
Assert | ||
.isTrue(SOFA_CONFIG_SOURCE_SUPPORT_LISTENER_ORDER < LoggingApplicationListener.DEFAULT_ORDER); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters