test_class.declarator: invokers = new ArrayList<Invoker<IHelloService>>()
test_class.original_string: List<Invoker<IHelloService>> invokers = new ArrayList<Invoker<IHelloService>>();
test_class.type: List<Invoker<IHelloService>>
test_class.var_name: invokers
test_class.declarator: selectedInvokers = new ArrayList<Invoker<IHelloService>>()
test_class.original_string: List<Invoker<IHelloService>> selectedInvokers = new ArrayList<Invoker<IHelloService>>();
test_class.type: List<Invoker<IHelloService>>
test_class.var_name: selectedInvokers
test_class.declarator: cluster
test_class.original_string: AbstractClusterInvoker<IHelloService> cluster;
test_class.type: AbstractClusterInvoker<IHelloService>
test_class.var_name: cluster
test_class.declarator: cluster_nocheck
test_class.original_string: AbstractClusterInvoker<IHelloService> cluster_nocheck;
test_class.type: AbstractClusterInvoker<IHelloService>
test_class.var_name: cluster_nocheck
test_class.declarator: dic
test_class.original_string: StaticDirectory<IHelloService> dic;
test_class.type: StaticDirectory<IHelloService>
test_class.var_name: dic
test_class.declarator: invocation = new RpcInvocation()
test_class.original_string: RpcInvocation invocation = new RpcInvocation();
test_class.type: RpcInvocation
test_class.var_name: invocation
test_class.declarator: url = URL.valueOf("registry://localhost:9090/org.apache.dubbo.rpc.cluster.support.AbstractClusterInvokerTest.IHelloService?refer=" + URL.encode("application=abstractClusterInvokerTest"))
test_class.original_string: URL url = URL.valueOf("registry://localhost:9090/org.apache.dubbo.rpc.cluster.support.AbstractClusterInvokerTest.IHelloService?refer=" + URL.encode("application=abstractClusterInvokerTest"));
test_class.type: URL
test_class.var_name: url
test_class.declarator: consumerUrl = URL.valueOf("dubbo://localhost:9090?application=abstractClusterInvokerTest")
test_class.original_string: URL consumerUrl = URL.valueOf("dubbo://localhost:9090?application=abstractClusterInvokerTest");
test_class.type: URL
test_class.var_name: consumerUrl
test_class.declarator: invoker1
test_class.original_string: Invoker<IHelloService> invoker1;
test_class.type: Invoker<IHelloService>
test_class.var_name: invoker1
test_class.declarator: invoker2
test_class.original_string: Invoker<IHelloService> invoker2;
test_class.type: Invoker<IHelloService>
test_class.var_name: invoker2
test_class.declarator: invoker3
test_class.original_string: Invoker<IHelloService> invoker3;
test_class.type: Invoker<IHelloService>
test_class.var_name: invoker3
test_class.declarator: invoker4
test_class.original_string: Invoker<IHelloService> invoker4;
test_class.type: Invoker<IHelloService>
test_class.var_name: invoker4
test_class.declarator: invoker5
test_class.original_string: Invoker<IHelloService> invoker5;
test_class.type: Invoker<IHelloService>
test_class.var_name: invoker5
test_class.declarator: mockedInvoker1
test_class.original_string: Invoker<IHelloService> mockedInvoker1;
test_class.type: Invoker<IHelloService>
test_class.var_name: mockedInvoker1
test_class.file: dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/support/AbstractClusterInvokerTest.java
test_class.identifier: AbstractClusterInvokerTest
test_case.body: @Test()
      public void testTimeoutExceptionCode() {
          List<Invoker<DemoService>> invokers = new ArrayList<Invoker<DemoService>>();
          invokers.add(new Invoker<DemoService>() {
  
              @Override
              public Class<DemoService> getInterface() {
                  return DemoService.class;
              }
  
              public URL getUrl() {
                  return URL.valueOf("dubbo://" + NetUtils.getLocalHost() + ":20880/" + DemoService.class.getName());
              }
  
              @Override
              public boolean isAvailable() {
                  return false;
              }
  
              @Override
              public Result invoke(Invocation invocation) throws RpcException {
                  throw new RpcException(RpcException.TIMEOUT_EXCEPTION, "test timeout");
              }
  
              @Override
              public void destroy() {
              }
          });
          Directory<DemoService> directory = new StaticDirectory<DemoService>(invokers);
          FailoverClusterInvoker<DemoService> failoverClusterInvoker = new FailoverClusterInvoker<DemoService>(directory);
          try {
              failoverClusterInvoker.invoke(new RpcInvocation("sayHello", DemoService.class.getName(), "", new Class<?>[0], new Object[0]));
              Assertions.fail();
          } catch (RpcException e) {
              Assertions.assertEquals(RpcException.TIMEOUT_EXCEPTION, e.getCode());
          }
          ForkingClusterInvoker<DemoService> forkingClusterInvoker = new ForkingClusterInvoker<DemoService>(directory);
          try {
              forkingClusterInvoker.invoke(new RpcInvocation("sayHello", DemoService.class.getName(), "", new Class<?>[0], new Object[0]));
              Assertions.fail();
          } catch (RpcException e) {
              Assertions.assertEquals(RpcException.TIMEOUT_EXCEPTION, e.getCode());
          }
          FailfastClusterInvoker<DemoService> failfastClusterInvoker = new FailfastClusterInvoker<DemoService>(directory);
          try {
              failfastClusterInvoker.invoke(new RpcInvocation("sayHello", DemoService.class.getName(), "", new Class<?>[0], new Object[0]));
              Assertions.fail();
          } catch (RpcException e) {
              Assertions.assertEquals(RpcException.TIMEOUT_EXCEPTION, e.getCode());
          }
      }
test_case.class_method_signature: AbstractClusterInvokerTest.testTimeoutExceptionCode()
test_case.full_signature: @Test() public void testTimeoutExceptionCode()
test_case.identifier: testTimeoutExceptionCode
test_case.invocations: add valueOf getLocalHost getName invoke getName fail assertEquals getCode invoke getName fail assertEquals getCode invoke getName fail assertEquals getCode
test_case.modifiers: @Test() public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testTimeoutExceptionCode()
focal_class.declarator: logger = LoggerFactory.getLogger(AbstractClusterInvoker.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(AbstractClusterInvoker.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: directory
focal_class.modifier: protected
focal_class.original_string: protected Directory<T> directory;
focal_class.type: Directory<T>
focal_class.var_name: directory
focal_class.declarator: availablecheck
focal_class.modifier: protected
focal_class.original_string: protected boolean availablecheck;
focal_class.type: boolean
focal_class.var_name: availablecheck
focal_class.declarator: destroyed = new AtomicBoolean(false)
focal_class.modifier: private
focal_class.original_string: private AtomicBoolean destroyed = new AtomicBoolean(false);
focal_class.type: AtomicBoolean
focal_class.var_name: destroyed
focal_class.declarator: stickyInvoker = null
focal_class.modifier: private volatile
focal_class.original_string: private volatile Invoker<T> stickyInvoker = null;
focal_class.type: Invoker<T>
focal_class.var_name: stickyInvoker
focal_class.file: dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/AbstractClusterInvoker.java
focal_class.identifier: AbstractClusterInvoker
focal_class.interfaces: implements ClusterInvoker<T>
focal_class.class_method_signature: AbstractClusterInvoker.AbstractClusterInvoker()
focal_class.full_signature: public  AbstractClusterInvoker()
focal_class.identifier: AbstractClusterInvoker
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  AbstractClusterInvoker()
focal_class.class_method_signature: AbstractClusterInvoker.AbstractClusterInvoker(Directory<T> directory)
focal_class.full_signature: public  AbstractClusterInvoker(Directory<T> directory)
focal_class.identifier: AbstractClusterInvoker
focal_class.modifiers: public
focal_class.parameters: (Directory<T> directory)
focal_class.signature:  AbstractClusterInvoker(Directory<T> directory)
focal_class.class_method_signature: AbstractClusterInvoker.AbstractClusterInvoker(Directory<T> directory, URL url)
focal_class.full_signature: public  AbstractClusterInvoker(Directory<T> directory, URL url)
focal_class.identifier: AbstractClusterInvoker
focal_class.modifiers: public
focal_class.parameters: (Directory<T> directory, URL url)
focal_class.signature:  AbstractClusterInvoker(Directory<T> directory, URL url)
focal_class.class_method_signature: AbstractClusterInvoker.getInterface()
focal_class.full_signature: @Override public Class<T> getInterface()
focal_class.identifier: getInterface
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Class<T>
focal_class.signature: Class<T> getInterface()
focal_class.class_method_signature: AbstractClusterInvoker.getUrl()
focal_class.full_signature: @Override public URL getUrl()
focal_class.identifier: getUrl
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: URL
focal_class.signature: URL getUrl()
focal_class.class_method_signature: AbstractClusterInvoker.getRegistryUrl()
focal_class.full_signature: public URL getRegistryUrl()
focal_class.identifier: getRegistryUrl
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: URL
focal_class.signature: URL getRegistryUrl()
focal_class.class_method_signature: AbstractClusterInvoker.isAvailable()
focal_class.full_signature: @Override public boolean isAvailable()
focal_class.identifier: isAvailable
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isAvailable()
focal_class.class_method_signature: AbstractClusterInvoker.getDirectory()
focal_class.full_signature: public Directory<T> getDirectory()
focal_class.identifier: getDirectory
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Directory<T>
focal_class.signature: Directory<T> getDirectory()
focal_class.class_method_signature: AbstractClusterInvoker.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: AbstractClusterInvoker.isDestroyed()
focal_class.full_signature: @Override public boolean isDestroyed()
focal_class.identifier: isDestroyed
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isDestroyed()
focal_class.class_method_signature: AbstractClusterInvoker.select(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_class.full_signature: protected Invoker<T> select(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_class.identifier: select
focal_class.modifiers: protected
focal_class.parameters: (LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_class.return: Invoker<T>
focal_class.signature: Invoker<T> select(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_class.class_method_signature: AbstractClusterInvoker.doSelect(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_class.full_signature: private Invoker<T> doSelect(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_class.identifier: doSelect
focal_class.modifiers: private
focal_class.parameters: (LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_class.return: Invoker<T>
focal_class.signature: Invoker<T> doSelect(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_class.class_method_signature: AbstractClusterInvoker.reselect(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected, boolean availablecheck)
focal_class.full_signature: private Invoker<T> reselect(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected, boolean availablecheck)
focal_class.identifier: reselect
focal_class.modifiers: private
focal_class.parameters: (LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected, boolean availablecheck)
focal_class.return: Invoker<T>
focal_class.signature: Invoker<T> reselect(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected, boolean availablecheck)
focal_class.class_method_signature: AbstractClusterInvoker.invoke(final Invocation invocation)
focal_class.full_signature: @Override public Result invoke(final Invocation invocation)
focal_class.identifier: invoke
focal_class.modifiers: @Override public
focal_class.parameters: (final Invocation invocation)
focal_class.return: Result
focal_class.signature: Result invoke(final Invocation invocation)
focal_class.class_method_signature: AbstractClusterInvoker.checkWhetherDestroyed()
focal_class.full_signature: protected void checkWhetherDestroyed()
focal_class.identifier: checkWhetherDestroyed
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void checkWhetherDestroyed()
focal_class.class_method_signature: AbstractClusterInvoker.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: AbstractClusterInvoker.checkInvokers(List<Invoker<T>> invokers, Invocation invocation)
focal_class.full_signature: protected void checkInvokers(List<Invoker<T>> invokers, Invocation invocation)
focal_class.identifier: checkInvokers
focal_class.modifiers: protected
focal_class.parameters: (List<Invoker<T>> invokers, Invocation invocation)
focal_class.return: void
focal_class.signature: void checkInvokers(List<Invoker<T>> invokers, Invocation invocation)
focal_class.class_method_signature: AbstractClusterInvoker.doInvoke(Invocation invocation, List<Invoker<T>> invokers,
                                         LoadBalance loadbalance)
focal_class.full_signature: protected abstract Result doInvoke(Invocation invocation, List<Invoker<T>> invokers,
                                         LoadBalance loadbalance)
focal_class.identifier: doInvoke
focal_class.modifiers: protected abstract
focal_class.parameters: (Invocation invocation, List<Invoker<T>> invokers,
                                         LoadBalance loadbalance)
focal_class.return: Result
focal_class.signature: Result doInvoke(Invocation invocation, List<Invoker<T>> invokers,
                                         LoadBalance loadbalance)
focal_class.class_method_signature: AbstractClusterInvoker.list(Invocation invocation)
focal_class.full_signature: protected List<Invoker<T>> list(Invocation invocation)
focal_class.identifier: list
focal_class.modifiers: protected
focal_class.parameters: (Invocation invocation)
focal_class.return: List<Invoker<T>>
focal_class.signature: List<Invoker<T>> list(Invocation invocation)
focal_class.class_method_signature: AbstractClusterInvoker.initLoadBalance(List<Invoker<T>> invokers, Invocation invocation)
focal_class.full_signature: protected LoadBalance initLoadBalance(List<Invoker<T>> invokers, Invocation invocation)
focal_class.identifier: initLoadBalance
focal_class.modifiers: protected
focal_class.parameters: (List<Invoker<T>> invokers, Invocation invocation)
focal_class.return: LoadBalance
focal_class.signature: LoadBalance initLoadBalance(List<Invoker<T>> invokers, Invocation invocation)
focal_method.body: @Override
      public Result invoke(final Invocation invocation) throws RpcException {
          checkWhetherDestroyed();
  
          // binding attachments into invocation.
          Map<String, Object> contextAttachments = RpcContext.getContext().getObjectAttachments();
          if (contextAttachments != null && contextAttachments.size() != 0) {
              ((RpcInvocation) invocation).addObjectAttachments(contextAttachments);
          }
  
          List<Invoker<T>> invokers = list(invocation);
          LoadBalance loadbalance = initLoadBalance(invokers, invocation);
          RpcUtils.attachInvocationIdIfAsync(getUrl(), invocation);
          return doInvoke(invocation, invokers, loadbalance);
      }
focal_method.class_method_signature: AbstractClusterInvoker.invoke(final Invocation invocation)
focal_method.full_signature: @Override public Result invoke(final Invocation invocation)
focal_method.identifier: invoke
focal_method.invocations: checkWhetherDestroyed getObjectAttachments getContext size addObjectAttachments list initLoadBalance attachInvocationIdIfAsync getUrl doInvoke
focal_method.modifiers: @Override public
focal_method.parameters: (final Invocation invocation)
focal_method.return: Result
focal_method.signature: Result invoke(final Invocation invocation)