test_class.declarator: count = 0
test_class.modifier: private static volatile
test_class.original_string: private static volatile int count = 0;
test_class.type: int
test_class.var_name: count
test_class.declarator: activeLimitFilter = new ActiveLimitFilter()
test_class.original_string: Filter activeLimitFilter = new ActiveLimitFilter();
test_class.type: Filter
test_class.var_name: activeLimitFilter
test_class.file: dubbo-rpc/dubbo-rpc-api/src/test/java/com/alibaba/dubbo/rpc/filter/ActiveLimitFilterTest.java
test_class.identifier: ActiveLimitFilterTest
test_case.body: @Test
      public void testInvokeLessActives() {
          URL url = URL.valueOf("test://test:11/test?accesslog=true&group=dubbo&version=1.1&actives=10");
          Invoker<ActiveLimitFilterTest> invoker = new MyInvoker<ActiveLimitFilterTest>(url);
          Invocation invocation = new MockInvocation();
          activeLimitFilter.invoke(invoker, invocation);
      }
test_case.class_method_signature: ActiveLimitFilterTest.testInvokeLessActives()
test_case.full_signature: @Test public void testInvokeLessActives()
test_case.identifier: testInvokeLessActives
test_case.invocations: valueOf invoke
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testInvokeLessActives()
focal_class.file: dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/filter/ActiveLimitFilter.java
focal_class.identifier: ActiveLimitFilter
focal_class.interfaces: implements Filter
focal_class.class_method_signature: ActiveLimitFilter.invoke(Invoker<?> invoker, Invocation invocation)
focal_class.full_signature: @Override public Result invoke(Invoker<?> invoker, Invocation invocation)
focal_class.identifier: invoke
focal_class.modifiers: @Override public
focal_class.parameters: (Invoker<?> invoker, Invocation invocation)
focal_class.return: Result
focal_class.signature: Result invoke(Invoker<?> invoker, Invocation invocation)
focal_method.body: @Override
      public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
          URL url = invoker.getUrl();
          String methodName = invocation.getMethodName();
          int max = invoker.getUrl().getMethodParameter(methodName, Constants.ACTIVES_KEY, 0);
          RpcStatus count = RpcStatus.getStatus(invoker.getUrl(), invocation.getMethodName());
          if (max > 0) {
              long timeout = invoker.getUrl().getMethodParameter(invocation.getMethodName(), Constants.TIMEOUT_KEY, 0);
              long start = System.currentTimeMillis();
              long remain = timeout;
              int active = count.getActive();
              if (active >= max) {
                  synchronized (count) {
                      while ((active = count.getActive()) >= max) {
                          try {
                              count.wait(remain);
                          } catch (InterruptedException e) {
                          }
                          long elapsed = System.currentTimeMillis() - start;
                          remain = timeout - elapsed;
                          if (remain <= 0) {
                              throw new RpcException("Waiting concurrent invoke timeout in client-side for service:  "
                                      + invoker.getInterface().getName() + ", method: "
                                      + invocation.getMethodName() + ", elapsed: " + elapsed
                                      + ", timeout: " + timeout + ". concurrent invokes: " + active
                                      + ". max concurrent invoke limit: " + max);
                          }
                      }
                  }
              }
          }
          try {
              long begin = System.currentTimeMillis();
              RpcStatus.beginCount(url, methodName);
              try {
                  Result result = invoker.invoke(invocation);
                  RpcStatus.endCount(url, methodName, System.currentTimeMillis() - begin, true);
                  return result;
              } catch (RuntimeException t) {
                  RpcStatus.endCount(url, methodName, System.currentTimeMillis() - begin, false);
                  throw t;
              }
          } finally {
              if (max > 0) {
                  synchronized (count) {
                      count.notify();
                  }
              }
          }
      }
focal_method.class_method_signature: ActiveLimitFilter.invoke(Invoker<?> invoker, Invocation invocation)
focal_method.full_signature: @Override public Result invoke(Invoker<?> invoker, Invocation invocation)
focal_method.identifier: invoke
focal_method.invocations: getUrl getMethodName getMethodParameter getUrl getStatus getUrl getMethodName getMethodParameter getUrl getMethodName currentTimeMillis getActive getActive wait currentTimeMillis getName getInterface getMethodName currentTimeMillis beginCount invoke endCount currentTimeMillis endCount currentTimeMillis notify
focal_method.modifiers: @Override public
focal_method.parameters: (Invoker<?> invoker, Invocation invocation)
focal_method.return: Result
focal_method.signature: Result invoke(Invoker<?> invoker, Invocation invocation)