Skip to content

Commit

Permalink
add AnnotationServiceExporter usage guide
Browse files Browse the repository at this point in the history
update readme.MD add AnnotationServiceExporter usage guide
  • Loading branch information
xiemalin committed Oct 10, 2014
1 parent 68b64b4 commit dcca138
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Spring 3.0+

### RPC服务的发布 ###

a 在Spring配置文件,定义IDLServiceExporter服务发布配置
a1 在Spring配置文件,定义IDLServiceExporter服务发布配置 (直接由IDL定义发布)

```xml
<bean class="com.baidu.jprotobuf.rpc.server.IDLServiceExporter">
Expand All @@ -34,6 +34,26 @@ serviceName 服务名称,必须填写。 在服务的servlet发布后,服务
invoker 服务回调实现,必须实现 com.baidu.jprotobuf.rpc.server.ServerInvoker接口
</pre>


a2 在Spring配置文件,定义AnnotationServiceExporter服务发布配置 (通过Jprotobuf注解类发布)

```xml
<bean class="com.baidu.jprotobuf.rpc.server.AnnotationServiceExporter">
<property name="serviceName" value="SimpleIDLTest2"></property>
<property name="invoker" ref="simpleIDLInvoker"></property>
<property name="inputClass" value="com.baidu.bjf.StringMessagePOJO"></property>
<property name="outputClass" value="com.baidu.bjf.StringMessagePOJO"></property>
</bean>

<bean id="simpleIDLInvoker" class="com.baidu.bjf.SimpleIDLInvoker"></bean>
```
<pre>
inputClass 属性表示接收的JProtobuf注解POJO类
outputClass 属性表示返回的JProtobuf注解POJO类
serviceName 服务名称,必须填写。 在服务的servlet发布后,服务名称会以path路径方式查找
invoker 服务回调实现,必须实现 com.baidu.jprotobuf.rpc.server.ServerInvoker接口
</pre>

```java
public interface ServerInvoker {

Expand Down

0 comments on commit dcca138

Please sign in to comment.