@Test public void testHttpProtocol() { HttpServiceImpl server = new HttpServiceImpl(); Assert.assertFalse(server.isCalled()); ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension(); Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExtension(); URL url = URL.valueOf("http: Exporter<HttpService> exporter = protocol.export(proxyFactory.getInvoker(server, HttpService.class, url)); Invoker<HttpService> invoker = protocol.refer(HttpService.class, url); HttpService client = proxyFactory.getProxy(invoker); String result = client.sayHello("haha"); Assert.assertTrue(server.isCalled()); Assert.assertEquals("Hello, haha", result); invoker.destroy(); exporter.unexport(); }
public HttpProtocol() { super(RemoteAccessException.class); }
HttpProtocol extends AbstractProxyProtocol { public HttpProtocol() { super(RemoteAccessException.class); } }
HttpProtocol extends AbstractProxyProtocol { public HttpProtocol() { super(RemoteAccessException.class); } HttpProtocol(); }
HttpProtocol extends AbstractProxyProtocol { public HttpProtocol() { super(RemoteAccessException.class); } HttpProtocol(); void setHttpBinder(HttpBinder httpBinder); @Override int getDefaultPort(); }
HttpProtocol extends AbstractProxyProtocol { public HttpProtocol() { super(RemoteAccessException.class); } HttpProtocol(); void setHttpBinder(HttpBinder httpBinder); @Override int getDefaultPort(); static final int DEFAULT_PORT; }