This commit is contained in:
Redkale
2016-08-30 02:13:56 +08:00
parent 81f386dcdb
commit a206ecd76b
8 changed files with 30 additions and 20 deletions

View File

@@ -23,8 +23,8 @@ public class _DynHelloRestServlet1 extends SimpleRestServlet {
HelloService service = new HelloService();
HttpServer server = new HttpServer();
server.addRestServlet(HelloService.class, "", service, SimpleRestServlet.class, "/pipes", null);
server.addRestServlet(HelloService.class, "my-res", new HelloService(3), SimpleRestServlet.class, "/pipes", null);
server.addRestServlet(HelloService.class, "", service, SimpleRestServlet.class, "/pipes");
server.addRestServlet(HelloService.class, "my-res", new HelloService(3), SimpleRestServlet.class, "/pipes");
DefaultAnyValue conf = DefaultAnyValue.create("port", "" + port);
server.init(conf);

View File

@@ -154,7 +154,7 @@ public class SncpTest {
final Transport transport = new Transport("", WatchFactory.root(), "", newBufferPool(), newChannelGroup(), null, set);
SncpTestService service = Sncp.createLocalService("", null, ResourceFactory.root(), SncpTestService.class, addr, transport, null);
ResourceFactory.root().inject(service);
server.addService(new ServiceWrapper(service, "", "", new HashSet<>(), null));
server.addSncpServlet(new ServiceWrapper(service, "", "", new HashSet<>(), null));
System.out.println(service);
AnyValue.DefaultAnyValue conf = new AnyValue.DefaultAnyValue();
conf.addValue("host", "0.0.0.0");
@@ -187,7 +187,7 @@ public class SncpTest {
//String name, WatchFactory, ObjectPool<ByteBuffer>, AsynchronousChannelGroup, InetSocketAddress clientAddress, Collection<InetSocketAddress>
final Transport transport = new Transport("", WatchFactory.root(), "", newBufferPool(), newChannelGroup(), null, set);
Service service = Sncp.createLocalService("", null, ResourceFactory.root(), SncpTestService.class, addr, transport, null);
server.addService(new ServiceWrapper(service, "", "", new HashSet<>(), null));
server.addSncpServlet(new ServiceWrapper(service, "", "", new HashSet<>(), null));
AnyValue.DefaultAnyValue conf = new AnyValue.DefaultAnyValue();
conf.addValue("host", "0.0.0.0");
conf.addValue("port", "" + port2);

View File

@@ -18,6 +18,7 @@ import org.redkale.convert.json.*;
public class SncpTestBean implements FilterBean {
@Id
@GeneratedValue
private long id;
private String content;