-
Notifications
You must be signed in to change notification settings - Fork 562
/
Copy pathspring-provider.xml
74 lines (64 loc) · 3.65 KB
/
spring-provider.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2015 The Jupiter Project
~
~ Licensed 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.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jupiter="http://www.jupiter-rpc.org/jupiter"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.jupiter-rpc.org/jupiter
http://www.jupiter-rpc.org/jupiter/jupiter.xsd">
<bean id="globalInterceptor1" class="org.jupiter.example.spring.interceptor.provider.MyGlobalProviderInterceptor1" />
<bean id="globalInterceptor2" class="org.jupiter.example.spring.interceptor.provider.MyGlobalProviderInterceptor2" />
<bean id="globalFlowController" class="org.jupiter.example.spring.flow.MyGlobalFlowController" />
<jupiter:server id="jupiterServer" registryType="default">
<jupiter:property registryServerAddresses="127.0.0.1:20001" />
<jupiter:property globalProviderInterceptors="globalInterceptor1,globalInterceptor2" />
<jupiter:property globalFlowController="globalFlowController" />
<!-- 可选配置 -->
<!--
String registryServerAddresses // 注册中心地址 [host1:port1,host2:port2....]
ProviderInterceptor[] globalProviderInterceptors // 全局拦截器
FlowController<JRequest> flowController // 全局流量控制
-->
<!-- 网络层配置选项 -->
<jupiter:netOptions>
<jupiter:parentOption SO_REUSEADDR="true" />
<jupiter:parentOption SO_BACKLOG="100" />
<jupiter:childOption SO_RCVBUF="8192" />
<jupiter:childOption SO_SNDBUF="8192" />
</jupiter:netOptions>
</jupiter:server>
<bean id="interceptor1" class="org.jupiter.example.spring.interceptor.provider.MyProviderInterceptor1" />
<bean id="interceptor2" class="org.jupiter.example.spring.interceptor.provider.MyProviderInterceptor2" />
<bean id="flowController" class="org.jupiter.example.spring.flow.MyFlowController" />
<!-- provider -->
<bean id="serviceTest" class="org.jupiter.example.ServiceTestImpl" />
<jupiter:provider id="serviceTestProvider" server="jupiterServer" providerImpl="serviceTest">
<jupiter:property weight="100"/>
<jupiter:property providerInterceptors="interceptor1,interceptor2" />
<jupiter:property flowController="flowController" />
<!-- 可选配置 -->
<!--
ProviderInterceptor[] providerInterceptors // 私有拦截器
int weight // 权重
Executor executor // 该服务私有的线程池
FlowController<JRequest> flowController // 该服务私有的流量控制器
JServer.ProviderInitializer<?> providerInitializer // 服务延迟初始化
Executor providerInitializerExecutor // 服务私有的延迟初始化线程池
-->
</jupiter:provider>
</beans>