test_class.file: dubbo-rpc/dubbo-rpc-http/src/test/java/org/apache/dubbo/rpc/protocol/http/HttpProtocolTest.java
test_class.identifier: HttpProtocolTest
test_case.body: @Test
      public void testJsonrpcProtocol() {
          HttpServiceImpl server = new HttpServiceImpl();
          assertFalse(server.isCalled());
          ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension();
          Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExtension();
          int port = NetUtils.getAvailablePort();
          URL url = URL.valueOf("http://127.0.0.1:" + port + "/" + HttpService.class.getName() + "?version=1.0.0");
          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");
          assertTrue(server.isCalled());
          assertEquals("Hello, haha", result);
          invoker.destroy();
          exporter.unexport();
      }
test_case.class_method_signature: HttpProtocolTest.testJsonrpcProtocol()
test_case.full_signature: @Test public void testJsonrpcProtocol()
test_case.identifier: testJsonrpcProtocol
test_case.invocations: assertFalse isCalled getAdaptiveExtension getExtensionLoader getAdaptiveExtension getExtensionLoader getAvailablePort valueOf getName export getInvoker refer getProxy sayHello assertTrue isCalled assertEquals destroy unexport
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testJsonrpcProtocol()
focal_class.declarator: ACCESS_CONTROL_ALLOW_ORIGIN_HEADER = "Access-Control-Allow-Origin"
focal_class.modifier: public static final
focal_class.original_string: public static final String ACCESS_CONTROL_ALLOW_ORIGIN_HEADER = "Access-Control-Allow-Origin";
focal_class.type: String
focal_class.var_name: ACCESS_CONTROL_ALLOW_ORIGIN_HEADER
focal_class.declarator: ACCESS_CONTROL_ALLOW_METHODS_HEADER = "Access-Control-Allow-Methods"
focal_class.modifier: public static final
focal_class.original_string: public static final String ACCESS_CONTROL_ALLOW_METHODS_HEADER = "Access-Control-Allow-Methods";
focal_class.type: String
focal_class.var_name: ACCESS_CONTROL_ALLOW_METHODS_HEADER
focal_class.declarator: ACCESS_CONTROL_ALLOW_HEADERS_HEADER = "Access-Control-Allow-Headers"
focal_class.modifier: public static final
focal_class.original_string: public static final String ACCESS_CONTROL_ALLOW_HEADERS_HEADER = "Access-Control-Allow-Headers";
focal_class.type: String
focal_class.var_name: ACCESS_CONTROL_ALLOW_HEADERS_HEADER
focal_class.declarator: skeletonMap = new ConcurrentHashMap<>()
focal_class.modifier: private final
focal_class.original_string: private final Map<String, JsonRpcServer> skeletonMap = new ConcurrentHashMap<>();
focal_class.type: Map<String, JsonRpcServer>
focal_class.var_name: skeletonMap
focal_class.declarator: httpBinder
focal_class.modifier: private
focal_class.original_string: private HttpBinder httpBinder;
focal_class.type: HttpBinder
focal_class.var_name: httpBinder
focal_class.file: dubbo-rpc/dubbo-rpc-http/src/main/java/org/apache/dubbo/rpc/protocol/http/HttpProtocol.java
focal_class.identifier: HttpProtocol
focal_class.class_method_signature: HttpProtocol.HttpProtocol()
focal_class.full_signature: public  HttpProtocol()
focal_class.identifier: HttpProtocol
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  HttpProtocol()
focal_class.class_method_signature: HttpProtocol.setHttpBinder(HttpBinder httpBinder)
focal_class.full_signature: public void setHttpBinder(HttpBinder httpBinder)
focal_class.identifier: setHttpBinder
focal_class.modifiers: public
focal_class.parameters: (HttpBinder httpBinder)
focal_class.return: void
focal_class.signature: void setHttpBinder(HttpBinder httpBinder)
focal_class.class_method_signature: HttpProtocol.getDefaultPort()
focal_class.full_signature: @Override public int getDefaultPort()
focal_class.identifier: getDefaultPort
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getDefaultPort()
focal_class.class_method_signature: HttpProtocol.doExport(final T impl, Class<T> type, URL url)
focal_class.full_signature: @Override protected Runnable doExport(final T impl, Class<T> type, URL url)
focal_class.identifier: doExport
focal_class.modifiers: @Override protected
focal_class.parameters: (final T impl, Class<T> type, URL url)
focal_class.return: Runnable
focal_class.signature: Runnable doExport(final T impl, Class<T> type, URL url)
focal_class.class_method_signature: HttpProtocol.doRefer(final Class<T> serviceType, URL url)
focal_class.full_signature: @SuppressWarnings("unchecked") @Override protected T doRefer(final Class<T> serviceType, URL url)
focal_class.identifier: doRefer
focal_class.modifiers: @SuppressWarnings("unchecked") @Override protected
focal_class.parameters: (final Class<T> serviceType, URL url)
focal_class.return: T
focal_class.signature: T doRefer(final Class<T> serviceType, URL url)
focal_class.class_method_signature: HttpProtocol.getErrorCode(Throwable e)
focal_class.full_signature: protected int getErrorCode(Throwable e)
focal_class.identifier: getErrorCode
focal_class.modifiers: protected
focal_class.parameters: (Throwable e)
focal_class.return: int
focal_class.signature: int getErrorCode(Throwable e)
focal_class.class_method_signature: HttpProtocol.destroy()
focal_class.full_signature: @Override public void destroy()
focal_class.identifier: destroy
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void destroy()
focal_class.superclass: extends AbstractProxyProtocol
focal_method.body: @Override
      public void destroy() {
          super.destroy();
          for (String key : new ArrayList<>(serverMap.keySet())) {
              ProtocolServer server = serverMap.remove(key);
              if (server != null) {
                  try {
                      if (logger.isInfoEnabled()) {
                          logger.info("Close jsonrpc server " + server.getUrl());
                      }
                      server.close();
                  } catch (Throwable t) {
                      logger.warn(t.getMessage(), t);
                  }
              }
          }
      }
focal_method.class_method_signature: HttpProtocol.destroy()
focal_method.full_signature: @Override public void destroy()
focal_method.identifier: destroy
focal_method.invocations: destroy keySet remove isInfoEnabled info getUrl close warn getMessage
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void destroy()