test_class.declarator: protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExtension()
test_class.modifier: private
test_class.original_string: private Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExtension();
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: exporters = new ArrayList<Exporter<?>>()
test_class.modifier: private
test_class.original_string: private List<Exporter<?>> exporters = new ArrayList<Exporter<?>>();
test_class.type: List<Exporter<?>>
test_class.var_name: exporters
test_class.file: dubbo-rpc/dubbo-rpc-injvm/src/test/java/com/alibaba/dubbo/rpc/protocol/injvm/InjvmProtocolTest.java
test_class.identifier: InjvmProtocolTest
test_case.body: @Test
      public void testIsInjvmRefer() throws Exception {
          DemoService service = new DemoServiceImpl();
          URL url = URL.valueOf("injvm://127.0.0.1/TestService")
                  .addParameter(Constants.INTERFACE_KEY, DemoService.class.getName());
          Exporter<?> exporter = protocol.export(proxy.getInvoker(service, DemoService.class, url));
          exporters.add(exporter);
  
          url = url.setProtocol("dubbo");
          assertTrue(InjvmProtocol.getInjvmProtocol().isInjvmRefer(url));
  
          url = url.addParameter(Constants.GROUP_KEY, "*")
                  .addParameter(Constants.VERSION_KEY, "*");
          assertTrue(InjvmProtocol.getInjvmProtocol().isInjvmRefer(url));
      }
test_case.class_method_signature: InjvmProtocolTest.testIsInjvmRefer()
test_case.full_signature: @Test public void testIsInjvmRefer()
test_case.identifier: testIsInjvmRefer
test_case.invocations: addParameter valueOf getName export getInvoker add setProtocol assertTrue isInjvmRefer getInjvmProtocol addParameter addParameter assertTrue isInjvmRefer getInjvmProtocol
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testIsInjvmRefer()
focal_class.declarator: NAME = Constants.LOCAL_PROTOCOL
focal_class.modifier: public static final
focal_class.original_string: public static final String NAME = Constants.LOCAL_PROTOCOL;
focal_class.type: String
focal_class.var_name: NAME
focal_class.declarator: DEFAULT_PORT = 0
focal_class.modifier: public static final
focal_class.original_string: public static final int DEFAULT_PORT = 0;
focal_class.type: int
focal_class.var_name: DEFAULT_PORT
focal_class.declarator: INSTANCE
focal_class.modifier: private static
focal_class.original_string: private static InjvmProtocol INSTANCE;
focal_class.type: InjvmProtocol
focal_class.var_name: INSTANCE
focal_class.file: dubbo-rpc/dubbo-rpc-injvm/src/main/java/com/alibaba/dubbo/rpc/protocol/injvm/InjvmProtocol.java
focal_class.identifier: InjvmProtocol
focal_class.interfaces: implements Protocol
focal_class.class_method_signature: InjvmProtocol.InjvmProtocol()
focal_class.full_signature: public  InjvmProtocol()
focal_class.identifier: InjvmProtocol
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  InjvmProtocol()
focal_class.class_method_signature: InjvmProtocol.getInjvmProtocol()
focal_class.full_signature: public static InjvmProtocol getInjvmProtocol()
focal_class.identifier: getInjvmProtocol
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: InjvmProtocol
focal_class.signature: InjvmProtocol getInjvmProtocol()
focal_class.class_method_signature: InjvmProtocol.getExporter(Map<String, Exporter<?>> map, URL key)
focal_class.full_signature: static Exporter<?> getExporter(Map<String, Exporter<?>> map, URL key)
focal_class.identifier: getExporter
focal_class.modifiers: static
focal_class.parameters: (Map<String, Exporter<?>> map, URL key)
focal_class.return: Exporter<?>
focal_class.signature: Exporter<?> getExporter(Map<String, Exporter<?>> map, URL key)
focal_class.class_method_signature: InjvmProtocol.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: InjvmProtocol.export(Invoker<T> invoker)
focal_class.full_signature: @Override public Exporter<T> export(Invoker<T> invoker)
focal_class.identifier: export
focal_class.modifiers: @Override public
focal_class.parameters: (Invoker<T> invoker)
focal_class.return: Exporter<T>
focal_class.signature: Exporter<T> export(Invoker<T> invoker)
focal_class.class_method_signature: InjvmProtocol.refer(Class<T> serviceType, URL url)
focal_class.full_signature: @Override public Invoker<T> refer(Class<T> serviceType, URL url)
focal_class.identifier: refer
focal_class.modifiers: @Override public
focal_class.parameters: (Class<T> serviceType, URL url)
focal_class.return: Invoker<T>
focal_class.signature: Invoker<T> refer(Class<T> serviceType, URL url)
focal_class.class_method_signature: InjvmProtocol.isInjvmRefer(URL url)
focal_class.full_signature: public boolean isInjvmRefer(URL url)
focal_class.identifier: isInjvmRefer
focal_class.modifiers: public
focal_class.parameters: (URL url)
focal_class.return: boolean
focal_class.signature: boolean isInjvmRefer(URL url)
focal_class.superclass: extends AbstractProtocol
focal_method.body: public boolean isInjvmRefer(URL url) {
          final boolean isJvmRefer;
          String scope = url.getParameter(Constants.SCOPE_KEY);
          // Since injvm protocol is configured explicitly, we don't need to set any extra flag, use normal refer process.
          if (Constants.LOCAL_PROTOCOL.toString().equals(url.getProtocol())) {
              isJvmRefer = false;
          } else if (Constants.SCOPE_LOCAL.equals(scope) || (url.getParameter("injvm", false))) {
              // if it's declared as local reference
              // 'scope=local' is equivalent to 'injvm=true', injvm will be deprecated in the future release
              isJvmRefer = true;
          } else if (Constants.SCOPE_REMOTE.equals(scope)) {
              // it's declared as remote reference
              isJvmRefer = false;
          } else if (url.getParameter(Constants.GENERIC_KEY, false)) {
              // generic invocation is not local reference
              isJvmRefer = false;
          } else if (getExporter(exporterMap, url) != null) {
              // by default, go through local reference if there's the service exposed locally
              isJvmRefer = true;
          } else {
              isJvmRefer = false;
          }
          return isJvmRefer;
      }
focal_method.class_method_signature: InjvmProtocol.isInjvmRefer(URL url)
focal_method.full_signature: public boolean isInjvmRefer(URL url)
focal_method.identifier: isInjvmRefer
focal_method.invocations: getParameter equals toString getProtocol equals getParameter equals getParameter getExporter
focal_method.modifiers: public
focal_method.parameters: (URL url)
focal_method.return: boolean
focal_method.signature: boolean isInjvmRefer(URL url)