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/org/apache/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(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(GROUP_KEY, "*")
                  .addParameter(VERSION_KEY, "*");
          assertTrue(InjvmProtocol.getInjvmProtocol().isInjvmRefer(url));
  
          url = URL.valueOf("fake://127.0.0.1/TestService").addParameter(SCOPE_KEY, SCOPE_LOCAL);
          assertTrue(InjvmProtocol.getInjvmProtocol().isInjvmRefer(url));
  
          url = URL.valueOf("fake://127.0.0.1/TestService").addParameter(LOCAL_PROTOCOL, true);
          assertTrue(InjvmProtocol.getInjvmProtocol().isInjvmRefer(url));
  
          url = URL.valueOf("fake://127.0.0.1/TestService").addParameter(SCOPE_KEY, SCOPE_REMOTE);
          assertFalse(InjvmProtocol.getInjvmProtocol().isInjvmRefer(url));
  
          url = URL.valueOf("fake://127.0.0.1/TestService").addParameter(GENERIC_KEY, true);
          assertFalse(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 addParameter valueOf assertTrue isInjvmRefer getInjvmProtocol addParameter valueOf assertTrue isInjvmRefer getInjvmProtocol addParameter valueOf assertFalse isInjvmRefer getInjvmProtocol addParameter valueOf assertFalse isInjvmRefer getInjvmProtocol
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testIsInjvmRefer()
focal_class.declarator: NAME = LOCAL_PROTOCOL
focal_class.modifier: public static final
focal_class.original_string: public static final String NAME = 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/org/apache/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.protocolBindingRefer(Class<T> serviceType, URL url)
focal_class.full_signature: @Override public Invoker<T> protocolBindingRefer(Class<T> serviceType, URL url)
focal_class.identifier: protocolBindingRefer
focal_class.modifiers: @Override public
focal_class.parameters: (Class<T> serviceType, URL url)
focal_class.return: Invoker<T>
focal_class.signature: Invoker<T> protocolBindingRefer(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) {
          String scope = url.getParameter(SCOPE_KEY);
          // Since injvm protocol is configured explicitly, we don't need to set any extra flag, use normal refer process.
          if (SCOPE_LOCAL.equals(scope) || (url.getParameter(LOCAL_PROTOCOL, false))) {
              // if it's declared as local reference
              // 'scope=local' is equivalent to 'injvm=true', injvm will be deprecated in the future release
              return true;
          } else if (SCOPE_REMOTE.equals(scope)) {
              // it's declared as remote reference
              return false;
          } else if (url.getParameter(GENERIC_KEY, false)) {
              // generic invocation is not local reference
              return false;
          } else if (getExporter(exporterMap, url) != null) {
              // by default, go through local reference if there's the service exposed locally
              return true;
          } else {
              return false;
          }
      }
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 getParameter equals getParameter getExporter
focal_method.modifiers: public
focal_method.parameters: (URL url)
focal_method.return: boolean
focal_method.signature: boolean isInjvmRefer(URL url)