DUBBO-463 Reference注解的属性配置失效
This commit is contained in:
parent
fa2d114552
commit
963d2710a8
|
|
@ -99,7 +99,7 @@ public abstract class AbstractConfig implements Serializable {
|
|||
protected void appendAnnotation(Class<?> annotationClass, Object annotation) {
|
||||
Method[] methods = annotationClass.getMethods();
|
||||
for (Method method : methods) {
|
||||
if (method.getDeclaringClass() == annotation.getClass()
|
||||
if (method.getDeclaringClass() != Object.class
|
||||
&& method.getReturnType() != void.class
|
||||
&& method.getParameterTypes().length == 0
|
||||
&& Modifier.isPublic(method.getModifiers())
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import com.alibaba.dubbo.config.spring.api.DemoService;
|
|||
@Controller("annotationAction")
|
||||
public class AnnotationAction {
|
||||
|
||||
@Reference
|
||||
@Reference(version = "1.2")
|
||||
private DemoService demoService;
|
||||
|
||||
public String doSayName(String name) {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import com.alibaba.dubbo.config.spring.api.DemoService;
|
|||
*
|
||||
* @author william.liangf
|
||||
*/
|
||||
@Service
|
||||
@Service(version = "1.2")
|
||||
public class AnnotationServiceImpl implements DemoService {
|
||||
|
||||
public String sayName(String name) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
- Copyright 1999-2011 Alibaba Group.
|
||||
-
|
||||
- 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:context="http://www.springframework.org/schema/context"
|
||||
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
|
||||
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
|
||||
|
||||
<dubbo:application name="annotation-consumer" />
|
||||
<dubbo:registry address="127.0.0.1:4548" />
|
||||
<dubbo:annotation package="com.alibaba.dubbo.config.spring.annotation.consumer" version="2.0.0" />
|
||||
|
||||
</beans>
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
- Copyright 1999-2011 Alibaba Group.
|
||||
-
|
||||
- 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:dubbo="http://code.alibabatech.com/schema/dubbo"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
|
||||
|
||||
<dubbo:application name="annotation-provider" />
|
||||
<dubbo:registry address="127.0.0.1:4548" />
|
||||
<dubbo:annotation package="com.alibaba.dubbo.config.spring.annotation.provider" />
|
||||
|
||||
</beans>
|
||||
Loading…
Reference in New Issue