This commit is contained in:
20
test/org/redkale/test/sncp/SncpTestIService.java
Normal file
20
test/org/redkale/test/sncp/SncpTestIService.java
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* 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.service.*;
|
||||||
|
import org.redkale.source.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author zhangjx
|
||||||
|
*/
|
||||||
|
public interface SncpTestIService extends Service {
|
||||||
|
|
||||||
|
public void insert(@DynCall(DataCallArrayAttribute.class) SncpTestBean... beans);
|
||||||
|
|
||||||
|
public String updateBean(@DynCall(SncpTestService.CallAttribute.class) SncpTestBean bean);
|
||||||
|
}
|
||||||
@@ -9,17 +9,15 @@ import java.lang.reflect.*;
|
|||||||
import java.net.*;
|
import java.net.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import org.redkale.net.sncp.*;
|
import org.redkale.net.sncp.*;
|
||||||
import org.redkale.service.Service;
|
import org.redkale.service.*;
|
||||||
import org.redkale.util.Attribute;
|
import org.redkale.util.Attribute;
|
||||||
import org.redkale.service.MultiRun;
|
|
||||||
import org.redkale.source.DataCallArrayAttribute;
|
import org.redkale.source.DataCallArrayAttribute;
|
||||||
import org.redkale.service.DynCall;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author zhangjx
|
* @author zhangjx
|
||||||
*/
|
*/
|
||||||
public class SncpTestService implements Service {
|
public class SncpTestService implements SncpTestIService {
|
||||||
|
|
||||||
public static class CallAttribute implements Attribute<SncpTestBean, Long> {
|
public static class CallAttribute implements Attribute<SncpTestBean, Long> {
|
||||||
|
|
||||||
@@ -71,7 +69,7 @@ public class SncpTestService implements Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
SncpTestService service = Sncp.createLocalService("", null, SncpTestService.class, new InetSocketAddress("127.0.0.1", 7070), new HashSet(), null, null);
|
Service service = Sncp.createLocalService("", null, SncpTestService.class, new InetSocketAddress("127.0.0.1", 7070), new HashSet(), null, null);
|
||||||
for(Method method :service.getClass().getDeclaredMethods()) {
|
for(Method method :service.getClass().getDeclaredMethods()) {
|
||||||
System.out.println(method);
|
System.out.println(method);
|
||||||
}
|
}
|
||||||
@@ -88,6 +86,14 @@ public class SncpTestService implements Service {
|
|||||||
for(Method method :SncpClient.parseMethod(service.getClass())) {
|
for(Method method :SncpClient.parseMethod(service.getClass())) {
|
||||||
System.out.println(method);
|
System.out.println(method);
|
||||||
}
|
}
|
||||||
|
System.out.println("-----------------------------------");service = Sncp.createRemoteService("", null, SncpTestIService.class, new InetSocketAddress("127.0.0.1", 7070), new HashSet(), null);
|
||||||
|
for(Method method :service.getClass().getDeclaredMethods()) {
|
||||||
|
System.out.println(method);
|
||||||
|
}
|
||||||
|
System.out.println("-----------------------------------");
|
||||||
|
for(Method method :SncpClient.parseMethod(service.getClass())) {
|
||||||
|
System.out.println(method);
|
||||||
|
}
|
||||||
System.out.println("-----------------------------------");
|
System.out.println("-----------------------------------");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user