jnan77 / jsonrpc4j

Automatically exported from code.google.com/p/jsonrpc4j
0 stars 0 forks source link

Improvement: Specify Path for JsonRpc Service in Annotation on interface #25

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The following would be a great improvement:

<code lang="java">
@JsonRpcPath("Service")
interface Service {
   ...
}
</code>

The interface now describes the contents of the service and the location of the 
service (in relation to the context path). This is analogous to how JAX-RS 
works.

<code lang="java">
@Component
public class ServiceImpl implements Service {
   ...
}
</code>

<code lang="xml">
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
  <bean class="com.googlecode.jsonrpc4j.spring.AutoJsonRpcServiceExporter"/>
</beans>
</code>

This exporter with automatically detect all beans that have the @JsonRpcPath 
annotation and export them on the specified path.

<code lang="xml">
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:p="http://www.springframework.org/schema/p"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

  <bean class="com.googlecode.jsonrpc4j.spring.AutoJsonRpcClientProxyCreator"
    p:baseUrl="http://localhost:8080/the-context/"
    p:scanPackage="..." />

</beans>
</code>

The client side will also use the path specified to automatically create 
proxies by scanning the path.

The attached zip file contains the sources to implement this feature and a 
couple of test cases (+spring contexts).

Original issue reported on code.google.com by maartenw...@gmail.com on 29 May 2012 at 12:18

Attachments:

GoogleCodeExporter commented 8 years ago
Excellent, i'll take a look at it today.

Original comment by brian.di...@gmail.com on 15 Jun 2012 at 4:01

GoogleCodeExporter commented 8 years ago

Original comment by brian.di...@gmail.com on 15 Jun 2012 at 4:01

GoogleCodeExporter commented 8 years ago
Accepted and applied, will be included in next release.

Original comment by brian.di...@gmail.com on 31 Jul 2012 at 6:38