This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
28
test/org/redkale/test/sncp/_DynLocalSncpTestService.java
Normal file
28
test/org/redkale/test/sncp/_DynLocalSncpTestService.java
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user