Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry pick PR from 2.6.0 #355

Merged
merged 21 commits into from
Jan 30, 2019
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ logs
.m2
sofa-boot-gradle-plugin/build/
.gradle
sofa-boot-gradle-plugin/out/
sofa-boot-gradle-plugin/out/
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ sudo: false

jdk:
- oraclejdk8
- openjdk11

install:

- mvn clean install -DskipTests -B -V
- mvn test

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,7 @@ SOFA 的第一个版本是阿玺创造的,感谢阿玺给 SOFA 打下了坚实
## 七、文档

请参考 [SOFABoot 官方文档](http://www.sofastack.tech/sofa-boot/docs/Home)。

## 八、开源许可

SOFABoot 基于 Apache License 2.0 协议,SOFABoot 依赖了一些三方组件,它们的开源协议参见 [依赖组件版权说明](https://www.sofastack.tech/sofa-boot/docs/NOTICE)
29 changes: 29 additions & 0 deletions change_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
shopt -s expand_aliases
if [ ! -n "$1" ] ;then
echo "Please enter a version"
exit 1
else
echo "The updated version is $1 !"
fi

currentVersion=`sed -n '/<project /,/<packaging/p' pom.xml | grep version | cut -d '>' -f2 | cut -d '<' -f1`
echo "The current version is $currentVersion"

if [ `uname` == "Darwin" ] ;then
echo "This is OS X"
alias sed='sed -i ""'
else
echo "This is Linux"
alias sed='sed -i'
fi

echo "Change version in root pom.xml ===>"
sed "/<project /,/<packaging/ s/<version>.*<\/version>/<version>$1<\/version>/" pom.xml

echo "Change version in subproject pom ===>"
for filename in `find . -name "pom.xml" -mindepth 2`;do
echo "Deal with $filename"
sed "/<parent>/,/<\/parent>/ s/<version>.*<\/version>/<version>$1<\/version>/" $filename
done

2 changes: 1 addition & 1 deletion healthcheck-sofa-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>sofa-boot-runtime</artifactId>
<version>3.1.1</version>
<version>3.1.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
13 changes: 1 addition & 12 deletions infra-sofa-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>sofa-boot-runtime</artifactId>
<version>3.1.1</version>
<version>3.1.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand All @@ -48,12 +48,6 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<exclusions>
<exclusion>
<artifactId>spring-jcl</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down Expand Up @@ -155,11 +149,6 @@
<artifactId>log4j-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-context</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.alipay.sofa.infra.config.spring.namespace.spi.SofaBootTagNameSupport;
import com.alipay.sofa.infra.log.InfraHealthCheckLoggerFactory;
import org.slf4j.Logger;
import org.springframework.beans.factory.xml.BeanDefinitionDecorator;
import org.springframework.beans.factory.xml.BeanDefinitionParser;
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;

Expand All @@ -29,6 +30,7 @@
* SofaBootNamespaceHandler
*
* @author yangguanchao
* @author qilong.zql
* @since 2018/04/08
*/
public class SofaBootNamespaceHandler extends NamespaceHandlerSupport {
Expand All @@ -38,19 +40,21 @@ public class SofaBootNamespaceHandler extends NamespaceHandlerSupport {

@Override
public void init() {
ServiceLoader<SofaBootTagNameSupport> serviceLoaderSofaBoot = ServiceLoader
.load(SofaBootTagNameSupport.class);
ServiceLoader<SofaBootTagNameSupport> serviceLoaderSofaBoot = ServiceLoader.load(SofaBootTagNameSupport.class);
serviceLoaderSofaBoot.forEach(this::registerTagParser);
}

private void registerTagParser(SofaBootTagNameSupport tagNameSupport) {
if (!(tagNameSupport instanceof BeanDefinitionParser)) {
logger.error("{} tag name supported [{}] parser are not instance of {}.",
tagNameSupport.getClass(), tagNameSupport.supportTagName(),
BeanDefinitionParser.class);
return;
if (tagNameSupport instanceof BeanDefinitionParser) {
registerBeanDefinitionParser(tagNameSupport.supportTagName(),
(BeanDefinitionParser) tagNameSupport);
} else if (tagNameSupport instanceof BeanDefinitionDecorator) {
registerBeanDefinitionDecoratorForAttribute(tagNameSupport.supportTagName(),
(BeanDefinitionDecorator) tagNameSupport);
} else {
logger.error(tagNameSupport.getClass() + " tag name supported ["
+ tagNameSupport.supportTagName() + "] parser are not instance of "
+ BeanDefinitionParser.class + "or " + BeanDefinitionDecorator.class);
}
String tagName = tagNameSupport.supportTagName();
registerBeanDefinitionParser(tagName, (BeanDefinitionParser) tagNameSupport);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,26 @@ public class SofaBootInfraConstants {
*/
public static final String ENDPOINTS_WEB_EXPOSURE_INCLUDE_CONFIG = "management.endpoints.web.exposure.include";
public static final String SOFA_DEFAULT_ENDPOINTS_WEB_EXPOSURE_VALUE = "info, health, versions, readiness";

/**
* root application context name
*/
public static final String ROOT_APPLICATION_CONTEXT = "RootApplicationContext";

/**
* sofa configuration prefix
*/
public static final String PREFIX = "com.alipay.sofa.boot";

/**
* Thread Pool Core Size to execute async bean initialization
*/
public static final String ASYNC_INIT_BEAN_CORE_SIZE = PREFIX
+ ".asyncInitBeanCoreSize";

/**
* Thread Pool Max Size to execute async bean initialization
*/
public static final String ASYNC_INIT_BEAN_MAX_SIZE = PREFIX
+ ".asyncInitBeanMaxSize";
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
</xsd:complexContent>
</xsd:complexType>

<!-- parameters in service/reference binding.* -->
<xsd:complexType name="TParameter">
<xsd:attribute name="key" type="xsd:string" use="required" />
<xsd:attribute name="value" type="xsd:string" use="required" />
</xsd:complexType>

<!-- Bolt Start -->

Expand Down Expand Up @@ -130,6 +135,7 @@
<xsd:element name="global-attrs" type="BBindingTRRefAttr" minOccurs="0" maxOccurs="1"/>
<xsd:element name="route" type="BBindingTRRefRoute" minOccurs="0" maxOccurs="1"/>
<xsd:element name="method" type="BBindingTRRefMethod" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="parameter" type="TParameter" minOccurs="0" maxOccurs="unbounded"/>
<xsd:any minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
Expand All @@ -142,6 +148,7 @@
<xsd:sequence minOccurs="0">
<xsd:element name="global-attrs" type="BBindingTRSerAttr" minOccurs="0" maxOccurs="1"/>
<xsd:element name="method" type="BBindingTRSerMethod" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="parameter" type="TParameter" minOccurs="0" maxOccurs="unbounded"/>
<xsd:any minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
Expand Down Expand Up @@ -243,6 +250,7 @@
<xsd:element name="global-attrs" type="RestBindingTRRefAttr" minOccurs="0" maxOccurs="1"/>
<xsd:element name="route" type="RestBindingTRRefRoute" minOccurs="0" maxOccurs="1"/>
<xsd:element name="method" type="RestBindingTRRefMethod" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="parameter" type="TParameter" minOccurs="0" maxOccurs="unbounded"/>
<xsd:any minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
Expand All @@ -255,6 +263,7 @@
<xsd:sequence minOccurs="0">
<xsd:element name="global-attrs" type="RestBindingTRSerAttr" minOccurs="0" maxOccurs="1"/>
<xsd:element name="method" type="RestBindingTRSerMethod" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="parameter" type="TParameter" minOccurs="0" maxOccurs="unbounded"/>
<xsd:any minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
Expand Down Expand Up @@ -367,6 +376,7 @@
<xsd:element name="global-attrs" type="DubboBindingTRRefAttr" minOccurs="0" maxOccurs="1"/>
<xsd:element name="route" type="DubboBindingTRRefRoute" minOccurs="0" maxOccurs="1"/>
<xsd:element name="method" type="DubboBindingTRRefMethod" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="parameter" type="TParameter" minOccurs="0" maxOccurs="unbounded"/>
<xsd:any minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
Expand All @@ -379,6 +389,7 @@
<xsd:sequence minOccurs="0">
<xsd:element name="global-attrs" type="DubboBindingTRSerAttr" minOccurs="0" maxOccurs="1"/>
<xsd:element name="method" type="DubboBindingTRSerMethod" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="parameter" type="TParameter" minOccurs="0" maxOccurs="unbounded"/>
<xsd:any minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
Expand Down Expand Up @@ -499,6 +510,7 @@
<xsd:element name="global-attrs" type="H2cBindingRefAttr" minOccurs="0" maxOccurs="1"/>
<xsd:element name="route" type="H2cBindingRefRoute" minOccurs="0" maxOccurs="1"/>
<xsd:element name="method" type="H2cBindingRefMethod" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="parameter" type="TParameter" minOccurs="0" maxOccurs="unbounded"/>
<xsd:any minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
Expand All @@ -511,6 +523,7 @@
<xsd:sequence minOccurs="0">
<xsd:element name="global-attrs" type="H2cBindingSerAttr" minOccurs="0" maxOccurs="1"/>
<xsd:element name="method" type="H2cBindingSerMethod" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="parameter" type="TParameter" minOccurs="0" maxOccurs="unbounded"/>
<xsd:any minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
Expand Down Expand Up @@ -593,4 +606,7 @@
</xsd:complexType>
<!-- registry.confreg -->

<!-- async init -->
<xsd:attribute name="async-init" type="xsd:boolean"/>

</xsd:schema>
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

<xsd:schema xmlns="http://sofastack.io/schema/sofaboot"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:beans="http://www.springframework.org/schema/beans"
targetNamespace="http://sofastack.io/schema/sofaboot"
elementFormDefault="qualified" attributeFormDefault="unqualified">

Expand All @@ -30,4 +31,52 @@
<!-- http://itdoc.hitachi.co.jp/manuals/3020/30203Y4340e/EY430034.HTM -->
<xsd:include schemaLocation="./rpc.xsd"/>

<!-- extension-point -->
<xsd:element name="extension-point" type="Textension-point"/>

<xsd:complexType name="Textension-point">
<xsd:complexContent>
<xsd:extension base="beans:identifiedType">
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:element name="object" type="Tobject" minOccurs="0"/>
<!-- nested bean declaration -->
<xsd:any namespace="##other" minOccurs="0" maxOccurs="1" processContents="skip"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="ref" type="xsd:string"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>

<xsd:complexType name="Tobject">
<xsd:attribute name="class" type="xsd:string" use="required"/>
</xsd:complexType>

<xsd:element name="extension" type="Textension"/>

<xsd:complexType name="Textension">
<xsd:complexContent>
<xsd:extension base="beans:identifiedType">
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:element name="require" type="Trequire" minOccurs="0"/>
<xsd:element name="content" type="Tcontent" minOccurs="0"
maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="bean" type="xsd:string" use="required"/>
<xsd:attribute name="point" type="xsd:string" use="required"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>

<xsd:complexType name="Trequire">
<xsd:attribute name="bean" type="xsd:string" use="required"/>
</xsd:complexType>

<xsd:complexType name="Tcontent">
<xsd:sequence>
<xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
</xsd:sequence>
</xsd:complexType>


</xsd:schema>
Loading