Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sangupta/rni
RPC Negotiable Interfaces in Java
https://github.com/sangupta/rni
Last synced: 4 days ago
JSON representation
RPC Negotiable Interfaces in Java
- Host: GitHub
- URL: https://github.com/sangupta/rni
- Owner: sangupta
- License: other
- Created: 2016-05-24T18:28:38.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-07-07T21:17:14.000Z (over 2 years ago)
- Last Synced: 2024-04-16T11:17:29.098Z (7 months ago)
- Language: Java
- Size: 16.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rni
`rni` or **RPC Negotiable Interfaces** is a library to massively speed up the development of distributed
applications in Java. It exposes any standard **Java Interface** over REST webservices to be consumed and
allows the developer to focus more on business functionality.Given a `java interface` you can wire two different applications in less than 5 minutes, and 3 lines of code.
For details see the example below.**NOTE**: The library is meant to be used during early development cycles and then replaces with something
better as in `Apache Thrift` or otherwise.A few other parallels that are available include:
* Apache Thrift (using Facebook swift library)
* Motan - https://github.com/weibocom/motan## Usage
Say you have an interface `PersonInterface.java` as:
```java
public interface PersonInterface {
public Person getPerson(String id);
public String getPerson(Person person);public String createPerson(Person person);
}
```Say we have an implementating class for the same as `PersonInterfaceImpl.java`:
```java
public class PersonInterfaceImpl implements PersonInterface {// implementation methods
}
```Generate a `webservice` using `HttpServlet` as:
```java
// register the interface to receive calls
RPCReceivingServlet.recieveCalls(PersonInterface.class, new PersonInterfaceImpl());
``````xml
Handles RNI calls
RNI-Servlet
rni
com.sangupta.rni.RPCReceivingServlet
1rni
/rni/*```
To make calls from a second application (aka the client application):
```java
PersonInterface clientProxy = WebClientGenerator.createWebClient(PersonInterface.class, "localhost", 8080, "/rni/");// make regular calls like
Person person = clientProxy.getPerson("person-id-123");
```## License
```
rni - rpc negotiable interfaces
Copyright (c) 2016, Sandeep Guptahttp://sangupta.com/projects/rni
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 athttp://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.
```