test_class.declarator: protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getExtension("rest")
test_class.modifier: private
test_class.original_string: private Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getExtension("rest");
test_class.type: Protocol
test_class.var_name: protocol
test_class.declarator: proxy = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension()
test_class.modifier: private
test_class.original_string: private ProxyFactory proxy = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension();
test_class.type: ProxyFactory
test_class.var_name: proxy
test_class.declarator: availablePort = NetUtils.getAvailablePort()
test_class.modifier: private final
test_class.original_string: private final int availablePort = NetUtils.getAvailablePort();
test_class.type: int
test_class.var_name: availablePort
test_class.declarator: exportUrl = URL.valueOf("rest://127.0.0.1:" + availablePort + "/rest?interface=org.apache.dubbo.rpc.protocol.rest.DemoService")
test_class.modifier: private final
test_class.original_string: private final URL exportUrl = URL.valueOf("rest://127.0.0.1:" + availablePort + "/rest?interface=org.apache.dubbo.rpc.protocol.rest.DemoService");
test_class.type: URL
test_class.var_name: exportUrl
test_class.declarator: repository = ApplicationModel.getServiceRepository()
test_class.modifier: private final
test_class.original_string: private final ServiceRepository repository = ApplicationModel.getServiceRepository();
test_class.type: ServiceRepository
test_class.var_name: repository
test_class.file: dubbo-rpc/dubbo-rpc-rest/src/test/java/org/apache/dubbo/rpc/protocol/rest/RestProtocolTest.java
test_class.identifier: RestProtocolTest
test_case.body: @Test
      public void testRemoteApplicationName() {
          URL url = URL.valueOf("rest://127.0.0.1:" + NetUtils.getAvailablePort() + "/rest/say?version=1.0.0&interface=org.apache.dubbo.rpc.protocol.rest.DemoService").addParameter("application", "consumer");
          DemoServiceImpl server = new DemoServiceImpl();
  
          this.registerProvider(url, server, DemoService.class);
  
          Exporter<DemoService> exporter = protocol.export(proxy.getInvoker(server, DemoService.class, url));
          Invoker<DemoService> invoker = protocol.refer(DemoService.class, url);
  
          DemoService client = proxy.getProxy(invoker);
          String result = client.getRemoteApplicationName();
          Assertions.assertEquals("consumer", result);
          invoker.destroy();
          exporter.unexport();
      }
test_case.class_method_signature: RestProtocolTest.testRemoteApplicationName()
test_case.full_signature: @Test public void testRemoteApplicationName()
test_case.identifier: testRemoteApplicationName
test_case.invocations: addParameter valueOf getAvailablePort registerProvider export getInvoker refer getProxy getRemoteApplicationName assertEquals destroy unexport
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRemoteApplicationName()
focal_class.declarator: DEFAULT_PORT = 80
focal_class.modifier: private static final
focal_class.original_string: private static final int DEFAULT_PORT = 80;
focal_class.type: int
focal_class.var_name: DEFAULT_PORT
focal_class.declarator: DEFAULT_SERVER = "jetty"
focal_class.modifier: private static final
focal_class.original_string: private static final String DEFAULT_SERVER = "jetty";
focal_class.type: String
focal_class.var_name: DEFAULT_SERVER
focal_class.declarator: HTTPCLIENTCONNECTIONMANAGER_MAXPERROUTE = 20
focal_class.modifier: private static final
focal_class.original_string: private static final int HTTPCLIENTCONNECTIONMANAGER_MAXPERROUTE = 20;
focal_class.type: int
focal_class.var_name: HTTPCLIENTCONNECTIONMANAGER_MAXPERROUTE
focal_class.declarator: HTTPCLIENTCONNECTIONMANAGER_MAXTOTAL = 20
focal_class.modifier: private static final
focal_class.original_string: private static final int HTTPCLIENTCONNECTIONMANAGER_MAXTOTAL = 20;
focal_class.type: int
focal_class.var_name: HTTPCLIENTCONNECTIONMANAGER_MAXTOTAL
focal_class.declarator: HTTPCLIENT_KEEPALIVEDURATION = 30 * 1000
focal_class.modifier: private static final
focal_class.original_string: private static final int HTTPCLIENT_KEEPALIVEDURATION = 30 * 1000;
focal_class.type: int
focal_class.var_name: HTTPCLIENT_KEEPALIVEDURATION
focal_class.declarator: HTTPCLIENTCONNECTIONMANAGER_CLOSEWAITTIME_MS = 1000
focal_class.modifier: private static final
focal_class.original_string: private static final int HTTPCLIENTCONNECTIONMANAGER_CLOSEWAITTIME_MS = 1000;
focal_class.type: int
focal_class.var_name: HTTPCLIENTCONNECTIONMANAGER_CLOSEWAITTIME_MS
focal_class.declarator: HTTPCLIENTCONNECTIONMANAGER_CLOSEIDLETIME_S = 30
focal_class.modifier: private static final
focal_class.original_string: private static final int HTTPCLIENTCONNECTIONMANAGER_CLOSEIDLETIME_S = 30;
focal_class.type: int
focal_class.var_name: HTTPCLIENTCONNECTIONMANAGER_CLOSEIDLETIME_S
focal_class.declarator: serverFactory = new RestServerFactory()
focal_class.modifier: private final
focal_class.original_string: private final RestServerFactory serverFactory = new RestServerFactory();
focal_class.type: RestServerFactory
focal_class.var_name: serverFactory
focal_class.declarator: clients = Collections.synchronizedList(new LinkedList<>())
focal_class.modifier: private final
focal_class.original_string: private final List<ResteasyClient> clients = Collections.synchronizedList(new LinkedList<>());
focal_class.type: List<ResteasyClient>
focal_class.var_name: clients
focal_class.declarator: connectionMonitor
focal_class.modifier: private volatile
focal_class.original_string: private volatile ConnectionMonitor connectionMonitor;
focal_class.type: ConnectionMonitor
focal_class.var_name: connectionMonitor
focal_class.file: dubbo-rpc/dubbo-rpc-rest/src/main/java/org/apache/dubbo/rpc/protocol/rest/RestProtocol.java
focal_class.identifier: RestProtocol
focal_class.class_method_signature: RestProtocol.RestProtocol()
focal_class.full_signature: public  RestProtocol()
focal_class.identifier: RestProtocol
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  RestProtocol()
focal_class.class_method_signature: RestProtocol.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: RestProtocol.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: RestProtocol.doExport(T impl, Class<T> type, URL url)
focal_class.full_signature: @Override protected Runnable doExport(T impl, Class<T> type, URL url)
focal_class.identifier: doExport
focal_class.modifiers: @Override protected
focal_class.parameters: (T impl, Class<T> type, URL url)
focal_class.return: Runnable
focal_class.signature: Runnable doExport(T impl, Class<T> type, URL url)
focal_class.class_method_signature: RestProtocol.doRefer(Class<T> serviceType, URL url)
focal_class.full_signature: @Override protected T doRefer(Class<T> serviceType, URL url)
focal_class.identifier: doRefer
focal_class.modifiers: @Override protected
focal_class.parameters: (Class<T> serviceType, URL url)
focal_class.return: T
focal_class.signature: T doRefer(Class<T> serviceType, URL url)
focal_class.class_method_signature: RestProtocol.getErrorCode(Throwable e)
focal_class.full_signature: @Override protected int getErrorCode(Throwable e)
focal_class.identifier: getErrorCode
focal_class.modifiers: @Override protected
focal_class.parameters: (Throwable e)
focal_class.return: int
focal_class.signature: int getErrorCode(Throwable e)
focal_class.class_method_signature: RestProtocol.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.class_method_signature: RestProtocol.getContextPath(URL url)
focal_class.full_signature: protected String getContextPath(URL url)
focal_class.identifier: getContextPath
focal_class.modifiers: protected
focal_class.parameters: (URL url)
focal_class.return: String
focal_class.signature: String getContextPath(URL url)
focal_class.superclass: extends AbstractProxyProtocol
focal_method.body: @Override
      public void destroy() {
          super.destroy();
  
          if (connectionMonitor != null) {
              connectionMonitor.shutdown();
          }
  
          for (Map.Entry<String, ProtocolServer> entry : serverMap.entrySet()) {
              try {
                  if (logger.isInfoEnabled()) {
                      logger.info("Closing the rest server at " + entry.getKey());
                  }
                  entry.getValue().close();
              } catch (Throwable t) {
                  logger.warn("Error closing rest server", t);
              }
          }
          serverMap.clear();
  
          if (logger.isInfoEnabled()) {
              logger.info("Closing rest clients");
          }
          for (ResteasyClient client : clients) {
              try {
                  client.close();
              } catch (Throwable t) {
                  logger.warn("Error closing rest client", t);
              }
          }
          clients.clear();
      }
focal_method.class_method_signature: RestProtocol.destroy()
focal_method.full_signature: @Override public void destroy()
focal_method.identifier: destroy
focal_method.invocations: destroy shutdown entrySet isInfoEnabled info getKey close getValue warn clear isInfoEnabled info close warn clear
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void destroy()