This commit is contained in:
@@ -82,7 +82,7 @@ public class SncpTest {
|
|||||||
if (port2 > 0) set.add(new InetSocketAddress(myhost, port2));
|
if (port2 > 0) set.add(new InetSocketAddress(myhost, port2));
|
||||||
//String name, WatchFactory, ObjectPool<ByteBuffer>, AsynchronousChannelGroup, InetSocketAddress clientAddress, Collection<InetSocketAddress>
|
//String name, WatchFactory, ObjectPool<ByteBuffer>, AsynchronousChannelGroup, InetSocketAddress clientAddress, Collection<InetSocketAddress>
|
||||||
final Transport transport = new Transport("", WatchFactory.root(), "", newBufferPool(), newChannelGroup(), null, set);
|
final Transport transport = new Transport("", WatchFactory.root(), "", newBufferPool(), newChannelGroup(), null, set);
|
||||||
final SncpTestService service = Sncp.createRemoteService(serviceName, null, SncpTestService.class, null, transport);
|
final SncpTestIService service = Sncp.createRemoteService(serviceName, null, SncpTestIService.class, null, transport);
|
||||||
ResourceFactory.root().inject(service);
|
ResourceFactory.root().inject(service);
|
||||||
|
|
||||||
// SncpTestBean bean = new SncpTestBean();
|
// SncpTestBean bean = new SncpTestBean();
|
||||||
@@ -152,7 +152,7 @@ public class SncpTest {
|
|||||||
if (port2 > 0) set.add(new InetSocketAddress(myhost, port2));
|
if (port2 > 0) set.add(new InetSocketAddress(myhost, port2));
|
||||||
//String name, WatchFactory, ObjectPool<ByteBuffer>, AsynchronousChannelGroup, InetSocketAddress clientAddress, Collection<InetSocketAddress>
|
//String name, WatchFactory, ObjectPool<ByteBuffer>, AsynchronousChannelGroup, InetSocketAddress clientAddress, Collection<InetSocketAddress>
|
||||||
final Transport transport = new Transport("", WatchFactory.root(), "", newBufferPool(), newChannelGroup(), null, set);
|
final Transport transport = new Transport("", WatchFactory.root(), "", newBufferPool(), newChannelGroup(), null, set);
|
||||||
SncpTestService service = Sncp.createLocalService("", null, ResourceFactory.root(), SncpTestService.class, addr, transport, null);
|
SncpTestIService service = Sncp.createLocalService("", null, ResourceFactory.root(), SncpTestServiceImpl.class, addr, transport, null);
|
||||||
ResourceFactory.root().inject(service);
|
ResourceFactory.root().inject(service);
|
||||||
server.addSncpServlet(new ServiceWrapper(service, "", "", new HashSet<>(), null));
|
server.addSncpServlet(new ServiceWrapper(service, "", "", new HashSet<>(), null));
|
||||||
System.out.println(service);
|
System.out.println(service);
|
||||||
@@ -186,7 +186,7 @@ public class SncpTest {
|
|||||||
set.add(new InetSocketAddress(myhost, port));
|
set.add(new InetSocketAddress(myhost, port));
|
||||||
//String name, WatchFactory, ObjectPool<ByteBuffer>, AsynchronousChannelGroup, InetSocketAddress clientAddress, Collection<InetSocketAddress>
|
//String name, WatchFactory, ObjectPool<ByteBuffer>, AsynchronousChannelGroup, InetSocketAddress clientAddress, Collection<InetSocketAddress>
|
||||||
final Transport transport = new Transport("", WatchFactory.root(), "", newBufferPool(), newChannelGroup(), null, set);
|
final Transport transport = new Transport("", WatchFactory.root(), "", newBufferPool(), newChannelGroup(), null, set);
|
||||||
Service service = Sncp.createLocalService("", null, ResourceFactory.root(), SncpTestService.class, addr, transport, null);
|
Service service = Sncp.createLocalService("", null, ResourceFactory.root(), SncpTestServiceImpl.class, addr, transport, null);
|
||||||
server.addSncpServlet(new ServiceWrapper(service, "", "", new HashSet<>(), null));
|
server.addSncpServlet(new ServiceWrapper(service, "", "", new HashSet<>(), null));
|
||||||
AnyValue.DefaultAnyValue conf = new AnyValue.DefaultAnyValue();
|
AnyValue.DefaultAnyValue conf = new AnyValue.DefaultAnyValue();
|
||||||
conf.addValue("host", "0.0.0.0");
|
conf.addValue("host", "0.0.0.0");
|
||||||
|
|||||||
@@ -18,5 +18,5 @@ public interface SncpTestIService extends Service {
|
|||||||
|
|
||||||
public void insert(@RpcCall(DataCallArrayAttribute.class) SncpTestBean... beans);
|
public void insert(@RpcCall(DataCallArrayAttribute.class) SncpTestBean... beans);
|
||||||
|
|
||||||
public String updateBean(@RpcCall(SncpTestService.CallAttribute.class) SncpTestBean bean);
|
public String updateBean(@RpcCall(SncpTestServiceImpl.CallAttribute.class) SncpTestBean bean);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ import org.redkale.util.*;
|
|||||||
*
|
*
|
||||||
* @author zhangjx
|
* @author zhangjx
|
||||||
*/
|
*/
|
||||||
@ResourceType({SncpTestIService.class, SncpTestService.class})
|
@ResourceType({SncpTestIService.class})
|
||||||
public class SncpTestService implements SncpTestIService {
|
public class SncpTestServiceImpl implements SncpTestIService {
|
||||||
|
|
||||||
public static class CallAttribute implements Attribute<SncpTestBean, Long> {
|
public static class CallAttribute implements Attribute<SncpTestBean, Long> {
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ public class SncpTestService implements SncpTestIService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
Service service = Sncp.createLocalService("", null, ResourceFactory.root(), SncpTestService.class, new InetSocketAddress("127.0.0.1", 7070), null, null);
|
Service service = Sncp.createLocalService("", null, ResourceFactory.root(), SncpTestServiceImpl.class, new InetSocketAddress("127.0.0.1", 7070), null, null);
|
||||||
for (Method method : service.getClass().getDeclaredMethods()) {
|
for (Method method : service.getClass().getDeclaredMethods()) {
|
||||||
System.out.println(method);
|
System.out.println(method);
|
||||||
}
|
}
|
||||||
@@ -83,7 +83,7 @@ public class SncpTestService implements SncpTestIService {
|
|||||||
System.out.println(method);
|
System.out.println(method);
|
||||||
}
|
}
|
||||||
System.out.println("-----------------------------------");
|
System.out.println("-----------------------------------");
|
||||||
service = Sncp.createRemoteService("", null, SncpTestService.class, new InetSocketAddress("127.0.0.1", 7070), null);
|
service = Sncp.createRemoteService("", null, SncpTestServiceImpl.class, new InetSocketAddress("127.0.0.1", 7070), null);
|
||||||
for (Method method : service.getClass().getDeclaredMethods()) {
|
for (Method method : service.getClass().getDeclaredMethods()) {
|
||||||
System.out.println(method);
|
System.out.println(method);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user