This commit is contained in:
Redkale
2017-11-15 21:06:17 +08:00
parent bf88c4da06
commit 0bd5787992
3 changed files with 36 additions and 0 deletions

View File

@@ -17,6 +17,8 @@ public interface SncpTestIService extends Service {
public String queryResult(SncpTestBean bean);
public double queryDoubleResult(String a, int b, double value);
public long queryLongResult(String a, int b, long value);
public CompletableFuture<String> queryResultAsync(SncpTestBean bean);

View File

@@ -47,6 +47,12 @@ public class SncpTestServiceImpl implements SncpTestIService {
return value + 1;
}
@Override
@RpcMultiRun
public double queryDoubleResult(String a, int b, double value) {
return value + 1;
}
public static class CallAttribute implements Attribute<SncpTestBean, Long> {
@Override

View File

@@ -0,0 +1,28 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.redkale.test.sncp;
import org.redkale.net.sncp.*;
import org.redkale.util.ResourceType;
/**
*
* @author zhangjx
*/
@ResourceType(SncpTestIService.class)
public class _DynLocalSncpTestService extends SncpTestServiceImpl {
private SncpClient _redkale_client;
@SncpDyn(remote = false, index = 1)
public long _redkale_queryLongResult(boolean selfrunnable, boolean samerunnable, boolean diffrunnable, String a, int b, long value) {
long rs = super.queryLongResult(a, b, value);
if (_redkale_client == null) return rs;
if (samerunnable) _redkale_client.remoteSameGroup(1, true, false, false, a, b, value);
if (diffrunnable) _redkale_client.remoteDiffGroup(1, true, true, false, a, b, value);
return rs;
}
}