Skip to content

Commit

Permalink
Merge branch 'release/0.0.5' of git@github.com:fritzprix/rmover-json.…
Browse files Browse the repository at this point in the history
…git into release/0.0.5
  • Loading branch information
fritzprix committed Nov 25, 2018
2 parents befbd6a + 7ea151c commit 540e7fe
Show file tree
Hide file tree
Showing 51 changed files with 2,408 additions and 808 deletions.
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<p align="center"><img src="https://s33.postimg.cc/getb2kc33/LOGO_YARMI_Hzt_500px.png"></p>

yarmi is yet anotehr RMI based on JSON. it's simple yet powerful when developing server & client based distributed application within a network of small scale
yarmi is yet-another remote method invocation framework for simple distributed service architecture which provides service discovery mechanism out of the box.

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/5c9f40d574c64e629af11f284c447bea)](https://www.codacy.com/app/innocentevil0914/yarmi?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=fritzprix/yarmi&amp;utm_campaign=Badge_Grade)

### Features
1. Support large blob as method parameter or response
1. Simple APIs
> discover and request service with just a few API calls
2. Support large blob as method parameter or response
> yarmi supports blob exchange between client and server by default with BlobSession which exposes familiar read / write APIs
2. Provide service discovery out-of-the-box
> yarmi contains simple service discovery feature and also support another type of service discovery (e.g. DNS-SD) as module
3. Support various transport
> yarmi also provides abstraction over transport layer so it can over any kinds of transport like tcp / ip or bluetooth rfcomm.
4. Zero-cost migration to (from) RESTful application
> Provides conceptual similarity to popular RESTful application framework (like service / controller mapping).
> and that means not only the migration from / to RESTful implementation is easy
> but also implementing proxy for any RESTful service in heterogeneous network scenario (like typical IoT application) is also well supported
3. Provide service discovery out-of-the-box
> service discovery is provided out of the box which is not dependent on any other lookup service.
4. Extensible design
> yarmi core itself is agnostic to network / messaging / discovery / negotiation implementation.


### How-To
Expand Down Expand Up @@ -42,7 +41,7 @@ yarmi is yet anotehr RMI based on JSON. it's simple yet powerful when developing
<dependency>
<groupId>com.doodream</groupId>
<artifactId>yarmi-core</artifactId>
<version>0.0.4</version>
<version>0.0.5</version>
</dependency>
</dependencies>
```
Expand Down Expand Up @@ -148,8 +147,8 @@ public static class SimpleClient {
SimpleServiceDiscovery discovery = new SimpleServiceDiscovery();
discovery.startDiscovery(TestService.class, new ServiceDiscoveryListener() {
@Override
public void onDiscovered(RMIServiceProxy proxy) {
discoveredService.add(proxy);
public void onDiscovered(RMIServiceInfo info) {
discoveredService.add(RMIServiceInfo.toServiceProxy(info));
}

@Override
Expand Down
18 changes: 9 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -153,19 +153,19 @@
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>bson</artifactId>
<version>3.2.2</version>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.9.6</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.3.0-alpha4</version>
<groupId>de.undercouch</groupId>
<artifactId>bson4jackson</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-access</artifactId>
<version>1.3.0-alpha4</version>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/com/doodream/rmovjs/annotation/RMIException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.doodream.rmovjs.annotation;

import com.doodream.rmovjs.model.Response;

public class RMIException extends RuntimeException {
private int code;

public RMIException(Response response) {
super((String) response.getBody());
code = response.getCode();
}

public int code() {
return code;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
import com.doodream.rmovjs.net.SimpleNegotiator;
import com.doodream.rmovjs.net.tcp.TcpServiceAdapter;
import com.doodream.rmovjs.serde.Converter;
import com.doodream.rmovjs.serde.json.JsonConverter;
import com.doodream.rmovjs.serde.bson.BsonConverter;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
* Service Annotation
* Created by innocentevil on 18. 5. 4.
*/

Expand All @@ -34,14 +35,14 @@
Class<? extends ServiceAdapter> adapter() default TcpServiceAdapter.class;

/**
* parameters for constrcutor of network adapter class, will be passed as argument whenever the adapter class
* needs to be instanciated.
* parameters for constructor of network adapter class, will be passed as argument whenever the adapter class
* needs to be instantiated.
* the order of parameters will be kept in the process of ser-der.
* @return parameters to adapter constructor
*/
String[] params() default {};

Class<? extends RMINegotiator> negotiator() default SimpleNegotiator.class;

Class<? extends Converter> converter() default JsonConverter.class;
Class<? extends Converter> converter() default BsonConverter.class;
}
Loading

0 comments on commit 540e7fe

Please sign in to comment.