@Test public void testCustomException() { HessianServiceImpl server = new HessianServiceImpl(); ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension(); Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExtension(); URL url = URL.valueOf("hessian: Exporter<HessianService> exporter = protocol.export(proxyFactory.getInvoker(server, HessianService.class, url)); Invoker<HessianService> invoker = protocol.refer(HessianService.class, url); HessianService client = proxyFactory.getProxy(invoker); try { client.customException(); fail(); } catch (MyException expected) { } invoker.destroy(); exporter.unexport(); }
public void destroy() { super.destroy(); for (String key : new ArrayList<String>(serverMap.keySet())) { HttpServer server = serverMap.remove(key); if (server != null) { try { if (logger.isInfoEnabled()) { logger.info("Close hessian server " + server.getUrl()); } server.close(); } catch (Throwable t) { logger.warn(t.getMessage(), t); } } } }
HessianProtocol extends AbstractProxyProtocol { public void destroy() { super.destroy(); for (String key : new ArrayList<String>(serverMap.keySet())) { HttpServer server = serverMap.remove(key); if (server != null) { try { if (logger.isInfoEnabled()) { logger.info("Close hessian server " + server.getUrl()); } server.close(); } catch (Throwable t) { logger.warn(t.getMessage(), t); } } } } }
HessianProtocol extends AbstractProxyProtocol { public void destroy() { super.destroy(); for (String key : new ArrayList<String>(serverMap.keySet())) { HttpServer server = serverMap.remove(key); if (server != null) { try { if (logger.isInfoEnabled()) { logger.info("Close hessian server " + server.getUrl()); } server.close(); } catch (Throwable t) { logger.warn(t.getMessage(), t); } } } } HessianProtocol(); }
HessianProtocol extends AbstractProxyProtocol { public void destroy() { super.destroy(); for (String key : new ArrayList<String>(serverMap.keySet())) { HttpServer server = serverMap.remove(key); if (server != null) { try { if (logger.isInfoEnabled()) { logger.info("Close hessian server " + server.getUrl()); } server.close(); } catch (Throwable t) { logger.warn(t.getMessage(), t); } } } } HessianProtocol(); void setHttpBinder(HttpBinder httpBinder); int getDefaultPort(); void destroy(); }
HessianProtocol extends AbstractProxyProtocol { public void destroy() { super.destroy(); for (String key : new ArrayList<String>(serverMap.keySet())) { HttpServer server = serverMap.remove(key); if (server != null) { try { if (logger.isInfoEnabled()) { logger.info("Close hessian server " + server.getUrl()); } server.close(); } catch (Throwable t) { logger.warn(t.getMessage(), t); } } } } HessianProtocol(); void setHttpBinder(HttpBinder httpBinder); int getDefaultPort(); void destroy();  }